probe-web / @probe-web/ui / ProbeRttTerminal
Class: ProbeRttTerminal
Defined in: packages/ui/src/rtt-terminal.ts:39
<probe-rtt-terminal>: runs the monitor loop and shows RTT (String or defmt-decoded) and semihosting output in an xterm.js terminal. Typed input goes to RTT down channel 0, a line at a time. Setting ProbeRttTerminal.bootInfo (from flash-done) makes Run + monitor start the flashed image; otherwise it attaches to the already running target.
Pair it with <probe-semihosting-console> by setting that element's source to this one.
Fires
monitor-event: For every event from the monitor loop (RTT discovery, text, defmt lines, raw bytes, semihosting output).detailis theMonitorEvent.monitor-exit: The monitor loop ended.detailis theWire.MonitorExitReason. Not fired if the loop failed with an error.
Example
<probe-rtt-terminal id="rtt"></probe-rtt-terminal>const rtt = document.querySelector('probe-rtt-terminal')!;
rtt.session = session;
rtt.bootInfo = bootInfo; // from <probe-flash-panel>'s flash-done
rtt.elf = rtt.defmtElf = elfBytes; // exact RTT address, and defmt decoding
const exit = await rtt.start();Extends
LitElement
Constructors
Constructor
new ProbeRttTerminal(): ProbeRttTerminal;Defined in: node_modules/@lit/reactive-element/development/reactive-element.d.ts:527
Returns
ProbeRttTerminal
Inherited from
LitElement.constructorProperties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
session | Session | null | null | The attached session to monitor; the buttons are disabled without one. | packages/ui/src/rtt-terminal.ts:54 |
bootInfo | BootInfo | null | null | How to start the flashed firmware (from flash-done); null attaches to it as it runs. | packages/ui/src/rtt-terminal.ts:56 |
elf | Uint8Array<ArrayBufferLike> | null | null | ELF of the running firmware; its _SEGGER_RTT symbol gives an exact scan region. | packages/ui/src/rtt-terminal.ts:58 |
defmtElf | Uint8Array<ArrayBufferLike> | null | null | ELF whose defmt table decodes the channels (usually the same file). | packages/ui/src/rtt-terminal.ts:60 |
Methods
start()
start(): Promise<
| MonitorExitReason
| null>;Defined in: packages/ui/src/rtt-terminal.ts:102
Set up RTT and run the monitor loop until the target exits or ProbeRttTerminal.stop is called. Resolves with the monitor's exit reason, or null if it failed or was not started (no session, or already running).
Returns
Promise< | MonitorExitReason | null>
stop()
stop(): Promise<void>;Defined in: packages/ui/src/rtt-terminal.ts:133
Cancel the running monitor loop; ProbeRttTerminal.start then resolves.
Returns
Promise<void>
onEvent()
onEvent(e): void;Defined in: packages/ui/src/rtt-terminal.ts:141
Called for every monitor event: fires monitor-event and writes the event to the terminal. Overridable for tests and automation.
Parameters
| Parameter | Type |
|---|---|
e | MonitorEvent |
Returns
void