Quality RTOS & Embedded Software

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


Loading

Freertos stuck in vTaskDelay

Posted by smallbook on December 9, 2015

hello i'am using FreeRtos API with stm32f4 microcontroller , the program gets stuck when it enters vTaskDelay , when I debug it I see that it is stuck in this line (2588 of tasks.c at function vTaskDelay)

        if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > (UBaseType_t ) 1 )
    {
        taskYIELD();
    }

    thaks a lot for your answers

Freertos stuck in vTaskDelay

Posted by heinbali01 on December 9, 2015

Hi

When I go to line 2588 in tasks.c I see totally different code.

Would it be possible for you to download the latest official version from freertos.org (V8.2.3) and try that first?

If your code is still simple, you might want to post some code here?


Freertos stuck in vTaskDelay

Posted by smallbook on December 9, 2015

hi , i'm using freeRtos v8.1.2 here is a sample of what i'am triying to do , the code get stuck when it enters the vTaskDelay ~~~~ int main() { rccclkconfig(); // co,figures system clk to run on 100 Mhz

gpio_config(); // enable the portD clk

SystemCoreClockUpdate(); // updates the system core clk

xTaskCreate( vTask1, "Task1", 150, NULL, 1, NULL );

vTaskStartScheduler();

}

// bliking port D void vTask1(void *pv1) { while(1) { GPIOD->BSRRL=GPIOPin12|GPIOPin13|GPIOPin14|GPIOPin15;/// BSRRL = set vTaskDelay((TickTypet)200); GPIOD->BSRRH=GPIOPin12|GPIOPin13|GPIOPin14|GPIOPin15;// BSRRH = reset vTaskDelay((TickTypet)200);

}

} ~~~~ i have tested that the code before vTaskStartScheduler() runs correctly Thank you verry much for your reply


Freertos stuck in vTaskDelay

Posted by rtel on December 9, 2015

Are you sure the tick interrupt is executing? If you put a break point in xTaskIncrementTick in FreeRTOS/Source/tasks.c does it ever get hit.

Do you have configASSERT defined? http://www.freertos.org/a00110.html#configASSERT


Freertos stuck in vTaskDelay

Posted by smallbook on December 9, 2015

The code of "xTaskIncrementTick "is not reached during the debug session I don't have a "configASSERT " according to the link you specified , some functions should be defined inside a new file called "applicationdefinedprivileged_functions.h ", can you please specifie for me what are these functions and how to do this

Thanks a lot


Freertos stuck in vTaskDelay

Posted by rtel on December 10, 2015

The code of "xTaskIncrementTick "is not reached during the debug session

That will be why the delay function doesn't return. It doesn't sound like your tick interrupt is executing, and if the tick interrupt is not executing then time stands still - hence the delay never expires.

I don't have a "configASSERT "

It is always recommended to have configASSERT() defined when developing. It can find an error in seconds that could otherwise take weeks - I can't put it any more clearly than that. It is also best to have the latest version of FreeRTOS as we add more configASSERT() statements to assist people.

according to the link you specified , some functions should be defined inside a new file called "applicationdefinedprivileged_functions.h ", can you please specifie for me what are these functions and how to do this

Not sure what you mean here - I thought I had sent a link to the configASSERT() description on the configuration web page, nothing about privileged functions.


Freertos stuck in vTaskDelay

Posted by smallbook on December 10, 2015

yes i can see it is defined in freeRTOSconfig.h as follows :

~~~~

define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }

~~~~

how should i use it to know the reason why tick interrupt is not executing .

Thanks a lot for your replies .


Freertos stuck in vTaskDelay

Posted by rtel on December 10, 2015

Have you installed the FreeRTOS interrupt handlers? See point (1) on the following page: http://www.freertos.org/FAQHelp.html

If you are using STM32 cube then it may have its own systick handler, but that should be calling the FreeRTOS one. Did you create the project yourself, or did the cube software create it for you?


Freertos stuck in vTaskDelay

Posted by smallbook on December 10, 2015

hi this was so much helpfull in fact i've been working with the FreeRTOSConfig.h generated with stmcube and the following was commented , I decommented it now everything is working fine thankyou ~~~~ /* IMPORTANT: This define MUST be commented when used with STM32Cube firmware, to prevent overwriting SysTickHandler defined within STM32Cube HAL / / #define xPortSysTickHandler SysTickHandler*/ ~~~~


[ 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