Skip to content

Architecture Overview

Val edited this page Nov 17, 2026 · 2 revisions

Two images

Image Runs from Job
Recovery Its own 128 KiB of Flash (copied to RAM) Checks and installs firmware, USB drive, file system repair. Small and independent of the application
Firmware Flash from 0x08040400 The instruments, UI, USB instrument, files

At power-on the device's boot code starts Recovery. Recovery jumps to the firmware unless F2 is held, the firmware asked for Recovery, or no valid firmware is installed. See Memory and Flash Layout.

Firmware structure

The firmware is a single foreground loop with interrupts and DMA; there is no RTOS. Work that could take long (file writes, decoding, USB transfers) is split into slices, so the loop stays responsive and the watchdog is fed.

            keys ─► input ─► application (controller, panels, actions)
                                   │
         ┌─────────────────────────┼────────────────────────────┐
         ▼                         ▼                            ▼
 instrument / DataAccess      ui (LVGL views)              settings / storage
   │      │       │                                        (JSON on FAT, external Flash)
   ▼      ▼       ▼
 acquisition  measurement/dmm  generator      decode        scpi ◄── usb (USBTMC, CDC)
 (ADC via     (meter UART      (DAC/PWM or    (protocol     (one engine for both
  timer+DMA)   protocol)        module)        decoders)     transports)
  • instrument::DataAccess is the single owner of the measurement hardware. The UI and SCPI both go through it, so local and remote control always see the same state.
  • Acquisition captures both channels with timer-driven DMA into a record arena; frames are handed to readers with explicit ownership.
  • Measurement/DMM speaks to the multimeter controller over UART: decoding packets and sending key commands, each confirmed by fresh packets where the protocol allows.
  • UI is built on LVGL; screens are composed of blocks whose order is configurable. Rendering is driven by changes.
  • SCPI has one parser and engine shared by USBTMC and CDC, with profiles per active instrument.
  • Settings are JSON files on the external Flash. Parsing and encoding use a dedicated RAM workspace.
  • Platform holds clocks, power, the watchdog and a stack guard that resets the device cleanly if the stack ever overflows.

Principles

  • Honest results: missing or doubtful data is marked as such.
  • Confirm before changing state: a refused change keeps the previous state.
  • Fixed memory: no heap outside LVGL; sizes are checked at compile time.
  • The protected boot block is never written.

Clone this wiki locally