Skip to content

probe-web / @probe-web/ui / ProbeFlashPanel

Class: ProbeFlashPanel ​

Defined in: packages/ui/src/flash-panel.ts:44

<probe-flash-panel>: picks an image (a file, a watched file, or a preset FlashJob), shows the per-operation progress probe-rs reports (fill/erase/program/verify), and offers verify-only and erase-all.

With the File System Access API, Pick file & watch… keeps a handle to the file (remembered across reloads under ProbeFlashPanel.rememberAs) and re-flashes whenever it changes on disk.

Fires ​

  • flash-done: Flashing succeeded. detail is { bootInfo, ms }: the Wire.BootInfo to hand to <probe-rtt-terminal> / <probe-test-runner>, and the duration in milliseconds.
  • flash-failed: Flashing threw. detail is the error.
  • verify-done: A verify-only run finished. detail is the Wire.VerifyResult ('Ok' or 'Mismatch').
  • erase-done: An erase-all finished. No detail.
  • artifact-changed: The watched file changed on disk. detail is the ArtifactChange from @probe-web/artifacts (name, bytes, lastModified). Fired before the automatic re-flash starts.

Example ​

html
<probe-flash-panel id="flash" chip-erase></probe-flash-panel>
ts
const flash = document.querySelector('probe-flash-panel')!;
flash.session = session;
flash.addEventListener('flash-done', (e) => {
  const { bootInfo, ms } = (e as CustomEvent<{ bootInfo: Wire.BootInfo; ms: number }>).detail;
  rtt.bootInfo = bootInfo;
});

Extends ​

  • LitElement

Constructors ​

Constructor ​

ts
new ProbeFlashPanel(): ProbeFlashPanel;

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

Returns ​

ProbeFlashPanel

Inherited from ​

ts
LitElement.constructor

Properties ​

PropertyTypeDefault valueDescriptionDefined in
sessionSession | nullnullThe attached session to flash through; the buttons are disabled without one.packages/ui/src/flash-panel.ts:84
jobFlashJob | nullnullOptional preset job (e.g. from a manifest). A chosen or watched file overrides its image; its format, base address, skip and options are kept.packages/ui/src/flash-panel.ts:89
verifybooleantrueVerify the flash contents after programming.packages/ui/src/flash-panel.ts:91
chipErasebooleanfalseErase the whole chip rather than only the sectors being written.packages/ui/src/flash-panel.ts:93
keepUnwrittenbooleanfalsePreserve the bytes of partially written sectors instead of leaving them erased.packages/ui/src/flash-panel.ts:95
rememberAsstring'flash-panel'Key under which the picked file handle is remembered (in IndexedDB) across reloads. Give each panel on a page its own key.packages/ui/src/flash-panel.ts:107

Accessors ​

effectiveJob ​

Get Signature ​

ts
get effectiveJob(): FlashJob | null;

Defined in: packages/ui/src/flash-panel.ts:224

The job the Flash button would run: the chosen file, else the watched file, else ProbeFlashPanel.job's image, combined with the panel's format, address and option settings. null when there is no image.

Returns ​

FlashJob | null

Methods ​

resumeWatch() ​

ts
resumeWatch(): Promise<void>;

Defined in: packages/ui/src/flash-panel.ts:161

Resume watching the file remembered from a previous visit, asking the browser for read permission again. Needs a user gesture (the Resume watching button).

Returns ​

Promise<void>


forgetRemembered() ​

ts
forgetRemembered(): Promise<void>;

Defined in: packages/ui/src/flash-panel.ts:174

Drop the remembered file handle so it is not offered again.

Returns ​

Promise<void>


pickAndWatch() ​

ts
pickAndWatch(): Promise<void>;

Defined in: packages/ui/src/flash-panel.ts:183

Pick a file with the File System Access API, remember it, and watch it: each change fires artifact-changed and, while re-flash on change is ticked, flashes it.

Returns ​

Promise<void>


clearArtifact() ​

ts
clearArtifact(): void;

Defined in: packages/ui/src/flash-panel.ts:212

Stop watching and forget the picked file.

Returns ​

void


flash() ​

ts
flash(): Promise<void>;

Defined in: packages/ui/src/flash-panel.ts:278

Flash ProbeFlashPanel.effectiveJob; fires flash-done or flash-failed. No-op without a session or image.

Returns ​

Promise<void>


verifyOnly() ​

ts
verifyOnly(): Promise<void>;

Defined in: packages/ui/src/flash-panel.ts:309

Compare the flash with ProbeFlashPanel.effectiveJob's image without writing; fires verify-done.

Returns ​

Promise<void>


eraseAll() ​

ts
eraseAll(): Promise<void>;

Defined in: packages/ui/src/flash-panel.ts:325

Erase the whole flash; fires erase-done.

Returns ​

Promise<void>