Famine

FreeRTOS Logger Misses Readings Debug

Symptom

Every reading prints. The log shows only the last one, and only once all three are done. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: inside U1, an STM32F4 running FreeRTOS, a sensor task and a logger task, both at priority 1, both print through USART1; PA9 carries USART1 TX to J1, a serial console, and PA10 carries RX back from it, on which the host sends the batch levels

Pass condition

Each SENSOR line is followed by the logger task's entry for it. Then DONE prints by 50 ms, and the kernel keeps time.

Expected output on the serial console within 50 ms when the host sends the levels 1180, 1260 and 1210: SENSOR 1223 then LOG 1 comma 1223, SENSOR 1306 then LOG 2 comma 1306, SENSOR 1245 then LOG 3 comma 1245, then DONE; each reading is followed by the logger's entry for it

Notes

The host sends the three batch levels, one per line, 1 ms after reset. FreeRTOS V11.1.0, preemptive, time slicing on, 1 ms tick.

Related challenges

Loading the interactive arena.