Separating Stack and Heap
I am using an STM32H7 (though this would apply to any other STM32 with different RAM sections) and want to put the Stack in the fast DTCMRAM section, while freeing up the D1RAM for the Heap.
This did in fact work with the old toolchain of GPDSC, but not with the current CUBE-IDE Toolchain.
The symptoms are: in __libc_init_array the program hits an exception and hangs up while trying to get the new handler.
The base of the problem seems to be: In the sysmem.c -> function _sbrk the max_heap and the stack_limit are associated. This is kind of useful when both are in the same section, but does not let the program use separate sections.
Since that file is cube-mx generated, a custom implementation of the sbreak routine does not look like a good practice, since it would get overwritten on each generation.
Is there another way to achieve this separation of heap and stack?
Best Regards,
Jan