pull/407/merge
Jeroen Domburg 2017-03-09 19:59:09 +08:00
rodzic ab5bbfa74b
commit 17a4a2527d
2 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -206,15 +206,15 @@ void heap_alloc_caps_init() {
after the scheduler has started, the ROM stack is not used anymore by anything. We handle it instead by not allowing
any mallocs from tag 1 (the IRAM/DRAM region) until the scheduler has started.
The 0x3ffe0000 region also contains static RAM for various ROM functions. The following lines knocks
out the regions for UART and ETSC, so these functions are usable. Libraries like xtos, which are
The 0x3ffe0000 region also contains static RAM for various ROM functions. The following lines
reserve the regions for UART and ETSC, so these functions are usable. Libraries like xtos, which are
not usable in FreeRTOS anyway, are commented out in the linker script so they cannot be used; we
do not disable their memory regions here and they will be used as general purpose heap memory.
Enabling the heap allocator for this region but disabling allocation here until FreeRTOS is started up
is a somewhat risky action in theory, because on initializing the allocator, it will go and write linked
list entries at the start and end of all regions. For the ESP32, these linked list entries happen to end
up in a region that is not touched by the stack; they can be placed safely there.*/
is a somewhat risky action in theory, because on initializing the allocator, vPortDefineHeapRegionsTagged
will go and write linked list entries at the start and end of all regions. For the ESP32, these linked
list entries happen to end up in a region that is not touched by the stack; they can be placed safely there.*/
disable_mem_region((void*)0x3ffe0000, (void*)0x3ffe0440); //Reserve ROM PRO data region
disable_mem_region((void*)0x3ffe4000, (void*)0x3ffe4350); //Reserve ROM APP data region

Wyświetl plik

@ -41,9 +41,10 @@ void heap_alloc_caps_init();
/**
* @brief Enable the memory region where the startup stacks are located for allocation
*
* On startup, the pro/app CPUs have a certain stack frame, so we cannot do allocations
* in the regions these stack frames are. When FreeRTOS is completely started, they do
* not use that memory anymore and allocation there can be re-enabled.
* On startup, the pro/app CPUs have a certain memory region they use as stack, so we
* cannot do allocations in the regions these stack frames are. When FreeRTOS is
* completely started, they do not use that memory anymore and allocation there can
* be re-enabled.
*/
void heap_alloc_enable_nonos_stack_tag();