ESP32 Bootloader

maurizio.scian
Posts: 12
Joined: Mon Jun 26, 2023 8:09 am

ESP32 Bootloader

Postby maurizio.scian » Sun Oct 01, 2023 11:33 am

I’m trying to override 2nd stage bootlaoder. For that, i simply create a new IDF project, and load the sample “custom_bootloader”-“bootloader_override”.
Now, i correctly build the project and download it. As said here the 2nd stage bootloader should be resides at offset 0x1000 in flash, but flash_args file says:

–flash_mode dio –flash_freq 80m –flash_size 2MB
0x0 bootloader/bootloader.bin
0x10000 IAMBOOT.bin
0x8000 partition_table/partition-table.bin

This means that in location 0x0 (don’t should be 0x1000?) he’s install default bootloader, and IAMBOOT.bin (IAMBOOT is the name of the bootloader project) resides at location 0x10000, that is the location of the factory app, in according with the partition table.
Actually in the app_main there is only a printf, and in debug it outputs the string on the console as expected. Routine “app_main” is called from the scheduler initialized in “start_cpu0_default” function.
I tried to manually flash IAMBOOT.bin at address 0x1000 with the flash download tool but don’t work. I tried also to flash it at address 0x0, but the result is the same.
Also, app_main function has address 0x420074c0, so it doesn’t resides in the 2nd stage bootloader area (that should be, for default, from 0x1000 and 0x8000 or where partition table is allocated).
How can i define that the project must override default 2nd stage bootloader?

(I work with release/v5.0, the microcontroller is ESP32S3 WROOM 1)

ESP_Mahavir
Posts: 190
Joined: Wed Jan 24, 2018 6:51 am

Re: ESP32 Bootloader

Postby ESP_Mahavir » Mon Oct 09, 2023 4:10 am

- Bootloader offset for ESP32-S3 is 0. This is documented in the bootloader guide here: https://docs.espressif.com/projects/esp ... oader.html

- For customer bootloader implementation, please refer to this guide: https://docs.espressif.com/projects/esp ... bootloader

Who is online

Users browsing this forum: No registered users and 104 guests