Stops at Twelve

FreeRTOS Log Stops at 12 Debug

Symptom

With 20 readings requested the log prints readings 1 to 12, then stops. DONE never comes.

Circuit

Bench wiring: U1, an STM32F4 running FreeRTOS, runs a producer task at priority 2 that posts each reading into a four-slot queue, and a consumer task at priority 1 that takes them out and prints them. J1, a serial console, sends the reading count on PA10 and receives the log on PA9

Pass condition

Every reading prints as MSG:<n> <sum> in order, then DONE:<count>. The sum is the low 16 bits of its 400-word sample window. A quiet run prints only DONE:<count> <check>. The check folds every sum.

Expected log when the host sends 20: twenty lines MSG:1 44008 to MSG:20 2968, each the reading and the low 16 bits of its sample window's sum, one per reading and in order, then DONE:20, twenty-one lines in all. Below it, a quiet run: the host sends Q and the count, and the one line out is DONE:<count> <check>, the check folding every sum

Notes

FreeRTOS V11.1.0, preemptive, 1 ms tick. The host sends the count at start, or Q and the count for a quiet run.

Related challenges

Loading the interactive arena.