Quality RTOS & Embedded Software

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



Posted by Robert Brock on May 5, 2009
Two steps forward, one step back.

I'm trying to use vTaskDelay with the ATMega323_WinAVR, but it seems to never return from the delay. I thought I had learned my lesson from mutex semaphores, so I checked FreeRTOSConfig.h and made sure INCLUDE_vTaskDelay was defined. Are there any other items I should look at?


RE: vTaskDelay

Posted by Richard Damon on May 5, 2009
First make sure your tick interrupt is working. If it isn't then delay doesn't have a chance to work.

RE: vTaskDelay

Posted by Richard on May 5, 2009
...to add to what richard_damon said (which is the first thing to check)...

the standard demo tasks which run on the ATMega323 use vTaskDelay() and vTaskDelayUntil() all over the place and these work fine. The easiest way to start your own project is to start with the standard demo which is already working, then modify that to remove the demo tasks and add in your tasks.

RE: vTaskDelay

Posted by Robert Brock on May 7, 2009
Thanks for the feedback. I am determined to get a handle on this RTOS. I understand the idea of using the demo, but whenever I make what seem like small changes to it, I don't get the results I'm expecting. For example, in the ATMega323 demo, I simply added a DDRA= 0xFF and PORTA = 0xFF to turn on all of the LEDs on my development board, but got nothing. I assume the demo has defined the port for another purpose, I just didn't stumble on it. It uses PORTB to control some LEDs, but on my board they are tied to PORTA.

It also seems to me that it shouldn't be that hard to build up an app from scratch, but I am sure struggling a bit. I just want to see a few tasks running with a message queue and a couple of semaphores. I didn't even see a semaphore in the ATMega323 example.

Related to Richard's response, is the tick interrupt tied to a timer? Can you point me to the right section in the documentation?


RE: vTaskDelay

Posted by Dave on May 7, 2009
I would recommend buying the book to learn the basics of the system.

RE: vTaskDelay

Posted by Robert Brock on May 7, 2009
Bummer ... I've asked too many stupid questions.

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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