Confuse about flash XIP and encryption

vputin
Posts: 2
Joined: Tue Dec 28, 2021 8:04 pm

Confuse about flash XIP and encryption

Postby vputin » Tue Dec 28, 2021 8:23 pm

Hi all, I have few question about ESP32-C3 and ESP32-S2.

- The embedded flash 4MB (or higher) can execute code (XIP) ? As I know internal RAM and Flash are small. If we have 1.5MB of firmware, can it be located in extern flash and execute?
- There is QSPI or SPI flash connected to SPI0/SPI1, are they considered an embedded flash, beside internal flash?
- PSRAM can execute XIP?
- About flash encryption, if enabled, C3 decrypted and load into IRAM and execute, while S2 can decrypted in-place?
- Once enable flash encryption, flash still can XIP or only for read data?

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

Re: Confuse about flash XIP and encryption

Postby ESP_Sprite » Wed Dec 29, 2021 2:36 am

Embedded flash is able to do XIP. If the embedded flash is too small, we'd suggest getting a part without embedded flash and connecting a larger flash externally, as only the primary flash can be mapped into memory. PSRAM on the S2 can do XIP; the C3 does not support adding PSRAM. Flash can do XIP even if encrypted; the encrypted data will be decrypted on the fly.

vputin
Posts: 2
Joined: Tue Dec 28, 2021 8:04 pm

Re: Confuse about flash XIP and encryption

Postby vputin » Wed Dec 29, 2021 4:54 pm

Hi,

Thank you so much, it is very helpful to us.

We have to use large external flash and ram.

We have a look at ESP32-S2-DevKitM-1, which has 4MB of flash, 2MB of RAM.

With that kit, does flash can do XIP? because I see 128KB ROM so I am worry flash can not do XIP?

if that kit can't do XIP on flash, what other devices do you recommend?

Thank again!

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

Re: Confuse about flash XIP and encryption

Postby ESP_Sprite » Thu Dec 30, 2021 1:34 am

Yes, it can. Note that the ROM is actual, proper Read Only Memory, as in, what's stored in there is part of the chip design and is not changable after manufacturing of the chip. (It mostly contains the startup routines and some generally-used library functions.) Generally, all ESP modules you can buy contain a flash chip (either in the module or even inside the chip package) that is XIP capable that you would program your application into.

Who is online

Users browsing this forum: No registered users and 135 guests