Lost in Translation

A colleague wrote a runtime configuration manager for a data acquisition board. The firmware keeps device settings (calibration offset, sample interval, operating mode, channel, and alert threshold) in a config struct initialized with factory defaults.

The system controller hands those settings to the board through a shared mailbox in SRAM: it writes the five runtime values, then raises a ready flag last so the firmware knows the mailbox is complete. On boot the firmware waits for that flag, copies the mailbox values into its config struct, and prints the active configuration via UART for verification. You can see the mailbox addresses the controller uses in the starter code.

The code compiles without warnings and runs, but the reported values are always the factory defaults, never the runtime values the controller wrote. The writes appear to succeed (no fault, no crash), yet every read returns the original data as if nothing was written.

When the bug is fixed, the five "NAME:<value>" lines (CAL, INTERVAL, MODE, CHANNEL, THRESHOLD) show the runtime values the controller placed in the mailbox instead of the factory defaults.

Find and fix the bug. Think carefully about where data lives in memory on an embedded target and what that means for write operations.

Loading the interactive arena.