DFU for ESP32 uploads but won't boot - checksum error

Hi All,

I am trying to get DFU host update working with a Seeed Xiao ESP32C3.

The Zephyr firmware works when flashed from West. I took the zephyr.bin file

I got the zephyr.bin file and created the binpack with the command

notecard -binpack esp32 0x10000:zephyr.bin

I got the upload to work after a few tries, and by sniffing the TX port of the host, I can see the update in progress. Then it boots and I get:

ESP-ROM:esÿESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fc9ec30,len:0x2e9c
load:0x40380000,len:0x1ec20
Checksum failure. Calculated 0xb5 stored 0xfc

It just tries to boot repeatedly with the same sequence.

The zephyr.bin file is 408 kB. It looks different to the previous files I built for the STM Swan. It is not a pure binary file and has error messages and stuff in it. I’m not sure if I’m using the correct file.

I know it’s a very old ESP32C3 chip. I am getting some more next week.

Any clues would be greatly appreciated.

Thanks in advance.

Rob

I got it working.

I tried flashing some basic firmware, generated using the Ardiuno IDE, with esptool. After several attempts I found that, for the ESP32C3, the address must be entered as 0x00000000. Entering it as 0x0000 or any other way does not work.

I then flashed a bin file, generated by West, with esptool. That worked with the same settings.

I tried to make a binpack using the changed address, in full, and it worked.

So, if anyone needs it, full instructions for using DTU with the Xiao ESP32C3 are:

Connect RX and TX according to the instructions.
Connect Aux4 of the Notecard to the EN pad on the bottom of the Xiao.
Connect Aux3 of the Notecard GPIO9.
Invert Aux1 of the Notecard so it provides a high output during firmware update. I used an Arduino for this exercise but will use a FET in my product. I then connected the inverted output to GPIO2 and GPIO8 using 2 x 5k resistors.

Build the binpack using:

notecard -binpack esp32 0x00000000:zephyr.bin

Replace zephyr.bin with the name of your bin file. The Arduino bin file worked too.

The documentation for ESP32 hosts on the Notecard Outboard Firmware Update page shows the address as 0x10000, which is not correct for the ESP32C3.

Rob

4 Likes