Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists