ESP-IDF Custom bootloader
@everyone
Does anyone know that how to flash the program, using a custom_bootloader in esp32 using esp-idf framework?
If yes, I need a help on architecture wise.
10 Replies
Here is a guide for ESP32 IDF bootloader
https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32/api-guides/bootloader.html
To flash a program using a custom bootloader in ESP32 with ESP-IDF:
1. Build custom bootloader (
bootloader.bin
)
2. Build application (app.bin
)
3. Combine binaries (combined.bin
)
4. Flash combined.bin
to ESP32 using ESP-IDF flash
command
Architecture:
- Bootloader: Initializes ESP32, loads application
- Application: Main program, built with ESP-IDF
- Flash layout: Define offsets for bootloader and applicationI want to flash the program using IntelHex file, is it possible to generate intelhex and and do the flash?
@Joseph Ogbonna
@iamnarendrans
You can add the flag
--format hex
to your flash command to convert to IntelHex.Sounds, good
If I want to flash the program directly using the generated hex file, is it possible?
@32bitSaviour
@32bitSaviour I tried that, but not giving the output, based upon my understanding esptools.py is completly running over .bin file format. I want to confirm whether my understanding is correct or not
Have you tried --format hex command, if yes kindly give the full syntax just to check.
@iamnarendrans if you are using idf.py please look at
idf.py merge-bin
it has the option -f hex
.Yup that i already tried, but the output file format is not looking like an IntelHex format
My doubt is that, Is it possible to flash the controller using the merge-bin generated hex file, If yes, How?
I just want the overview of possiblites, and algorithm. then I can build the application easily
@32bitSaviour
Yes. esptool's
write-flash
will work for you.
Just flashing the regular way, make sure to provide the right addressThat will only support the .bin file
I'm asking about the IntelHex file.
@32bitSaviour
Yes esptool's write_flash does support hex. Just make sure it is in the right format. If you experience any issues, their docs have a write_flash troubleshooting section.