Library slot

To use this library in your code:

import ec618.slot
Read-only EC618 dual-slot OTA state.
The EC618 AP image carries two VM slots, each SLOT-SIZE bytes at XIP addresses supplied by the booted image's partition table. A power-fail-safe anchor record tracks separate known-good and trial configurations (partition table plus console UART), which slot is known-good, and which, if any, is on trial.
Firmware mutation is intentionally available only through the privileged system.firmware service. This library exposes slot identity, geometry, and trial state without giving application containers a raw erase/write API.

Globals

Active-slot marker byte ('A' or 'B').

Size of one VM slot, in bytes.
Read from the running firmware (the layout it was built for), so this library never carries its own copy of the flash geometry.

Functions

Returns the slot the runtime is currently executing from (SLOT-A or SLOT-B). During a trial this is the slot under test, not necessarily the known-good one recorded in the anchor record.

Whether the running image is an unconfirmed trial — staged by a previous firmware update and not yet confirmed through system.firmware. If true, the image must validate through that service or it will be rolled back on the next reset.