freertos xPortStartScheduler – vPortStartFirstTask

Hi, I have donwloaded Freertos V10.0.1. I build and ran CORTEXR4RM48TMS570CCS5 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,

freertos xPortStartScheduler – vPortStartFirstTask

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.

freertos xPortStartScheduler – vPortStartFirstTask

To add to Richard D’s reply – the StackTypet 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#configSUPPORTSTATIC_ALLOCATION