I have this setup that is doing next to nothing. I have one task per direction (bridgeToRadio and radioToBridge) so that I can block while I’m waiting for data to come in.
My ISR uses xStreamBufferSendFromISR() minding the xHigherPriorityTaskWoken return result per FreeRTOS documentation. My highest priority task (bridgeToRadio) is blocking on xStreamBufferReceive with portMAX_DELAY. I’m expecting that the ISR will exit and return to the highest priority task that was previously blocked. However the time it takes is between 300us to 6000us as seen on my Oscilloscope for received data to be transmitted. All of the other tasks spend most of there time blocked on a vTaskDelay() or vTaskDelayUntil(). The concern is not so much the 6000us delay but more that some data is re-transmitted then it appears that a context switches ares happening (because the StreamBuffer has been emptied and the task is blocking again). My impression from the xStreamBufferSendFromISR() documentation is that my high priority task should be getting all the attention as long as there is data in the StreamBuffer.
I have one simple question, is my understanding correct here that my high task should run as long as there is data in the StreamBuffer?
CH3 (Pink) incoming data to STM32, CH1 (Yellow) output data from STM32, CH2 (Cyan) received data at other radio.
My queue trigger levels are set to 1. The system clock is running at 90MHz on an STM32. My tick rate is 1000 Hz.
------------------------------------------------------------------------------------------
TASK REPORT
------------------------------------------------------------------------------------------
order number name pri stack time cpu state
0 5 monitorPortTask 1 1280 711 0.02 Running
1 6 IDLE 0 1004 2878790 98.83 Ready
2 1 defaultTask 3 4023 3591 0.12 Blocked
3 4 sdmmcWriteTask 2 998 882 0.03 Blocked
4 2 bridgeToRadio 5 971 28300 0.97 Blocked
5 3 radioToBridge 4 973 451 0.02 Blocked
------------------------------------------------------------------------------------------
Total Run Time: 2912752
TotalHeapSize = 0x00012000
CurrentHeapFree = 0x00006CA0
MinumumEverFreeHeapSize = 0x00006CA0
MaximumEverUsedHeapSize = 0x0000B360