In development. It changes without notice.
Topics
The parts of the meter's firmware, from its boot down to the registers it drives. Each topic opens with what its part does.
| Entry point | app_main(): the boot order, and the five objects of the instrument |
| INA228 driver | The TI INA228 on the I2C bus: its register map, field encodings and LSBs, the bring-up that proves what is on the bus, and register access |
| I2C master | I2C0 on its registers for the INA228's bus: the set-up, the clock set by rewriting the timing registers, each transaction polled to its end, and the recovery of a stuck bus, with nothing allocated, in place of ESP-IDF's I2C master |
| Sampling | The four profiles, the pacing, the TRACE ring, the stream queue, the zero-offset null, and the integer arithmetic that turns counts into units |
| SCPI parser | SCPI-1999 and IEEE 488.2: program-message parsing, header matching, parameter decoding, the error queue and the status bytes |
| Bit work | Flag tests and register fields on std::uint32_t, so that no narrow unsigned operand is promoted to int (MISRA C++:2023 7.0.5) |
| Characters | Character classes, case folding, digits and the bytes a character stands for, from a compile-time table, with no character's numerical value used (MISRA C++:2023 7.0.3) |
| Text output | The bounded writer: typed appends on std::to_chars into a caller's buffer, with no format string, no variadic call and nothing allocated (MISRA C++:2023 21.10.1, 30.0.1) |
| Console | The UART0 command surface: the reader, the command table and every handler, the responses, the stream records and the status registers |
| Console line | UART0 on its registers for the console: the port, a static receive ring filled by an interrupt nothing allocated, the polled transmit and the overflow -363 reports, in place of ESP-IDF's UART driver |
| Calibration | The working copy of the calibration (the null, the shunts, the tag and date) as a record of the flash log, the store's judgment of a record, the quality token, and the shunt calibration's arithmetic |
| Record logs | Append-only logs of records, each over two sectors of raw flash: the newest valid record wins, a power cut at any point of a save leaves the last complete one, and nothing is allocated; the calibration's store since FW-16, in the calib partition, and the pin map's from FW-03, in the pins partition, through a port on esp_flash_* and a static region check |
| Pin map | The board's pin table, generated from firmware/ |
| Relays | The relay module: the DUT's battery lead, the shunt bypass and the spares, the four circuits they make, make-before-break, the null-path checks and the hold |
| Identity | Which instrument this is: the serial derived from the factory MAC (with its SHA-256), and the image it runs |
| Status LED | The carrier's addressable RGB LED, blanked once at boot and never lit |
| Heap monitor | The heap hooks that count every allocation and free, before app_main()'s first line and since, and the census build's ring of every event (DIAGnostic:HEAP?, docs/ |
| Interrupt routing | A peripheral's interrupt routed to a free level-1 CPU line by the CPU's own tables, with nothing allocated: the ALERT pin's and UART0's, in place of ESP-IDF's GPIO ISR service, its UART driver's interrupt and its interrupt allocator |
| Watchdog | Timer Group 0's main watchdog timer, fed only once the console, the sampler and Core 0's idle task have all checked in, with nothing allocated: in place of ESP-IDF's task watchdog |
| Startup memory | Static storage in place of what ESP-IDF's startup would take from the heap before app_main(): the idle tasks' stacks and control blocks, and PSA's initialization, linked wrapped |
| Brownout detector | The supply's brownout detector, armed to reset the chip in hardware with no interrupt and nothing allocated: in place of ESP-IDF's brownout handling |
| FreeRTOS ticks | Milliseconds to ticks and the wait with no deadline, in place of FreeRTOS's casting macros pdMS_ |