J-Link Rtt for the Masses Using Semihosting on Arm
Posted4 months agoActive4 months ago
bogdanthegeek.github.ioTechstory
supportivepositive
Debate
20/100
Embedded SystemsDebuggingArm Architecture
Key topics
Embedded Systems
Debugging
Arm Architecture
The article discusses using J-Link RTT with semihosting on ARM for efficient debugging, and the discussion highlights the pros and cons of semihosting, as well as alternative approaches.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
1h
Peak period
3
1-2h
Avg / period
2
Key moments
- 01Story posted
Sep 14, 2025 at 8:00 PM EDT
4 months ago
Step 01 - 02First comment
Sep 14, 2025 at 9:12 PM EDT
1h after posting
Step 02 - 03Peak activity
3 comments in 1-2h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 14, 2025 at 11:38 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45244601Type: storyLast synced: 11/20/2025, 5:54:29 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Another fun trick: route all semihosting calls through this function in RAM:
Then when you connect the debugger, overwrite with `BKPT 0xAB` to enable semihosting like so: This saves the overhead of an interrupt when not in use. You can still have the hardfault handler ignore it in case you uncleanly disconnect the debugger.1) Semihosting calls are extremely slow. They halt the processor until the debug probe polls the target, notices that it's stopped at a semihosting breakpoint, handles that, and resumes it. This can take tens to hundreds of milliseconds per call.
2) You technically need to initialize the semihosting file descriptors with an open() call before using them. Many debuggers will allow you to use the descriptors without initialization, but not all will.