Quality RTOS & Embedded Software

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


Loading

vTaskDelay problem - C8051F120 Silabs

Posted 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 Silabs

Posted 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 Silabs

Posted 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 Silabs

Posted 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.


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner