V7.01 task create problem

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

V7.01 task create problem

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

V7.01 task create problem

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.

V7.01 task create problem

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

V7.01 task create problem

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.

V7.01 task create problem

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