Quality RTOS & Embedded Software

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


Task not executed ?!

Posted by Nobody/Anonymous on February 14, 2007
Hello everybody !

I'm new in the world of FreeRTOS and I tried it on an Freescale HC12 card with the Help of CodeWarrior.
I created 2 tasks : one is turning on the Leds and the other do alternate them (on/off) like this :

xTaskHandle xh1, xh2 ;

xTaskCreate( off, "of", 512, NULL, 10, &xh1 );
xTaskCreate( onoff, "onoff", 512, NULL, 6, &xh2 );

When I launch the scheduler with vTaskStartScheduler(); only the second task is launched and the first one never !

Here's the code of this 2 functions :

void on(void) {

DDRB = 0xFF; //turn on the Leds


void onoff(void) {

int i ;

for (i=0;i<=40;i++)

PORTB ^= 0xFF; //alternate the Leds



Have you any idea why the first task isn't called ?

Thanks a lot for helping me :)

RE: Task not executed ?!

Posted by Nobody/Anonymous on February 14, 2007
The on() task is not structured as a task. It must be in an infinite loop or call vTaskDelete() prior to its end.

Your tasks will also need to block at some point, otherwise only one will run unless they are both at the same priority.

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

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

Xilinx Microblaze and Zynq partner