xQueue between cores takes long time
Posted: Fri May 05, 2023 5:37 am
I have a heavy processing function (DSP) that I want to perform in parallel, so I have pinned a 'task' task to Core0 and 'offload' task to Core1,
The processing is on a buffer in memory of 300k Bytes, so I am sending a pointer to the center of the buffer using xQueueSend, so that the offload task in Core1 can start processing from the middle, this should decrease my processing time by almost half, however, I am finding that the xQueueSend calls are taking around 10ms as per the timestamp
below logs:
1798 ms: Core1 is ready waiting for xQueue
25208ms Core0 is ready to start processing and sends a message to Core1
25218ms: 10 seconds later, Core1 returns from xQueueReceive
here the logs:
What could be causing this? is it normal for xQueue to take 10ms?
Or do I have memory collision? because both cores call the same function to process the data, the function just requires a pointer to memory and length,
The processing is on a buffer in memory of 300k Bytes, so I am sending a pointer to the center of the buffer using xQueueSend, so that the offload task in Core1 can start processing from the middle, this should decrease my processing time by almost half, however, I am finding that the xQueueSend calls are taking around 10ms as per the timestamp
below logs:
1798 ms: Core1 is ready waiting for xQueue
25208ms Core0 is ready to start processing and sends a message to Core1
25218ms: 10 seconds later, Core1 returns from xQueueReceive
here the logs:
Code: Select all
W (1798) offload: waiting for message...
I (25208) task: Sending message xQueueSend Core 0
W (25218) offload: message received xQueueReceive Core 1
I (25218) task: Start process, Core 0
I (25228) offload: Start process, Core 1
Or do I have memory collision? because both cores call the same function to process the data, the function just requires a pointer to memory and length,