This guide provides detailed steps to flash the ESP32 module on the Kumquat board. The ESP32 is used for WiFi and Bluetooth via the **ESP-Hosted-NG** firmware, which is provided by Espressif. To perform flashing or other configuration tasks, you must first stop the driver and disable the SDIO bus to gain control over the ESP32 strapping pins.
## Prerequisites
Before proceeding, ensure you have:
- **esptool.py**, **espefuse.py**, and **espsecure.py** pre-installed on the Kumquat demo image. These tools are available by default.
- A valid **ESP-Hosted-NG** firmware file. You can download the latest version using the following command:
- The **ESP-Hosted-NG** firmware is located inside `/ESP-Hosted-NG_release_v1.0.2/esp32/sdio_only/`.
## Step-by-Step Instructions
### Step 1: Stop the ESP32 Driver
First, stop the running ESP-Hosted driver. This driver is responsible for WiFi and Bluetooth functionality on the ESP32:
```
/etc/init.d/S35esphosted stop
```
This will release control of the ESP32 and allow you to flash it.
### Step 2: Disable the SDIO Bus
You need to disable the SDIO bus because the **D0 strapping pin** of the ESP32 is controlled via the SDIO bus. Disabling the bus ensures that the ESP32 can enter bootloader mode without interference.
Finally, restart the **ESP-Hosted** driver to enable WiFi and Bluetooth services:
```
/etc/init.d/S35esphosted start
```
## Summary
This guide covers the process of flashing the ESP32 on the Kumquat board. You'll need to stop the driver, disable the SDIO bus, and adjust GPIOs to put the ESP32 into bootloader mode. After flashing the firmware, reset the ESP32 and restore the SDIO bus and driver. If replacing the ESP32, don't forget to set the flash voltage using **espefuse.py**.