惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
量子位
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell

LinuxJedi's /dev/null

When an Amiga A570 Repair Took a Strange Turn When the Docs Fall Short: Investigating Claude Code’s Budget Cap AI Didn’t Destroy Your Company, Your Processes Did When PAL Goes Wrong: Repairing an Amiga CD32 Reviving a Roland SoundBrush: Floppy MIDI Playback Without the Computer A Socket 7 Upgrade: Moving Beyond the 486 Reviving an Amiga 600: From Dead Video to a Clean Boot The Amiga 1200 That Fought Back: The Faults I Missed the First Time Why Recapping Isn’t Always the Cure: And Amiga 1200 Repair Story
Ditching the Debug Probe: Using a Segger J-Link with a Ra...
LinuxJedi · 2026-02-13 · via LinuxJedi's /dev/null

I was working on benchmarking some new code on a Raspberry Pi Pico today and needed to debug it. This proved to be more difficult than it should be, so I figured I would document how I did it.

The Problem

The Pi Pico has a readily available Debug Probe that uses a SWD connection to the Pico. I happen to have one that I bought years ago, unfortunately it was DoA when I bought it years ago, there is a dead buffer in it that I need to replace one day. I didn’t find this out until it was far too late to return it.

As an alternative, another Pi Pico can be used as a debugger, similar to the Debug Probe. Unfortunately, I didn’t have an RP2040 board with spare GPIO handy to do this. Time for an alternative method.

J-Link

A colleague pointed out that Segger J-Link supports the RP2040 MCU in the Pi Pico, so, I hooked it up. Segger has a page which outlines how to hook it up. I have a couple of genuine Segger J-Links, I grabbed my older v10 one first and wired everything up.

Once this was hooked up, I modified the standard OpenOCD command to connect via the J-Link, which turns it into:

openocd -f interface/jlink.cfg -f target/rp2040.cfg -c "adapter speed 5000"

I even tried different connection speeds, no joy. Time to try something else…

J-Link GUI

The J-Link has a bunch of GUI tools, one of which is to connect as a debugger, so I loaded this tool.

Once loaded I configured it for an RP2040 SWD connection.

When scrolling down, there is a button to connect, and…

Immediate connection! Excellent!

This is listening on port 2331 for a debug connection. So, we open a GDB connection by doing:

arm-none-eabi-gdb benchmark.elf

Note that you need to use the .elf here instead of the .uf2. Once loaded, you need to connect to the debugger. This is done by entering the following into gdb. This will make the GDB connection go green in the J-Link GUI:

target remote localhost:2331
monitor reset

You only need to do monitor reset if you want to restart the execution on RP2040. From here you can enter continue and the code execution will continue. You can’t use run like you would locally debugging.

Conclusion

Using this method, I was quickly able to debug the problem I was having (I made a dumb configuration error) and was able to continue. I think I’ll be using J-Link for RP2040 / RP2350 debugging from now on!