FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2008 Threads] vTaskDelay doesn´t delay a regular timePosted by Fernando Gatto on March 7, 2008 Hi Everybody: I have a trouble vTaskDelay that I can´t understand. Surely It´s easy but I can´t find it.
If I execute the following code in a Task of the second highest priority, it doesn´t block 20 ticks everytime. Sometimes remains blocked until the following post on the queue and sometimes it last 20 ticks. I checked that the upper task, wich post on this queue, doesn´t stay freezing the system.
for(;;) { if( xQueuePeek( xQueue_Tx_Rf_local, bBuffer , portMAX_DELAY) ) { vTaskDelay(20); . . } }
I have another task with a lower priority that executes vTaskDelay correctly. If I use a for{} delay instead of vTaskDelay() everything works ok. What could be the cause that block vtaskDelay a different time of 20 ticks
I am using a MSP430 port.
Thanks Reny09
RE: vTaskDelay doesn´t delay a regular timePosted by Dave on March 7, 2008 > for(;;) > { > if( xQueuePeek( xQueue_Tx_Rf_local, bBuffer , portMAX_DELAY) ) > { > vTaskDelay(20); > . > . > } > }
What comes after the vTaskDelay(20)? Are you guaranteed to know if it goes around the loop again.
The first thing to check is stack issues. This is the most usual cause of problems. You could try the new uxTaskGetStackHighWatermark() function, or you could simply try allocating more stack to this task.
RE: vTaskDelay doesn´t delay a regular timePosted by Fernando Gatto on March 9, 2008 Thanks davedoors for your suggestion. I have checked the stack, and there is enough room. So I´dont know what I could be doing wrong.
After the delay I check a pin and then I enter in a Critical Section writing on a SPI bus. I don´t know if going through a critical section could affect. When I´ve checked the work of delay I toggled a Led before and after of vTaskDelay() and watching it with the oscillocope is when I saw that makes the erratic work.
Bye Reny09
RE: vTaskDelay doesn´t delay a regular timePosted by woops_ on March 9, 2008 I presume you are not waiting in the critical section for the SPI transfer to complete?
RE: vTaskDelay doesn´t delay a regular timePosted by Fernando Gatto on March 11, 2008 Hi woops_. I will check your suggestion. Also I will test disabling other tasks in order to test which one is blocking vTaskDelay. Now I am using a for based delay and everything works fine.
Bye
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|