Quality RTOS & Embedded Software

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


Loading

V7.01 task create problem

Posted by skidev on July 27, 2011
New processor, new environment, and a new version of FreeRTOS...

Using an LPCXpresso LPC1769 with the Code Red LPCXpresso 4 gcc compiler and CMSISv2p00. Compiled (clean) the Example01 project modified to use the new CMSIS and FreeRTOS ports. When running, only Task 1 is created; Task 2 never sees the light of day. Pushing into vTaskCreate for Task 2, it seems neither sufficient heap or stack space can be created... odd.

Old version (older gcc, v6.01 of FreeRTOS worked fine. Any clues to what to investigate?

Thanks,

Mike

RE: V7.01 task create problem

Posted by skidev on July 27, 2011
To be more specific, it's Example01 from the FreeRTOS book, creating 2 tasks that merely advertise their presence. The only includes and libraries referenced are from the latest CMSISv2p00_LPC17xx and FreeRTOS libraries (CMSIS first in the paths) fresh from ARM and Richard.

Mike

RE: V7.01 task create problem

Posted by Richard on July 27, 2011
What does the second call to xTaskCreate() return?
Have you installed the FreeRTOS interrupt handlers?
What happens when you step into the second call to xTaskCreate(). How far does it get?

Regards.

RE: V7.01 task create problem

Posted by skidev on July 27, 2011
Hi Richard,

The second xTaskCreate() call returns -1.

Not sure about the interrupt handlers; I installed all the FreeRTOS v7.01 code for the Source and portable ARM_CM3_MPU code - the library builds fine

The second xTaskCreate runs all the way through, but neither the stack or heap create succeeded due to inability to allocate space.

Regards,

Mike

RE: V7.01 task create problem

Posted by Richard on July 27, 2011
I have to assume you have set the heap size large enough to create both tasks - if you are running the book code unmodified it will be. In which case, my guess is that the start up code is not correctly initialising the variables, so variables are starting with random values, and hence the memory allocation is failing. You will have to step through the code, where the failure to allocate memory occurs, and find the reason - i.e. is there genuinely no memory, or does a variable contain a bum value, or maybe even the flash memory has not been programmed correctly.

Regards.

RE: V7.01 task create problem

Posted by skidev on July 29, 2011
I rebuilt the Example01 by creating a FreeRTOS project with the LPCXpresso 4 tools, and tweaking the demo main.c to provide the same task function.

Inserting printfs (using Code Red consoleprint.c), the default min stack size of 80 allows 21 iterations of the scheduler loop before regurgitating an error at iteration 21. A fresh minimum of 100 seems to do the trick, has run for a day+ with no errors.

Moving on... thanks for the suggestions.

Mike


[ 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