Page 1 of 1

[esp32-p4] is this possible to do with it?

Posted: Thu Oct 03, 2024 9:42 pm
by chegewara
Hi community,
Some idea came to my mind.
On esp32-p4 we have plenty of spiram, we also know it is possible on esp-idf to run binary from RAM, without actually flashing it.
Is it possible actually possible to load firmware from sd card into psram and run it from there? Maybe mmap-ing or other mechanism,
Im not asking if its possible with current API, just if its possible at all.


Thanks

Re: [esp32-p4] is this possible to do with it?

Posted: Fri Oct 04, 2024 7:45 am
by ESP_Sprite
Yes, that should be possible.

Re: [esp32-p4] is this possible to do with it?

Posted: Fri Oct 04, 2024 1:39 pm
by chegewara
Is there good place to start doing research, maybe some example?
Or maybe we may see example from espressif i the future?

Thanks

Re: [esp32-p4] is this possible to do with it?

Posted: Fri Oct 04, 2024 2:12 pm
by ESP_Sprite
Sorry, there's no obvious way to do that. There is code to copy the rodata and instructions of the currently-run application to psram and continue running from there (esp_psram component, CONFIG_SPIRAM_FETCH_INSTRUCTIONS and CONFIG_SPIRAM_RODATA) but loading another application would mean you'd need to overwrite the current internal memory as well, unless you link the app so it solely runs off psram. Another option would be to write the app to psram, then somehow jump back to the 2nd stage bootloader but somehow showing the psram in the place of flash, but I'm not sure how exactly that would work.