Ration
A sensor monitoring system allocates a message buffer for every sensor event using pvPortMalloc. A producer task reads sensor values (incrementing: 1, 2, 3, ...) and posts them through a queue to a consumer task, which prints each value over UART. Each message buffer carries the reading plus a fixed window of raw samples captured at the event.
The system works for the first several readings, but under sustained operation it starts silently dropping messages: output stops partway through and the firmware never reports completion.
Expected UART output for N sensor events: MSG:1 MSG:2 ... MSG:N DONE:<N>
The system must deliver every reading and report DONE:<N>, no matter how long it runs. Find what fails under sustained load and fix the allocation strategy so the firmware survives arbitrarily long runs without dropping data.