esp_himem_map() function
Map a block of high memory into the CPUs address space This effectively makes the block available for read/write operations.
Arguments
handle
Handle to the block of memory, as given by esp_himem_alloc
range
Range handle to map the memory in
ram_offset
Offset into the block of physical memory of the block to map
range_offset
Offset into the address range where the block will be mapped
len
Length of region to map
flags
One of ESP_HIMEM_MAPFLAG_*
out_ptr
Pointer to variable to store resulting memory pointer in
Return value
- ESP_OK if the memory could be mapped - ESP_ERR_INVALID_ARG if offset, range or len aren't MMU-block-aligned (32K) - ESP_ERR_INVALID_SIZE if the offsets/lengths don't fit in the allocated memory or range - ESP_ERR_INVALID_STATE if a block in the selected ram offset/length is already mapped, or if a block in the selected range offset/length already has a mapping.
Notes
The region to be mapped needs to have offsets and sizes that are aligned to the SPI RAM MMU block size (32K)
esp_himem_map() calls 7 functions:
![]()
esp_himem_map()
esp_himem_map() reads 13 variables and writes 3 variables:
![]()
esp_himem_map()