AnsweredAssumed Answered

How to put stack and heap in different memroy sections

Question asked by greenwood.greg on Apr 30, 2018
Latest reply on May 1, 2018 by greenwood.greg

I have heard the benefit of putting the stack at the beginning of DTCMRAM + the minimum size required as then stack accesses exceeding the size of the stack will throw the execution to the exception fault.  However the default directive in the linker for stack location includes the heap (._user_heap_stack), or so I presume.  I do not what the heap in the DTCMRAM due to the possibility of the heap being used for a variable that may end up needing to be accessed by DMA.  So the question; how to separate them.  I gather from reading other linker script posts that I could create two sections; 1) ._user_stack and 2) ._user_heap, but the question is then how to make the rest of the project aware and use the assignments as intended?  Anyone done this before for which you might be able to share an example?