I'm designing a product that will have an optional add-on board that contains a ESP32-WROOM-32E which will be used to add wifi functionality.
Communicating between the ESP32 and my primary MCU a STM32H7 isn't too hard. But I would like the STM32H7 to be able to write the firmware of the ESP32. The purpose being that I don't have to worry about firmware version mismatch between the 2 boards. The main board will simply reflash the add-on board if it's the wrong version.
I'm new to the ESP32, and it's not totally clear to me how it's programmed. It looks like most dev boards use USART0, but that presumably uses a bootloader (and therefore another piece of firmware to track for compatibility).
What are the minimum pins I can connect between the ESP32-WROOM-32E and my main MCU, that will allow me to talk to it, and also flash the firmware? It could use the following configurations, in order of desirability:
Without using a bootloader
Using a standard bootloader
Using a custom bootloader