“Stack_Size from 0x00000400 to 0x00000200 and the Heap_Size from 0x00000200 to 0x00000000”
You don't have to do that to get FreeRTOS to run, but you might have to do that to get your application to link if it is trying to use more RAM that the STM32 actually has.
Setting the heap to 0 is a good idea if you are using heap_1.c or heap_2.c, and the linker's allocated heap is not used. You must not set it to 0 if you are using heap_3.c though because heap_3 does
use the linker's allocated heap.
Setting the stack size down just reduces the amount of RAM the linker is trying to allocate. On the STM32 that stack is used by main(), and then re-used by interrupts. 0x200 could be too small. The interrupt stack is not checked for overflow like the tasks stacks are. If you are using heap_1.c or heap_2.c then you can reduce configTOTAL_HEAP_SIZE a little to reduce the RAM that that consumes, to free up some room to allow you to increase the stack size a bit.
Thanks for your answer! Now it becomes a little clearer.
As explained above I cannot use the heap_3.c file because it always hangs at the vApplicationMallocFailedHook() function. Thats because malloc() returns always NULL. I tried it with the Stack_Size of 0x00000400 and Heap_Size of 0x00000200 (default Setting of ST Microelectronics) . Is there any suggestion whats the problem here? Respectively is there any document which explains the Stack and Heap Management of FreeRTOS in detail?
Thank you, regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.