freertos xPortStartScheduler - vPortStartFirstTask

csen wrote on Friday, April 13, 2018:

Hi,

I have donwloaded Freertos V10.0.1.
I build and ran CORTEX_R4_RM48_TMS570_CCS5 demo project on my target development kit which is TMDS570LS31USB. the demo project works fine.
Later I modified this project to enable static allocation, like xTaskCreateStatic, xQueueCreateStatic. I also added function definitions for vApplicationGetIdleTaskMemory and vApplicationGetTimerTaskMemory.
the project builds and runs. It crashes at vPortStartFirstTask. It looks like data abort.
It is pretty clear that some misstep or lack of knowledge about static allocation is causing this since the project runs well in within dynamic allocation.

Any help would be great.

thanks,

richard_damon wrote on Friday, April 13, 2018:

First thing I would look at is make sure you are providing the right type/size of data for task creation. One big thing to note is that the stack size is given in words, not bytes, so make sure you allocated enough space for it, and it is properly aligned.

rtel wrote on Friday, April 13, 2018:

To add to Richard D’s reply - the StackType_t type is used to ensure
alignment. Make sure the memory you allocate for the idle and timer
tasks is adequate. Examples of how that is done can be found here:
https://www.freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION