Update Via UART

KonradZ
Posts: 4
Joined: Mon Jul 02, 2018 9:07 am

Update Via UART

Postby KonradZ » Tue Aug 28, 2018 1:34 pm

Hello,

I Have a project with MCU running RTOS and I attached the ESP32 to add network communication to the project. I want to implement the ESP32 firmware update that will be done by the MCU via UART. There is no way of running the esptool.py script so I need to implment it myself. Do you have any good reference or maybe some simple solution to add the possibility of update ?

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Update Via UART

Postby fly135 » Tue Aug 28, 2018 4:40 pm

The OTA example provides enough info to allow OTA update from any data source. You can also look at esp_https_ota module for an example of how to update an OTA partition. It doesn't have to be from the network.

John A

jhinkle
Posts: 17
Joined: Wed Aug 29, 2018 3:17 pm

Re: Update Via UART

Postby jhinkle » Wed Aug 29, 2018 4:13 pm

Look at esptool.py and see how they program it using the uart.

Perform the same protocol via a uart in your external CPU.

Besides the uart, you will need some I/O to control reset and I/O manipulation to put the ESP into programming mode.

There are also a few C based ESP tools like esptool that are open source. You can review them if you are not proficient with python.

Snappy
Posts: 1
Joined: Thu Feb 04, 2021 8:02 pm

Re: Update Via UART

Postby Snappy » Thu Feb 04, 2021 8:07 pm

Please supply a link to one or more of the C coded programs to update the ESP32 firmware.

Thank you.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Update Via UART

Postby WiFive » Fri Feb 05, 2021 12:02 am


braddd
Posts: 6
Joined: Mon Dec 21, 2020 9:35 pm

Re: Update Via UART

Postby braddd » Mon Feb 08, 2021 1:11 am

https://github.com/espressif/esptool/wi ... l-Protocol will give you what you need to know, but beware that it's a little confusing and not all that straightforward. You'll also need to look at the serial flasher source code for some things, especially to see how they do the CRC because it's not a method I've ever seen before. I've written code using that serial protocol reference, which allows an ATmega1248P to erase and flash an ESP32 using just UART, but unfortunately it's closed source and currently only flashes up to 0x200000. Something in the ROM loeader appears to limit it. Maybe a bug

Who is online

Users browsing this forum: No registered users and 63 guests