Quality RTOS & Embedded Software

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


Loading

xTaskNotifyWait hangs all tasks

Posted by ringolds on December 10, 2015

Hi.

I have an issue with xTaskNotifyWait if using xTicksToWait parameter with value different than 0. If I set the time to wait to non 0 value the RTOS gets stuck in vPortEnterCritical (according to what I can see from debuging). However, the issue seems to be more complicated than that. It seems that the problem occurs only when the xTaskNotifyWait is called at a specific time after the vTaskStartScheduler is started.I am using the xTaskNotifyWait with non 0 wait value. However, only in one specific tasks it causes the RTOS to get stuck. Furthermore, I can actually avoid this issue by putting some artificial loop that eats some CPU cycles away before xTaskNotifyWait is called. Meaning: This does work:

~~~~ volatile uint32_t blaa; for (blaa = 0; blaa < 0xFFFFFU; blaa++) {

    }
    for (;;)
    {
        if (pdTRUE == xTaskNotifyWait(0U, UINT32_MAX, &task_notify_value, portMAX_DELAY))

~~~~

This does not work:

~~~~ for (;;) { if (pdTRUE == xTaskNotifyWait(0U, UINT32MAX, &tasknotifyvalue, portMAXDELAY)) ~~~~ I am running FreeRTOS 8.2.0 on Texas Instruments TMS570LS033x

Thanks for any help in advance.


xTaskNotifyWait hangs all tasks

Posted by rtel on December 10, 2015

I think TI distribute their own FreeRTOS version that has MPU support - are you using that? Or the version from the FreeRTOS download without MPU support?


xTaskNotifyWait hangs all tasks

Posted by ringolds on December 10, 2015

We are using a "hybrid" of both since TI does not have FreeRTOS version for the specific MCU model and their RTOS versions are fairly outdated. This is the first time when we have run into such problem.


xTaskNotifyWait hangs all tasks

Posted by rtel on December 10, 2015

Its difficult to support code that is created by a third party - but in general terms, I cannot think of any reason for the symptom you are reporting - and have not heard of it before.

Task notifications are a relatively new feature, so is it possible they have not added MPU support for them?


xTaskNotifyWait hangs all tasks

Posted by ringolds on December 10, 2015

The behaviour seems really weird taking into account that it works in some places and does not work in others. Maybe you might have some rough guess what might be causing the issue or how we could try to track it down?


xTaskNotifyWait hangs all tasks

Posted by ringolds on December 11, 2015

Managed to fix this myself. Just FYI if someone runs into a similar problem: We were using older version of portASM and how portENTERCRITICAL() is used. chaging portENTERCRITICAL and portDISABLE_INTERRUPTS to map into SWIs in the new portASM file did the trick. TI seems to have updated their HALCoGen files :)


[ 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