heap_caps_add_region_with_caps() function
Add a region of memory to the collection of heaps at runtime, with custom capabilities. Similar to heap_caps_add_region(), only custom memory capabilities are specified by the caller.
Arguments
caps
Ordered array of capability masks for the new region, in order of priority. Must have length SOC_MEMORY_TYPE_NO_PRIOS. Does not need to remain valid after the call returns.
start
Start address of new region.
end
End address of new region.
Return value
- ESP_OK on success - ESP_ERR_INVALID_ARG if a parameter is invalid - ESP_ERR_NO_MEM if no memory to register new heap. - ESP_ERR_INVALID_SIZE if the memory region is too small to fit a heap - ESP_FAIL if region overlaps the start and/or end of an existing region
Notes
Please refer to following example for memory regions allowed for addition to heap based on an existing region (address range for demonstration purpose only): @verbatim Existing region: 0x1000 0x3000 New region: 0x1000 0x3000 (Allowed) New region: 0x1000 0x2000 (Allowed) New region: 0x0000 0x1000 (Allowed) New region: 0x3000 0x4000 (Allowed) New region: 0x0000 0x2000 (NOT Allowed) New region: 0x0000 0x4000 (NOT Allowed) New region: 0x1000 0x4000 (NOT Allowed) New region: 0x2000 0x4000 (NOT Allowed) @endverbatim
heap_caps_add_region_with_caps() is called by 3 functions and calls 11 functions:
![]()
heap_caps_add_region_with_caps()
heap_caps_add_region_with_caps() reads 7 variables and writes 3 variables:
![]()
heap_caps_add_region_with_caps()
heap_caps_add_region_with_caps() allocates 1 types:
![]()
heap_caps_add_region_with_caps()