Medius - Native APIFlashing

Flashing

Writing new firmware

Flashing writes new firmware onto the box, to update or recover it. The box has two chips; flash each separately. With firmware already running, no physical button is needed: a REBOOT command restarts a chip into ROM download mode (a built-in loader that takes firmware over serial), then a flashing tool writes the image.

Two chips

Flash each separately

Pick the chip with the REBOOT target byte, then flash it over the link in the table.

ChipRebootFlashed over
Device chiptarget = 0The same CH343 serial link, with esptool.
Host chiptarget = 1Its own USB connection; the device relays the reboot over the inter-chip link.

Version scheme

major.minor.patch

Read the running version with QUERY(VERSION).

Notes

  • The REBOOT path needs working firmware to receive the frame. A chip with no firmware yet (a first flash) or a bad image can't, so enter download mode the hardware way: hold the chip's BOOT button while you reset or power on the box.
  • A run reboot (target = 2 or 3) is the only software cold-reboot; DTR/RTS aren't wired to a reset on this board.
  • After a download reboot the serial port sits in the ROM bootloader (plain ASCII the frame decoder ignores) until you finish flashing or power-cycle.
  • Persisted per-box data survives an app reflash.

The medius crate's flash feature does this from Rust.