Firmware Fundamentals — question 1 of 10
Write a real answer. It is graded against the question's rubric, and the mastery movement is computed by the same engine the product uses. Scoring here is deterministic rather than model-written, so this page costs nothing to run and nothing is saved. In a track built from your own posting, the same rubric is graded by the model, which is what produces feedback about your reasoning rather than about coverage.
You write a firmware loop that busy-waits on a global flag set inside an interrupt handler, like `while (!data_ready) {}`, before moving on. Unoptimized, it works fine on the bench. The moment you enable -O2 optimization, the loop never exits, even though a debugger shows the flag has actually become 1 in memory. Walk me through why this happens and how you would fix it.