fjpanag commented on issue #2002: URL: https://github.com/apache/incubator-nuttx/issues/2002#issuecomment-716500902
Your proposition suggests modification to the `arch` files of (in my case) STM32. I don't want to have per-project forks of NuttX just for defining the memory map. That is why I am looking for a proper solution, allowing project-level configuration of the memory map. Checking in `stm32_allocateheap.c`: ```c /****************************************************************************** * Name: up_allocate_heap ... * * The following memory map is assumed for the flat build: * * .data region. Size determined at link time. * .bss region Size determined at link time. * IDLE thread stack. Size determined by CONFIG_IDLETHREAD_STACKSIZE. * Heap. Extends to the end of SRAM. * ... * ******************************************************************************/ ``` It assumes that the heap will always follow DATA -> BSS -> IDLE stack -> Heap. In this function the heap definition is explicitly coupled to the IDLE stack: ``` /* Return the heap settings */ board_autoled_on(LED_HEAPALLOCATE); *heap_start = (FAR void *)g_idle_topstack; *heap_size = SRAM1_END - g_idle_topstack; ``` Furthermore, in the same file, the function `void arm_addregion(void)`, clearly uses a bunch of hard-coded values. Also note that `arm_addregion` is only compiled for `CONFIG_MM_REGIONS > 1`. In my case there is only one heap. ---------------------------------------------------------------- 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