- C++ 85%
- CMake 9.9%
- C 5.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .vscode | ||
| boards | ||
| rcreader | ||
| tmcstepper-lib | ||
| .gitignore | ||
| CMakeLists.txt | ||
| pico_sdk_import.cmake | ||
| README.md | ||
| SKRController.cpp | ||
SKR Pico Basked motor driver for robot
Generic
Build custom OpenOCD
If using the pico C++ SDK, it may come with an outdated OpenOCD that does not yet recognize the BYTe semiconductor BY25Q16BS Flash chip used in the BTT SKR Pico
To rectify that, you need to build your own OpenOCD version using the following insttuctions:
Setup Build environment
- Install MSYS2
- Open up an MSYS2 MINGW64 terminal and type
pacman -Syu - Close the terminal (it may have closed anyway) and re-open it and type:
pacman -Su - Close the terminal, and then re-open it, but this time as Administrator, and type:
pacman -S mingw-w64-x86_64-toolchain git make libtool pkg-config autoconf automake texinfo mingw-w64-x86_64-libusb - Close the terminal and perform any subsequent commands without admin rights
Note: May need to find a wayto install/build jimtcl, since using internal jimtcl for building rpi openocd is deprecated. (See JimTCL)
Build correct OpenOCD
Open an MSYS2 MINGW64 terminal to perform the following tasks
Clone the raspberry pi OpenOCD version. Note that it is better to use only the main branch, since any others found in any other instructions are not really maintained
git clone https://github.com/raspberrypi/openocd.git --depth=1
Next, update the flash chip list.
Copy /src/flash/nor/spi.c from the https://github.com/openocd-org/openocd repository to this repository. Is easiest to do through the explorer.
And build the custom openocd (while in the cloned openocd directory)
git submodule update --init --recursive
./bootstrap
./configure --enable-internal-jimtcl --enable-picoprobe --disable-werror
make -j4
Install the files in the system. Open MingW64 as administrator and (while in the cloned openocd directory) execute
make install
Using the new OpenOCD in VSCode
Next, edit the .vscode/launch.json file, so it includes the following. (Note that serverpath was changed to "c:/msys64/mingw64/bin/openocd.exe"
{
"version": "0.2.0",
"configurations": [
....
{
"name": "Pico Debug (Cortex-Debug with Homebrew OpenOCD)",
"cwd": "${userHome}/.pico-sdk/openocd/0.12.0+dev/scripts",
"executable": "${command:raspberry-pi-pico.launchTargetPath}",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"serverpath": "c:/msys64/mingw64/bin/openocd.exe",
"gdbPath": "${command:raspberry-pi-pico.getGDBPath}",
"debuggerArgs": ["-ex", "set debug-file-directory /debug"],
"device": "${command:raspberry-pi-pico.getChipUppercase}",
"configFiles": [
"interface/cmsis-dap.cfg",
"target/${command:raspberry-pi-pico.getTarget}.cfg"
],
"svdFile": "${userHome}/.pico-sdk/sdk/2.3.1/src/${command:raspberry-pi-pico.getChip}/hardware_regs/${command:raspberry-pi-pico.getChipUppercase}.svd",
"runToEntryPoint": "main",
// Fix for no_flash binaries, where monitor reset halt doesn't do what is expected
// Also works fine for flash binaries
"overrideLaunchCommands": [
"monitor reset init",
"load \"${command:raspberry-pi-pico.launchTargetPath}\""
],
"openOCDLaunchCommands": [
"adapter speed 5000"
]
}
]
}