EFM32GG Starter Kit STK3700 FreeRTOS

Hello Everyone, I am EFM32GG Starter Kit STK3700 and utilizing a simple example that starts a thread and waits for xQueueReceive that gets xQueueSendToBackFromISR from an uart receive ISR. My issue is that my uart receive ISR only gets triggered once and queue doesn’t seem work either when the ISR gets triggered. I have attached source code and a FreeRTOSCongfig file that I am working with. I can’t seem to pin point what’s going on. Any adicise would be greatly appreciated.

EFM32GG Starter Kit STK3700 FreeRTOS

You code doesn’t show how the queue is created or how data is being received from it. First, start without FreeRTOS, just use a very basic main() program with some interrupts to check that you can control the UART correctly – peripheral specific drivers are outside the scope of FreeRTOS. Only once you have the driver working, add in the FreeRTOS parts. Next, a Queue is not a good way of doing what you want. Have a look at using a stream buffer instead – it is designed for this kind of use case. Some older examples that predate stream buffers, and deliberately load the scheduler up for test purposes, do use queues, but it is not suggested for production code.

EFM32GG Starter Kit STK3700 FreeRTOS

Richard, Thank you for your response. I have created another project without the FreeRTOS transmit and receive work as I expected. There is a xQueueCreate in the main after the SLEEP_Init function call. xQueueGPS = xQueueCreate (3,64) I have also attempted to create it like this too xQueueGPS = xQueueCreate (3,sizeof(char)) I will take a look at stream buffer, however I would really like to understand where my break is. Anything that could help with this would be greatly appreciated.

EFM32GG Starter Kit STK3700 FreeRTOS

Hello Richard, I have an update. When comment out the following from my ISR xHigherPriorityTaskWokenUART1IRQ = pdFALSE;
          xQueueSendToBackFromISR(xQueueGPSrx, &rxData,
                  &xHigherPriorityTaskWoken_UART1_IRQ);

portYIELD_FROM_ISR(xHigherPriorityTaskWoken_UART1_IRQ);
My uart receive ISR functions as I expect. If at all that is a clue.

EFM32GG Starter Kit STK3700 FreeRTOS

I have managed to get things working. But I don’t understand why. I have to set “configMAXSYSCALLINTERRUPTPRIORITY 30” for thread that is waiting on the receive queue call for things to work. The thread priority that’s waiting on the queue is set to “tskIDLEPRIORITY + 1”. tskIDLE_PRIORITY is set to zero. Any insight would be greatly appreciated.

EFM32GG Starter Kit STK3700 FreeRTOS

I have managed to get things working. But I don’t understand why. I have to set “configMAXSYSCALLINTERRUPTPRIORITY 30” for thread that is waiting on the receive queue call for things to work. The thread priority that’s waiting on the queue is set to “tskIDLEPRIORITY + 1”. tskIDLE_PRIORITY is set to zero. Any insight would be greatly appreciated.

EFM32GG Starter Kit STK3700 FreeRTOS

From what you post it sounds like you have, or at least had, a misconfiguration. I recommend ensuring you are using the very latest version of FreeRTOS, and have configASSERT() defined, as the newer the version of FreeRTOS the more assert calls there are to check the software configuration matches the hardware you are running. Also check out this page, if you have not done so already (suspect you have read already, but I include the link just in case): https://www.freertos.org/RTOS-Cortex-M3-M4.html