Quality RTOS & Embedded Software

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


problem when using a task

Posted by karimaaissaoui on April 12, 2016

Hello everyone, CodeWarrior provides the ability to run code either directrly into the target or using a simulation mode. In the normal case, when we use a task, the infinite loop used at the end of the main function should not to be executed once the "vTaskStartSchedular()" is called, the task should start and should remain always in the infinite loop function called by the task, but when we execute step by step, we never get to this function, the code gets stuck in the endless loop of main code and does not come out. When we execute the code ported in the microcontroller step by step, to identify where the program crashes.

Here are the results we found: To create the task, memory allocation variables for the stack and TCB (task control block), always take Null, so the memory allocation is not performed, and thereafter the program remains in the infinite loop of the main. In the simulation mode, the allocation of memory blocks are done, and we get to enter the function used by the task, and remains in there. Normally we should have the same results, since the simulation mode create a similar working environment, as the environment of the card. Please find below the code that was used.

~~~~ void MyTask1(void* pvParameters);

void main(void) {

DDRP = 0x0F;


xTaskCreate( MyTask1, ( signed char * ) "MyTask1", configMINIMALSTACKSIZE, NULL, 1, NULL );




void MyTask1(void* pvParameters) { while(1) { PTP=0x00; vTaskDelay(2000);




We would like to have your opinion about this problem. We thank you.

Best Regards.

FreeRTOSV9 microcontroller : HCS12P64 codeWarrior V5.9.0

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists