Requires:
- build probe code for your stlink with https://github.com/blackmagic-debug/blackmagic (precompiled in binaries/)
meson setup build --cross-file cross-file/stlink.ini -Dtargets=rp -Dbmd_bootloader=falsemeson compile -C build- this is for stlink-v2
- build stlink-tool from https://github.com/jeanthom/stlink-tool
- git submodule update --init
- make
- flash stlink:
- ${path}/stlink-tool ${blackmagic_path}/build/blackmagic_stlink_firmware.bin
- cortex debug plugin, with gdb-multilib
- default pico-sdk tools, like cmake
- set the paths in launch.json and tasks.json of the binaries
Tested on Ubuntu 22.04.
Requires:
- flash stlink with stlink-tool:
- download from https://github.com/sakana280/stlink-tool/releases/download/1.0-Win64/stlink-tool.exe or use one from binaries folder.
- ./binaries/stlink-tool ./binaries/blackmagic_stlink_firmware.bin
- use zadig to fix stlink driver (libusbK), https://zadig.akeo.ie/ , only that one!
- install arm toolchain for gdb (https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads , use the .exe installer), make sure it gets added to your path or you need to change the path in launch.json to an absolute path.
- install cortex debug plugin, vscode will show a popup for recommended plugins.
- install raspberry pi pico plugin
- start vscode as "Pico - Visual Studio Code" to fix the env vars if it's not working. Maybe install python3 from Microsoft Store if it isn't installed.
- set the paths in launch.json and tasks.json of some of the binaries
- task
buildwill compile the code for the rp2040 - task
triggerBMPAndBuildincludes thebuildtask and then triggers the stlink into probe mode. By default it starts in DFU mode (for flashing new probe code). - Launch config
BMP Debuguses this last task and starts cortex-debug with the USB connection. This also flashes the rp2040.
- also build the blackmagic app
meson setup build -Dprobe=''(might need to delete build directory before)meson compile -C build
${path}/stlink-toolto trigger DFU../build/blackmagic --device /dev/ttyACM0 ../RPi-Pico-Baremetal/test_cmake/build/hello_world.bin -w -VChange path to device and path to bin, must be the bin!- Somehow flashing again doesn't work, second time it will.