[Answered]: flash memory mapping to specific address space
Posted: Sat Feb 24, 2018 7:04 pm
I'm looking into how to dynamically load a binary into an already running ESP32 environment. One thought I had was to compile my binary so that it "thinks" its run-time address is 0x4800 0000. I would then place this binary within flash (perhaps in a partition). I would then use memory mapping to map the instruction data on flash into the ESP32 address space starting at 0x4800 0000.
I then started studying spi_flash_mmap which I felt was heading in the right direction. However, as I read this API, I get the feeling that I can't declare where in the address space of the ESP32 the mapping should target. It seems that I am returned a pointer to where the ESP32 has decided to map my flash data to ... I am not seeing an option to declare where in the address space I want the flash data to be mapped.
Am I wrong in either (or both) of my thinking on using mmap or in my thinking of the end goal of mapping executable code into address space?
I then started studying spi_flash_mmap which I felt was heading in the right direction. However, as I read this API, I get the feeling that I can't declare where in the address space of the ESP32 the mapping should target. It seems that I am returned a pointer to where the ESP32 has decided to map my flash data to ... I am not seeing an option to declare where in the address space I want the flash data to be mapped.
Am I wrong in either (or both) of my thinking on using mmap or in my thinking of the end goal of mapping executable code into address space?