Prepare the host and board
- Install the SEGGER J-Link Software for your host. It includes J-Link GDB Server.
- Connect the probe to the board’s debug connector with the correct signal wiring, ground, and target voltage reference. Power the board.
- Build an ELF with debug symbols. To attach to an existing run, use the ELF that matches the firmware on the board.
- Find the exact SEGGER device name and whether the board uses SWD or JTAG.
- Close other applications that hold the probe.
PATH or in SEGGER’s default folders:
In Debug mode, if a J-Link probe is connected but the software isn’t found, Embedder shows J-Link Software Required. Install the software, then choose I’ve installed it, retry detection. Continue without J-Link carries on without J-Link debugging.
Record the device
The device name must match an entry in your installed SEGGER device list. A board name or a nearby MCU name isn’t a substitute. In VS Code, select an RTT port in the Embedder Monitor: its Device picker lists the names from your installed J-Link software, and you can filter it with Search device…. In EMBEDDER.md, set the debug interface and record the exact device name so every chat uses the same target:Start a debug run
Switch to Debug mode with/debug, then give Embedder the artifact, device name, and interface:
build/app.elf and the interface with your project’s values. Embedder asks you to approve before it connects, unless your approval settings already allow it. A normal connection programs the ELF and tries to stop at main. If main isn’t reached within about 5 seconds, Embedder halts the target where it is, so check the reported stop location.
You can then ask for breakpoints, stepping, stack frames, variables, registers, or memory. See GDB debugging.
Attach to existing firmware
The normal connection programs the ELF. Ask for attach-only to load symbols without programming or running tomain. Ask for no halt as well if the target should keep running.
Script a J-Link connection
For a repeatable check, save a hardware script under.embedder/hardware/:
RTT and probe sharing
Use RTT for firmware output through J-Link. A J-Link debug connection starts RTT by default, but the firmware must provide RTT channels. Starting a J-Link debug session takes over the probe:- An RTT session that uses the probe is released.
- Any J-Link GDB Server already running on this computer is closed, including one started by another tool.
Troubleshoot
- J-Link Software Required, or
JLinkGDBServer not found: install the full SEGGER package. If you installed it outside the default folders, add its folder toPATHand restart VS Code or the terminal running Embedder. - Unknown device: check the exact SEGGER name and whether your installed package supports it.
- Target voltage too low: the board isn’t powered or the voltage reference isn’t connected.
- Connection times out: the probe responds but the target doesn’t. Check target power and SWD or JTAG wiring.
- Cannot connect: check target power, voltage reference, wiring, the SWD or JTAG choice, and competing probe users.
- Wrong source or missing variables: use matching symbols and check optimization settings.
- Run-to-main fails: verify the entry path and the
mainsymbol, then inspect the actual stop reason before continuing.