Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

EFM32GG Starter Kit STK3700 FreeRTOS

Posted by ignaciovarex on January 30, 2019

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

Posted by rtel on January 30, 2019

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.

Attachments

FreeRTOSConfig.h (10372 bytes)

EFM32GG Starter Kit STK3700 FreeRTOS

Posted by ignaciovarex on January 30, 2019

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.

Attachments

FreeRTOSConfig.h (10372 bytes)

EFM32GG Starter Kit STK3700 FreeRTOS

Posted by ignaciovarex on January 30, 2019

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.

Attachments

FreeRTOSConfig.h (10372 bytes)

EFM32GG Starter Kit STK3700 FreeRTOS

Posted by ignaciovarex on January 31, 2019

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.

Attachments

FreeRTOSConfig.h (10372 bytes)

EFM32GG Starter Kit STK3700 FreeRTOS

Posted by ignaciovarex on January 31, 2019

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.

Attachments

FreeRTOSConfig.h (10372 bytes)

EFM32GG Starter Kit STK3700 FreeRTOS

Posted by rtel on February 1, 2019

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

Attachments

FreeRTOSConfig.h (10372 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Mediatek

Renesas

RISC-V

SiFIve RISC-V

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner