Skip to content

RP2350: Improve config examples for secure/non-secure debug #131

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

Open
wants to merge 1 commit into
base: sdk-2.0.0
Choose a base branch
from

Conversation

PetteriAimonen
Copy link

This replaces the previous examples rp2350-dbgkey-nonsecure.cfg and rp2350-dbgkey-secure.cfg that had a hardcoded sequence of bits being sent. The new file rp2350-dbgkey.cfg can take the key from a variable. It also adds a print of the lock status after the key has been sent.

Example usage:

$ openocd -f interface/cmsis-dap.cfg -c 'set DEBUGKEY {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}' -f rp2350-dbgkey.cfg 
Open On-Chip Debugger 0.12.0+dev-00559-g04154af5d (2024-04-15-14:10)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Warn : An adapter speed is not selected in the init scripts. OpenOCD will try to run the adapter at very low speed (100 kHz).
Warn : To remove this warnings and achieve reasonable communication speed with the target, set "adapter speed" or "jtag_rclk" in the init scripts.
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E660443043813128
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 100 kHz
Info : SWD DPIDR 0x4c013477
Warn : gdb services need one or more targets defined
Core 0 CSW value: 0x02000052 (secure debug: denied, non-secure debug: allowed)
Core 1 CSW value: 0x02000012 (secure debug: denied, non-secure debug: denied)
Now attach a debugger to your RP2350 and load some code

Another file rp2350-nonsecure.cfg can be used to connect to targets which only allow non-secure debugging.

(This pull request is related to issue #129)

@PetteriAimonen
Copy link
Author

(On second thought, it might even be possible to combine this all in rp2350.cfg. It could automatically send the debug key if a variable is defined. It could also detect if secure debug is available and choose the mode based on it.)

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