Chat freely about anything...

User avatar
By lilzz
#47739 1)OTA has bootloader, non-OTA doesn't has in Flash. For non-OTA , is the bootloader located at its internal ROM?

2)Why SDK libraries burned into the flash? What's advanatge of that?
I mean , normal program are compiled with SDK libraries togther. I dont see why SDK libraries need to be in ROM.


=====================================================
SPI Flash ROM Layout (without OTA upgrades)

This is for ESP IoT SDK version 0.8 and above.
Address Size Name Description
00000h 248k app.v6.flash.bin User application
3E000h 8k master_device_key.bin OTA device key. Unconfirmed: Not used without OTA
40000h 240k app.v6.irom0text.bin SDK libraries
7C000h 8k esp_init_data_default.bin Default configuration
7E000h 8k blank.bin Filled with FFh. May be WiFi configuration
==================================================================

SPI Flash ROM Layout (with OTA upgrades)

This is for ESP IoT SDK version 0.8 and above, supporting OTA upgrades.
Address Size Name Description
00000h 4k boot.bin Bootloader
01000h 64k app.v6.flash1.bin User application, slot 1
11000h 180k app.v6.irom0text1.bin SDK libraries, slot 1
3E000h 8k master_device_key.bin OTA device key
40000h 4k Unused
41000h 64k app.v6.flash1.bin User application, slot 2
51000h 180k app.v6.irom0text1.bin SDK libraries, slot 2
7E000h 8k blank.bin Filled with FFh. May be WiFi configuration.
User avatar
By cranphin
#47941 Let's see if I can answer this with what I know so far :)

1. The 'bootloader' in OTA is a little program that selects (jumps to) one of the two user programs loaded in the flash, based on configuration and a check (crc?). This is used to switch to the other program after a successful update, and to keep with the original program if the update failed halfway. Non-OTA doesn't need any of this, so it doesn't have this bootloader.

2. I'm guessing a bit more here.. :) The 'rom' is probably a bit misnamed, it's just some libraries that are provided with the SDK, and that are loaded in flash together with the program. It's possibly easier to do it that way then to compiler them in the user program? Also new OTA's seem to be just one user file, so mayby they do actually compile them in for that?
User avatar
By martinayotte
#47950 I think here there is a lot of confusion between ROM and Flash !

First, there is 2 kind of bootloaders, the one in ROM, which handles the execution startup mode and the upload mode (depending of the GPIO0), and there is an facultative application bootloader for OTA which is provided by the framework used, in the case of Arduino framework, it is also named "eboot".

Second, all SDK libraries are stored in the Flash, it could be located at different place depending of the framwork and if the Flash need to be split in 2 part in case of OTA. They will never be located in ROM, since the actual ROM is quite small and most probably not writeable (this is still unknown).
User avatar
By lilzz
#47953 @martinayotte
Are you sure SDK in flash , not in the internal ROM?? Because SDK Functions are not needed and can't replaced therefore made sure to programmmed in internal ROM.
Do you know how the SDK functions in ROM got hooked up or activated when there's user code calling them.
How are those functions got retrieved and referenced?

Secondly, 0x40000000 is 89MB physical address. ESP doesn't have that much physical memory!

====================================================================
Here's what I got.

Boot ROM (0x40000000 - 0x4000FFFF)

Read-only memory containing instruction code programmed into the chip by Espressif which (as far as is known) cannot be reprogrammed. This ROM contains both the initial boot code and first-stage boot loader, as well as a number of library routines which can be called from the application or SDK to perform basic functions.

Note: The Boot ROM is 64 KiB and can be found at 0x40000000.