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