fjpanag opened a new issue #2002:
URL: https://github.com/apache/incubator-nuttx/issues/2002


   On STM32, heap base is defined as:  
   `#define HEAP_BASE      ((uintptr_t)&_ebss + IDLE_STACKSIZE)`  
   
   This makes the assumption that the heap will always be after BSS & Idle 
Stack, which is not always possible.  
   On systems with multiple RAM regions, that are not contiguous, this is not 
going to work.
   
   For example, I am using an STM32F427, that has:
   - 64k @ 0x10000000
   - 192k @ 0x20000000
   
   This forces me to place everything in the 192k SRAM region (and thus lose 
the CCM), or place everything in CCM (64k), and not be able to take advantage 
of the full 192k RAM of the system.
   
   Even worse, if I place BSS in 64k and select `CONFIG_STM32_CCMEXCLUDE`, 
**the heap will still be located within CCM**, and will extend till the end of 
the 192k RAM (of course with a "hole" in between).
   
   I believe that we need a different way of defining the Heap.  
   Examples/ideas:
   - FreeRTOS heap_5 [uses a 
table](https://www.freertos.org/FreeRTOS_Support_Forum_Archive/July_2017/freertos_Using_heap_5.c_d1dfe891j.html).
 
   - Linker script regions or symbols may be defined for the heap.
   - We may set HEAP_BASE (and size) in Kconfig.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to