Quality RTOS & Embedded Software

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


Loading

freertos 8.0.1 failing to schedule any tasks after a sempahore take on Atmel SAMG55G19

Posted by srinaag on October 25, 2016

My project runs in total 13 different threads and the task facing the issue is the one with highest priority.

I am running a Freertos version 8.0.1 on Atmel SAMG55G19 microcontroller.

There is a xSemaphoreTake on my button task (task with highest priority) with a blocking period of 2 seconds. Once in a while Freertos tends to not unblock, even after the expiry of 2 seconds, the semaphore take leading to a frozen thread. I have already investigated and confirmed that no other task is interfering with this task by faulty interrupts or lengthy critical sections.

The issue is sporadic in nature and its frequency of occurrence is once or twice in a day.

Looking forward to your suggestions.

Thanks,

Srinaag.


freertos 8.0.1 failing to schedule any tasks after a sempahore take on Atmel SAMG55G19

Posted by rtel on October 25, 2016

Hi Srinaag,

The most likely cause is an incorrect interrupt priority assignment, even if you think it is correct.

http://www.freertos.org/RTOS-Cortex-M3-M4.html

The normal way of detecting this is to define configASSERT() (you will see a link to that on the page linked above), but you are using quite an old version of FreeRTOS and I'm not sure how many asserts it contains. I would recommend updating the FreeRTOS version to get better error detection.

The second most likely cause is a stack overflow.

http://www.freertos.org/Stacks-and-stack-overflow-checking.html

Hope this helps.


freertos 8.0.1 failing to schedule any tasks after a sempahore take on Atmel SAMG55G19

Posted by srinaag on October 25, 2016

Thank you for your suggestion, I will upgrade the Freertos and see if it helps fix things.

Thanks, Srinaag.


freertos 8.0.1 failing to schedule any tasks after a sempahore take on Atmel SAMG55G19

Posted by setharram on January 9, 2017

Hi,

I trying to porting freeRtos 7.3 to 9.0 for samG55 in my application. earlier i was using xTaskResumeFromISR() and vTaskSuspend() for task synchronize which was doing pretty well for my application but interrupt was less often. But later I found there are chances of missing, if interrupt rates are high and xSemaphoreGiveFromISR/xSemaphoreTake is solution for this.

While porting i faced the same issue has above. the semaphore take thread being into block state. Looks this related to interrupt priority. I have macro in FreeRTOSConfig.h which i didnt understood.

define configPRIO_BITS 2

configLIBRARYLOWESTINTERRUPTPRIORITY 0x0f configLIBRARYMAXSYSCALLINTERRUPT_PRIORITY 4

configKERNELINTERRUPTPRIORITY ( configLIBRARYLOWESTINTERRUPTPRIORITY << (8 - configPRIOBITS) ) configMAXSYSCALLINTERRUPTPRIORITY ( configLIBRARYMAXSYSCALLINTERRUPTPRIORITY << (8 - configPRIOBITS) )

Is this proper configured? i couldn't able to find any information regarding "configPRIO_BITS" for armM4. Please do needfull

Thanks, Seetharam


freertos 8.0.1 failing to schedule any tasks after a sempahore take on Atmel SAMG55G19

Posted by rtel on January 9, 2017

But later I found there are chances of missing, if interrupt rates are high and xSemaphoreGiveFromISR/xSemaphoreTake is solution for this.

If you are using FreeRTOS V9.0.0 then it is actually better to use task notifications as they are smaller and faster than semaphores. See the example on the following page: http://www.freertos.org/vTaskNotifyGiveFromISR.html

define configPRIO_BITS 2

I doubt that is correct as I've never seen a processor of this class only having 2 priority bits. Have a look in the hardware manual for the G55 part to find the number of priority bits that are actually implemented. It is likely to be between 3 and 5 inclusive.


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


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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