Hi, I use the FREERTOS by first time with STM32F429
I used the osthreadDef to run many function, but it always break loop.
I looked some forum, it is the memory problem
256KB SRAM with STM32F429
How can I set my FREERTOS?
The task creation code looks okay. Does the task start and then the loop breaks or does the scheduler never start? Would you please step into the osKernelStart and see if the scheduler starts successfully?
I’m afraid that is not one of our functions so I don’t know how it is implemented. From your code it looks like it is populating a structure that is passed to osThreadCreate() - is the 1024 the stack size? If so, is it specified in bytes or words? Either way it looks quite large unless you are allocating a lot on the task’s stack.
Grateful if you could be more specific. Are you running out of heap memory? If so, how do you know? What value does xTaskCreate() return (xTaskCreate() is the FreeRTOS API function that will get called in osThreadCreate())? Do you have a malloc failed hook defined?
I’m not sure if you are talking about heap though. You might be talking about stack.
If you are running out of heap then this looks like you are allocating quite a lot as this is 30720 words, not bytes, so 30720*4 bytes on an STM32.
It is start successfully, but do it in other function, it will break loop.
I try to change the “configTOTAL_HEAP_SIZE”, but it is also break at same place
I am still unable to understand the problem but it seems like the call to the function main_GW(); is problematic. What is the definition of that function?
Please do the following:
Comment out everything from the task loop to verify that it is running successfully.
Enable checks as I mentioned in my first response: