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

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Thu Oct 03, 2024 9:42 pm

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

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Fri Oct 04, 2024 7:45 am

Yes, that should be possible.

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Fri Oct 04, 2024 1:39 pm

Is there good place to start doing research, maybe some example?
Or maybe we may see example from espressif i the future?

Thanks

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Fri Oct 04, 2024 2:12 pm

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.

Who is online

Users browsing this forum: No registered users and 77 guests