Flashing an ESP32 with another ESP32

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

Flashing an ESP32 with another ESP32

Postby gunar.kroeger » Wed Sep 25, 2019 4:19 pm

We have 2 esp32 connected through UART. Let's call them esp32A and esp32B.

esp32A has a SD card connected with the firmware.bin for esp32B.
esp32A also has connection to the reset and boot pins of esp32B. How can I port the protocol implemented by esptool.py to flash firmware.bin into esp32b? the simplest way is OK, so compression and encryption are not needed right now.

I'm using esp-idf-v3.3.
Has anyone done this before?

Thanks
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Flashing an ESP32 with another ESP32

Postby PeterR » Wed Sep 25, 2019 6:49 pm

Hi,
Yes, we have done this. I am waiting for commercial to agree open sourcing.

Alternatively ESP_igrr suggested:
On the ESP32 side, you can use UART driver and esp_ota APIs. See system/ota/native_ota_example example. This example downloads the firmware from a remote server, but same APIs can be just as well used to implement OTA over UART or over SPI.
Which would seem a better route. Just remember to protect your bootloader from update.
& I also believe that IDF CAN should be fixed.

User avatar
gunar.kroeger
Posts: 143
Joined: Fri Jul 27, 2018 6:48 pm

Re: Flashing an ESP32 with another ESP32

Postby gunar.kroeger » Wed Sep 25, 2019 9:26 pm

Hi @PeterR,

If you could send your source it would help a lot!

We are already working on a solution based on the OTA example, but being able to flash the espB without it having any firmware on it would be more flexible and would speed up production as well.

Please let me know if you can send me the source you mentioned.
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Flashing an ESP32 with another ESP32

Postby PeterR » Fri Sep 27, 2019 11:21 am

Ok, will do, it may be a long burn - you know commerical.
Yes, I took the same view initially however if you use Ethernet you need to be careful with the clock circuit.

You can also get chips pre-programmed if that helps.
& I also believe that IDF CAN should be fixed.

NathanJPhillips
Posts: 8
Joined: Thu Jan 23, 2020 3:53 pm

Re: Flashing an ESP32 with another ESP32

Postby NathanJPhillips » Thu Jan 23, 2020 3:56 pm

Hi @PeterR, do make sure you post here if you ever get permission for this. Also, could you explain your comment about the clock circuit?

cheers, Nathan

NathanJPhillips
Posts: 8
Joined: Thu Jan 23, 2020 3:53 pm

Re: Flashing an ESP32 with another ESP32

Postby NathanJPhillips » Tue May 25, 2021 3:19 pm

This seems a long time ago now, but just stumbled on my old post - for anyone else who needs the same I reimplemented this in the end based on https://github.com/espressif/esp-serial-flasher.

dmitry-rdflex
Posts: 1
Joined: Thu Jun 09, 2022 4:24 pm

Re: Flashing an ESP32 with another ESP32

Postby dmitry-rdflex » Thu Jun 09, 2022 4:30 pm

NathanJPhillips wrote:
Tue May 25, 2021 3:19 pm
This seems a long time ago now, but just stumbled on my old post - for anyone else who needs the same I reimplemented this in the end based on https://github.com/espressif/esp-serial-flasher.
Thank you!

Who is online

Users browsing this forum: Google [Bot], MicroController and 127 guests