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] [May 2009 Threads] vTaskDelay problem - C8051F120 SilabsPosted by Javier Burgoa on May 23, 2009 Dear members.
I'd like to post a problem concerning the vTaskDelay primitive. So you can give me any idea about how to proceed.
I'm using FreeRTOS in a Silicon Labs C8051F120 development board and the SDCC compiler (as indicated in the demo).
I've slightly modified the demo code, to simplify the tasks. The code consists on - hardware start-up: prvSetupHardware() and prvSetupSystemClock() - just one single task that toggles a bit and suspends its execution for some ticks - the main function: It performs hwd start-up and scheduler init.
I compile the code without any problem. I download it into the hardware, but when I start running the code, it always keeps blocked in the vTaskDelay function. I tried to change task stack size and xDelay time, but it is always blocked in that point until I reset the hardware.
Does anybody have any idea to solve this problem?
Below I show the code of the application.
Task looks like this: ---------------------------------------------- static void LoopTask(void *pvParameters){ const portTickType xDelay = 125 / portTICK_RATE_MS; ( void ) pvParameters;
for(;;) { vTaskDelay(xDelay); prvToggleOnBoardLED(); } } ---------------------------------------------
This task is initialized in main function in this way:
void main(void){ prvSetupHardware(); xTaskCreate( LoopTask, "TAREA", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, ( xTaskHandle * ) NULL ); vTaskStartScheduler(); }
Many Thanks for your help!!
RE: vTaskDelay problem - C8051F120 SilabsPosted by MEdwards on May 23, 2009 Check that the tick interrupt is working. If the tick is not executing then tasks that call vTaskDelay() will never unblock.
RE: vTaskDelay problem - C8051F120 SilabsPosted by Javier Burgoa on May 25, 2009 Thanks edward3 for your answer. Then to check that the tick interrupt is working, How should I proceed?
In a non FreeRTOS application I have to activate corresponding interrupt enable: IE, TI0, ... but in FreeRTOS, is there any primitive to do that? I mean, it can be a bit confusing to mix high level instructions like vTaskDelay and low level like IE=1.
In case the user is in charge of enable and activate these interruptions, where is the more convenient place, Just before calling the scheduler start-up?
Many thanks for your help.
Javier Burgoa
RE: vTaskDelay problem - C8051F120 SilabsPosted by BradK on June 4, 2009 I have the same problem. Here is the sequence:
Main() runs and calls vTaskStartScheduler() From there all goes well and control is passed to the first task: vErrorChecks() which starts to execute. At this point interrupts are enabled but the clock hasn't reached the first tick. Execution proceeds to calling: vTaskDelay() which executes down to the bottom force reschedule loop which calls: taskYIELD() At this point interrupts are disabled and control is never returned to original task and the timer ISR is not run since interrupts are disabled.
Any help would be appreciated.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|