pub struct DebugNet<'a> { /* private fields */ }Expand description
Handle for a debug-probe net (blocking).
Created via crate::LagerBox::debug. Cheap to construct; the net’s
saved record is fetched from the box on first use.
Implementations§
Source§impl DebugNet<'_>
impl DebugNet<'_>
Sourcepub fn connect(&self) -> Result<DebugConnection>
pub fn connect(&self) -> Result<DebugConnection>
Connect to the probe with default options (starts a GDB server).
Sourcepub fn connect_with(&self, opts: &ConnectOptions) -> Result<DebugConnection>
pub fn connect_with(&self, opts: &ConnectOptions) -> Result<DebugConnection>
Connect to the probe with explicit options.
Sourcepub fn disconnect(&self, keep_running: bool) -> Result<()>
pub fn disconnect(&self, keep_running: bool) -> Result<()>
Disconnect. If keep_running is true the gdbserver is left running so
an external GDB client can stay attached.
Sourcepub fn reset(&self, halt: bool) -> Result<()>
pub fn reset(&self, halt: bool) -> Result<()>
Reset the target, optionally halting at the reset vector.
Sourcepub fn flash(&self, firmware_path: impl AsRef<Path>) -> Result<()>
pub fn flash(&self, firmware_path: impl AsRef<Path>) -> Result<()>
Flash a firmware file, inferring the type from its extension
(.hex, .elf, .bin). .bin is flashed at 0x08000000; use
DebugNet::flash_bin to choose the address.
Sourcepub fn flash_bin(
&self,
firmware_path: impl AsRef<Path>,
address: u32,
) -> Result<()>
pub fn flash_bin( &self, firmware_path: impl AsRef<Path>, address: u32, ) -> Result<()>
Flash a raw binary at an explicit base address.
Sourcepub fn flash_bytes(
&self,
contents: &[u8],
kind: FirmwareKind,
address: Option<u32>,
) -> Result<()>
pub fn flash_bytes( &self, contents: &[u8], kind: FirmwareKind, address: Option<u32>, ) -> Result<()>
Flash raw firmware bytes of a known kind.
Sourcepub fn read_memory(&self, address: u64, length: usize) -> Result<Vec<u8>>
pub fn read_memory(&self, address: u64, length: usize) -> Result<Vec<u8>>
Read length bytes of target memory starting at address.
Sourcepub fn info(&self) -> Result<DebugInfo>
pub fn info(&self) -> Result<DebugInfo>
Probe/target information (device, arch, backend, connected state).
Sourcepub fn status(&self) -> Result<DebugStatus>
pub fn status(&self) -> Result<DebugStatus>
Whether a gdbserver/daemon is currently running for this probe.
Sourcepub fn rtt(&self) -> Result<RttStream>
pub fn rtt(&self) -> Result<RttStream>
Open an RTT log stream on channel 0.
Returns a reader that yields the target’s RTT output as raw bytes
until the connection closes or the reader is dropped. Wrap it in a
std::io::BufReader to read lines.
Sourcepub fn rtt_with(&self, opts: &RttOptions) -> Result<RttStream>
pub fn rtt_with(&self, opts: &RttOptions) -> Result<RttStream>
Open an RTT log stream with explicit options.