Skip to main content

Module debug

Module debug 

Source
Expand description

Debug-probe nets (J-Link / OpenOCD): flash, erase, reset, memory reads, and RTT log streaming.

Unlike the instrument nets, debug talks to the box’s dedicated debug service on port 8765 (published on the box host), not the port-9000 server. A crate::LagerBox transparently reaches both: the debug service lives on the same host, and the crate resolves the debug net’s full saved record from :9000/nets/list to hand to the service.

use lager::LagerBox;

let lager = LagerBox::from_env()?;
let debug = lager.debug("debug1");

debug.connect()?;
debug.erase()?;
debug.flash("firmware.hex")?;
debug.reset(false)?;
let vector_table = debug.read_memory(0x0800_0000, 16)?;
println!("{vector_table:02x?}");

Structs§

AsyncDebugNet
Handle for a debug-probe net (async).
ConnectOptions
Options for DebugNet::connect_with.
DebugNet
Handle for a debug-probe net (blocking).
RttOptions
Options for DebugNet::rtt / RTT streaming.
RttStream
A live RTT byte stream (blocking). Implements std::io::Read, so it can be wrapped in a std::io::BufReader and read line by line.

Enums§

FirmwareKind
Firmware image kind, inferred from the file extension by DebugNet::flash.