Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added stock Pico SDK rp2040.cfg to enable flashing with picoprobe #64

Open
wants to merge 1 commit into
base: zephyr-20220611
Choose a base branch
from

Conversation

gherlein
Copy link

@gherlein gherlein commented Jul 27, 2024

The stock rp2040.cfg file is missing from the Zephyr fork of openocd. This prevents "west flash" from working using a PicoProbe (or a Pico set up as a PicoProbe). Zephyr will by default craft the following openocd command (replace gherlein with your own username):

/home/gherlein/zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/bin/openocd
-s /home/gherlein/zephyrproject/zephyr/boards/raspberrypi/rpi_pico/support
-s /home/gherlein/zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts
-f /home/gherlein/zephyrproject/zephyr/boards/raspberrypi/rpi_pico/support/openocd.cfg
-c 'source [find interface/cmsis-dap.cfg]'
-c 'transport select swd'
-c 'source [find target/rp2040.cfg]'
-c 'set_adapter_speed_if_not_set 2000'
'-c init'
'-c targets'
-c 'reset init'
-c 'flash write_image erase /home/gherlein/src/zephyr/blinky/build/zephyr/zephyr.hex'
-c 'reset run'
-c shutdown

That results in

Open On-Chip Debugger 0.12.0-g4d87f6d (2024-06-13-19:50)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
set_adapter_speed_if_not_set
swd
Can't find target/rp2040.cfg

This is because this repo lacks that file - it only has rp2040-core0.cfg. This patch copies the file from a working tree installed by the Raspberry Pi Pico SDK into zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts/target/ which then results in proper flashing using openocd via west.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant