Syntax
Global Options
| Option | Description |
|---|---|
--box TEXT | Lagerbox name or IP address |
--help | Show help message and exit |
Commands
| Command | Description |
|---|---|
gdbserver | Start JLinkGDBServer for debugging |
disconnect | Stop JLinkGDBServer |
flash | Flash firmware to target |
reset | Reset target device |
erase | Erase all flash memory |
memrd | Read memory from target |
status | Show debug net status |
health | Check debug service health |
Command Reference
gdbserver
Start JLinkGDBServer for remote debugging. This is the primary command to establish a debug connection.
--box TEXT- Lagerbox name or IP--force / --no-force- Force new connection (default: reuse existing)--halt / --no-halt- Halt device when connecting (default: no-halt)--speed KHZ- SWD/JTAG speed in kHz (e.g., 100, 4000) or “adaptive”--quiet- Suppress informational messages--json- Output results in JSON format--rtt- Automatically stream RTT logs after starting GDB server--rtt-reset- Reset device then stream RTT (captures boot sequence)--reset- Reset device after starting GDB server--gdb-port PORT- GDB server port (default: 2331)
disconnect
Stop JLinkGDBServer and free debug resources.
--box TEXT- Lagerbox name or IP--keep-server- Keep JLinkGDBServer running for external connections
flash
Flash firmware to target. Supports Intel HEX, ELF, and binary file formats.
--box TEXT- Lagerbox name or IP--hex FILE- Path to Intel HEX file--elf FILE- Path to ELF executable--bin ADDRESS FILE- Path to binary file with load address--verbose- Show detailed J-Link output--force-reconnect- Force clean reconnect before flash--erase- Erase all flash before flashing (ensures clean state)--halt / --no-halt- Halt device after flashing (default: no-halt)
reset
Reset the target device.
--box TEXT- Lagerbox name or IP--halt / --no-halt- Halt after reset (default: no-halt)--force-reconnect- Force clean reconnect before reset
erase
Erase all flash memory on target. This is a destructive operation.
--box TEXT- Lagerbox name or IP--speed KHZ- SWD/JTAG speed in kHz (default: 4000)--yes- Skip confirmation prompt--quiet- Suppress warning messages--json- Output results in JSON format--halt / --no-halt- Halt after erase (default: no-halt)
memrd
Read memory from the target device.
START_ADDR- Starting memory address (e.g., 0x20000000)LENGTH- Number of bytes to read
--box TEXT- Lagerbox name or IP--json- Output results in JSON format--halt / --no-halt- Halt device during read (default: no-halt)
status
Show debug net status and configuration information.
--box TEXT- Lagerbox name or IP
health
Check debug service health and resource usage.
--box TEXT- Lagerbox name or IP--verbose- Show detailed health information
Listing Debug Nets
When invoked with only--box and no subcommand, lists all debug nets on the Lager Box:
RTT (Real-Time Transfer) Logging
RTT provides low-latency logging over the debug probe. Use the--rtt or --rtt-reset flags with gdbserver:
Typical Workflows
Development Cycle
RTT Debugging
Memory Inspection
Clean Up
Supported Debug Probes
| Probe | Backend | Notes |
|---|---|---|
| J-Link | JLinkGDBServer | Full feature support, RTT |
| J-Link Plus | JLinkGDBServer | Full feature support, RTT |
| CMSIS-DAP | pyOCD | Open source, wide device support |
| ST-Link | pyOCD | STM32 devices |
| Flasher ARM | JLinkGDBServer | Production programming |
Notes
- Debug nets are created with
lager nets create <name> debug <device_type> <address> - The system auto-connects when needed for commands like
flashandreset - Use
--erasebefore flashing for clean RTT initialization - RTT streaming requires the device to have RTT support in firmware
- Memory reads are more reliable with
--haltto pause the CPU - Use
lager debug health --verboseto diagnose connection issues

