Page 1 of 1

ESP32 - Content of internal ROM

Posted: Thu May 03, 2018 4:24 am
by wwwenrico
Hi,

what does the internal ROM of the ESP32 chip actually contain?

A ROM size of 448 kBytes is really huge.

Usually, XiP (eXecution in Place) flashless microcontrollers have much smaller internal ROM sizes.

Thanks,
Enrico Migliore

Re: ESP32 - Content of internal ROM

Posted: Thu May 03, 2018 7:04 am
by ESP_Sprite
Mostly the lower-layer parts of the BT stack (size-wise these occupy most of the ROM, iirc), parts of Newlib, some control code for the WiFi PHY layer, the bootloader to start code from external ROM and some bits of code to form a rudimentary scheduler. One of the reasons all this is in ROM is so in theory the ESP32 can work without an external SPI flash chip, by getting a RAM-only image uploaded over another port (serial, SDIO). As far as I am aware, this hasn't been used publically yet, however. Some other general-purpose routines (newlib, libtjpegd, miniz) are also included as running these from ROM doesn't take up any RAM and runs quicker than loading them from flash.

Re: ESP32 - Content of internal ROM

Posted: Thu May 03, 2018 1:25 pm
by wwwenrico
Thank you for the explanation.

Re: ESP32 - Content of internal ROM

Posted: Thu May 03, 2018 3:12 pm
by michprev
It would be nice to have a list of all functions implemented in ROM with description how can be used. I know that they are listed in .ld files and some of them in header files.

Some of them are also reimplemented in ESP-IDF as they do not work due to SPIRAM / DPORT / any other bug.

Re: ESP32 - Content of internal ROM

Posted: Fri May 04, 2018 3:45 am
by ESP_Angus
Almost everything which is directly usable from an ESP-IDF app has a declaration in here:
https://github.com/espressif/esp-idf/tr ... nclude/rom

(Apart from the newlib libc, whose headers are in the newlib component.)

Although, a lot of what's declared there is not particularly usable from an ESP-IDF app either - a lot of the ROM functions don't have any way to coordinate access to hardware, so they'll clobber hardware configuration which is done by the app. They're mostly intended to be used from the bootloader or from much simpler RAM-only test or other programs running on the ESP32.

(Usually these functions have a note in the header discouraging their use in ESP-IDF apps.)