Add a board
A board backend stages an exported model, compiles it, uploads it, and returns runtime measurements through the device interface.
| Toolchain | Starting point |
|---|---|
| Arduino CLI | Use arduino_ble33.py for a fixed FQBN or arduino_portenta_h7.py for board options. Both wrap ArduinoDevice, which already stages the sketch and handles compile, upload, and measurement. |
| STM32 Cube and ST Edge AI | Start from stm32_nucleo_n657x0.py. Check project staging, generation, ST-LINK loading, and the serial protocol against the new target. The current backend is built around the Nucleo N657X0-Q project and runtime contract. |
| Other toolchains | Implement DeviceInterface in a dedicated backend and provide the build, upload, and runtime integration. |
- Supply a
DeviceSpecwith the board identifier, RAM and flash limits, arena candidates, and any required toolchain metadata. Make capability flags match the workflow your backend supports. - Implement or inherit
spec,compile,upload,measure, andevaluate. Add candidate staging and cleanup if the backend needs a generated project. Return structured result objects for the shared controller. - Add an entry in
_registry_entries()in__init__.py. Each entry maps a board name to a module path, wrapper class name, and default-spec symbol. The factory passesserial_portanddevice_optionsas keyword arguments. If you add board-specific settings, normalize them inresolve_device_options. - Select the registry key in
device.name. For the shipped Nano 33 BLE Sense wrapper, the key isARDUINO_NANO_33_BLE_SENSE.
Use mocked tool and serial responses to check timeout handling, telemetry parsing, and failure results. Then compile a candidate with the actual toolchain, upload it to a connected board, and verify runtime metrics. Measure energy with the CREST harness and INA228 telemetry path. See test_stm32_backend.py and test_stm32_runtime.py for examples.
For more information, read the full hardware backend README on GitHub.