← Back to the chapter · Next detail →
Technical detail · Maintainable Firmware Practices
Task, driver, and configuration limits
A work queue holds tasks for later execution; an RTOS task is a scheduled unit of work. A devicetree overlay changes a board’s described hardware setup. MCUboot is a bootloader that can check and start firmware; an OTA slot holds an update or a previous image for recovery. For each tool, identify a limit, test the behavior at that limit, and keep the result with the build.
Different links need different fault tests. UART sends serial bytes, while CAN is a shared message bus used by many controllers. BLE GATT defines services and values exchanged over a Bluetooth Low Energy link. Protobuf is a structured binary message format. EEPROM stores small values without power, so a calibration record can survive a restart. Record the link, message format, and storage method in each test so the next person can reproduce it.
The FreeRTOS stack high-water mark reports the minimum unused stack space observed since the task was created. Little remaining space warns of possible overflow. To estimate peak use, subtract that minimum from the allocated stack size, using the units for the port. A driver binding links a described hardware device to the code that controls it. If the binding is wrong, the intended sensor may not be found or used. Test and record both against the actual build.
Turn each mechanism into a small review rule. If a FreeRTOS task owns publishing, record its priority, queue length, maximum wait, stack high-water mark, and what happens when the broker is unavailable. If Zephyr work queues handle sensor events, record the devicetree overlay, driver binding, timeout, and work-item drop policy. If an Arduino or PlatformIO prototype stores calibration in EEPROM or NVS, record the schema version, validation bounds, migration behavior, and the serial command or fixture used to write it.