Skip to content

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). detail is the MonitorEvent.
  • monitor-exit: The monitor loop ended. detail is the Wire.MonitorExitReason. Not fired if the loop failed with an error.

Example ​

html
<probe-rtt-terminal id="rtt"></probe-rtt-terminal>
ts
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 ​

ts
new ProbeRttTerminal(): ProbeRttTerminal;

Defined in: node_modules/@lit/reactive-element/development/reactive-element.d.ts:527

Returns ​

ProbeRttTerminal

Inherited from ​

ts
LitElement.constructor

Properties ​

PropertyTypeDefault valueDescriptionDefined in
sessionSession | nullnullThe attached session to monitor; the buttons are disabled without one.packages/ui/src/rtt-terminal.ts:54
bootInfoBootInfo | nullnullHow to start the flashed firmware (from flash-done); null attaches to it as it runs.packages/ui/src/rtt-terminal.ts:56
elfUint8Array<ArrayBufferLike> | nullnullELF of the running firmware; its _SEGGER_RTT symbol gives an exact scan region.packages/ui/src/rtt-terminal.ts:58
defmtElfUint8Array<ArrayBufferLike> | nullnullELF whose defmt table decodes the channels (usually the same file).packages/ui/src/rtt-terminal.ts:60

Methods ​

start() ​

ts
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() ​

ts
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() ​

ts
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 ​

ParameterType
eMonitorEvent

Returns ​

void