Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5288

SDK • Re: Any downsides to using RPi 5 for install of SDK?

$
0
0

Code:

sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "program blink/blink.elf verify reset exit"

I don't understand the need for 'sudo' with this, and it seems wrong - but it is needed; something about "unable to find matching CMSIS-DAP device"? Any analysis or comments on this would also be welcome.
After some digging, I found out how to make it so I don't have to run the above using sudo or su.

The issue is by default that USB device is a member of the root group, but if your user is a member of plugdev, you can add a rule to /etc/udev/rules.d to make the device a member of the plugdev group, and give the owner and group permissions to use it.

The openocd.pdf says
Properly installing OpenOCD sets up your operating system to grant it access to the de-
bug adapters. On Linux, this usually involves installing a file in /etc/udev/rules.d, so
OpenOCD has permissions. An example rules file that works for many common adapters
is shipped with OpenOCD in the contrib directory.
The getting started guide has this line to grab the source (slightly different than the debug probe info)

Code:

git clone https://github.com/raspberrypi/openocd.git --branch rp2040 --recursive --depth=1
Copy the rules file to /etc/udev/rules.d as root

Code:

sudo cp openocd/contrib/60-openocd.rules /etc/udev/rules.d
Gather info to determine vendor:ID of device:

Code:

lsusbBus 001 Device 003: ID 2e8a:000c Raspberry Pi Debug Probe (CMSIS-DAP)
Edit the 60-openocd.rules file and add these lines after the Rasberry Pi Picoprobe entry:

Code:

# Raspberry Pi Debug Probe (CMSIS-DAP)ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000c", MODE="660", GROUP="plugdev", TAG+="uaccess"
Reload the udev system rules and enable them immediately:

Code:

sudo udevadm control --reload-rulessudo udevadm trigger
Ensure you are in plugdev, if not add your user to the group.

Code:

groups breakerbreaker : users lp floppy dialout audio video cdrom input plugdev power netdev scanner
I am, so not necessary.

Now run openocd with no sudo

Code:

breaker@ace:~$ openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"Open On-Chip Debugger 0.11.0-g8e3c38f (2023-12-18-22:00)Licensed under GNU GPL v2For bug reports, read        http://openocd.org/doc/doxygen/bugs.htmlInfo : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.Info : Hardware thread awareness createdInfo : Hardware thread awareness createdInfo : RP2040 Flash Bank Commandadapter speed: 5000 kHzInfo : Listening on port 6666 for tcl connectionsInfo : Listening on port 4444 for telnet connectionsInfo : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6632891E3808730Info : CMSIS-DAP: SWD  SupportedInfo : CMSIS-DAP: FW Version = 2.0.0Info : CMSIS-DAP: Interface Initialised (SWD)Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0Info : CMSIS-DAP: Interface readyInfo : clock speed 5000 kHzInfo : SWD DPIDR 0x0bc12477Info : SWD DLPIDR 0x00000001Info : SWD DPIDR 0x0bc12477Info : SWD DLPIDR 0x10000001Info : rp2040.core0: hardware has 4 breakpoints, 2 watchpointsInfo : rp2040.core1: hardware has 4 breakpoints, 2 watchpointsInfo : starting gdb server for rp2040.core0 on 3333Info : Listening on port 3333 for gdb connections
There's that, but did you say debugging also was not yet working out for you?

Statistics: Posted by breaker — Wed Jan 31, 2024 7:43 am



Viewing all articles
Browse latest Browse all 5288

Trending Articles