No description
  • C++ 85%
  • CMake 9.9%
  • C 5.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-16 19:49:31 +02:00
.vscode Disabled TX interrupt. 2026-10-10 22:36:05 +02:00
boards Added board specific defines 2026-09-24 20:59:00 +02:00
rcreader Added helper function 2026-10-16 19:49:31 +02:00
tmcstepper-lib Added helper function 2026-10-16 19:49:31 +02:00
.gitignore Initial Commit 2026-09-21 23:39:24 +02:00
CMakeLists.txt Lots of work 2026-10-10 08:32:24 +02:00
pico_sdk_import.cmake Initial Commit 2026-09-21 23:39:24 +02:00
README.md Documentation tweak 2026-10-10 21:38:03 +02:00
SKRController.cpp Added helper function 2026-10-16 19:49:31 +02:00

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

  1. Install MSYS2
  2. Open up an MSYS2 MINGW64 terminal and type
    pacman -Syu
    
  3. Close the terminal (it may have closed anyway) and re-open it and type:
    pacman -Su
    
  4. 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
    
  5. 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"
            ]
        }
    ]
}