I have a queue of size 1 which contains a struct of some status fields. The queue is produced on core 1 and consumed on core 0.
Here is how I am producing the queue
Code: Select all
xQueueOverwrite(thing_telemetry_queue, &tlm);
Code: Select all
bool Thing_GetTelemetry(ThingTelemetry_t* state)
{
return (xQueuePeek(thing_telemetry_queue, &state, 0) == pdPASS);
}
Removing the reading of the queue results in stable code. Any ideas as to what is going on here? FreeRTOS should guarantee that there is never a data hazard when overwriting the queue, while the other core is reading, correct?