# VTaskDelay Frozen

**URL:** <https://forums.freertos.org/t/vtaskdelay-frozen/5435>\
**Category:** Kernel\
**Created:** [June 3, 2008, 4:35pm UTC](https://forums.freertos.org/t/vtaskdelay-frozen/5435 "2008-06-03T16:35:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 3, 2008, 4:35pm UTC](https://forums.freertos.org/t/vtaskdelay-frozen/5435/1 "2008-06-03T16:35:28Z")

</div>

**[reny09](https://sourceforge.net/u/reny09/)** wrote on [Tuesday, June 03, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/f087d0a7/#b4d3):

Hi  
&nbsp; I´m using FreeRtos 5.0.0 and I have two tasks in a MSP430 with IAR. One blocked for ever because it temporaly empty and in another if I try the following

&nbsp; const portTickType xDelay = 5;

&nbsp;&nbsp;&nbsp; for (;😉  
&nbsp;&nbsp;&nbsp; {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LedToggle();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vTaskDelay( xDelay );  
&nbsp;&nbsp;&nbsp; }

The led only Blink if I use #define configUSE\_PREEMPTION 0, if it is set it doesn´t work. If I use VTaskDelayUntil it doesn´t work with both configurations. The microcontroller is working perfectly because I´m sending and receiving data through a radio using interrupts.

What I could be doing wrong? The full configuration is this one.

#define configUSE\_PREEMPTION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0  
#define configUSE\_IDLE\_HOOK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0  
#define configUSE\_TICK\_HOOK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0  
#define configCPU\_CLOCK\_HZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ( unsigned portLONG ) 7372800 ) /\* Clock setup from main.c in the demo application. \*/  
#define configTICK\_RATE\_HZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ( portTickType ) 256 )  
#define configMAX\_PRIORITIES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ( unsigned portBASE\_TYPE ) 5 )  
#define configMINIMAL\_STACK\_SIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ( unsigned portSHORT ) 100 )  
#define configTOTAL\_HEAP\_SIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( ( size\_t ) ( 4000 ) )  
#define configMAX\_TASK\_NAME\_LEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( 8 )  
#define configUSE\_TRACE\_FACILITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0  
#define configUSE\_16\_BIT\_TICKS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1  
#define configIDLE\_SHOULD\_YIELD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1  
#define configUSE\_MUTEXES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 3, 2008, 4:46pm UTC](https://forums.freertos.org/t/vtaskdelay-frozen/5435/2 "2008-06-03T16:46:04Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, June 03, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/f087d0a7/#b4d3/b928):

Can you check that the tick interrupt is working, if you put a break point in the tick interrupt does it get hit repeatedly and does it increase uxTickCount?

Also a delay of 5 is very low, could it be that the LED it toggling too quickly to see?

Are any other tasks or interrupts accessing the same port that the LED is connected to?

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 3, 2008, 5:10pm UTC](https://forums.freertos.org/t/vtaskdelay-frozen/5435/3 "2008-06-03T17:10:14Z")

</div>

**[reny09](https://sourceforge.net/u/reny09/)** wrote on [Tuesday, June 03, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/f087d0a7/#b4d3/3c86):

Thanks Richard for your support. The problem was in the the tick interrupt, the FreeRTOSConfig.h was not properly included so the call to&nbsp;&nbsp;&nbsp; #vTaskSwitchContext was never executed.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Regards.
