Flash ESP32 via SPI?

FrozenArm
Posts: 5
Joined: Thu Apr 22, 2021 3:41 am

Flash ESP32 via SPI?

Postby FrozenArm » Thu Apr 22, 2021 3:46 am

I'm trying to understand if the following is feasible and how I could go about it.

If the only way I had to communicate with an ESP32 chip was via another microcontroller using SPI. Could I the SPI to flash the ESP32? If so, how could I go about it?

Franco
Posts: 101
Joined: Thu Dec 10, 2015 1:11 pm

Re: Flash ESP32 via SPI?

Postby Franco » Thu Apr 22, 2021 5:31 pm

Hi there,
you could write the new image in the flash memory via SPI and then perform ESP32 programming using OTA method.

FrozenArm
Posts: 5
Joined: Thu Apr 22, 2021 3:41 am

Re: Flash ESP32 via SPI?

Postby FrozenArm » Thu Apr 22, 2021 7:52 pm

What if I wanted to flash all of it? Partition table, OTA initial data, app image, bootloader reflash digest, NVS encryption key? Same process or would I need to do something special?

Also, what can I look into to find out how to do this?

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

Re: Flash ESP32 via SPI?

Postby WiFive » Fri Apr 23, 2021 7:54 pm

There are some topics about reflashing the bootloader and partition table with ota, which is not supported and has the risk of bricking the device but is possible. Ota over spi can be treated similarly to ota over network. The only way to have full recovery ability would be to be able to set the boot mode and flash over uart.

FrozenArm
Posts: 5
Joined: Thu Apr 22, 2021 3:41 am

Re: Flash ESP32 via SPI?

Postby FrozenArm » Thu Apr 29, 2021 5:45 pm

WiFive wrote: There are some topics about reflashing the bootloader and partition table with ota, which is not supported and has the risk of bricking the device but is possible. Ota over spi can be treated similarly to ota over network. The only way to have full recovery ability would be to be able to set the boot mode and flash over uart.
I've seen some of the topics regarding reflashing bootloader/partition table with OTA. But I'm wondering, is there a way to use SPI to flash the board like it is done via UART? As in, have the board treat the SPI the same way that it treats the UART?

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

Re: Flash ESP32 via SPI?

Postby WiFive » Thu Apr 29, 2021 11:57 pm

No because it isn't implemented in the rom bootloader. If you have the ability to use the same pins for spi and uart on your host side you may be able to figure something out. Why do you expect to need to reflash everything?

FrozenArm
Posts: 5
Joined: Thu Apr 22, 2021 3:41 am

Re: Flash ESP32 via SPI?

Postby FrozenArm » Fri Apr 30, 2021 1:24 am

The ESP will be integrated into a unit where the only access to it will be via another micro controller that will connect to it via SPI. If there's a need to make flash it in the future (not just an image update via OTA) then I'm trying to figure out how that could be done.

Who is online

Users browsing this forum: No registered users and 93 guests