Leon Anavi
IT Tips && Tricks

Internet of Things

Created: 09.07.2025 06:59 Last Modified: 09.07.2025 18:50 Views: 24
Keywords: ESP32, ESP32-C3, ESP32C3, esptool, XIAO ESP32C3

Flashing Firmware to ESP32C3 Devices with Esptool: A Step-by-Step Guide Using the ANAVI Miracle Emitter and XIAO ESP32C3

If you are into home automation, there is a good chance you have come across the ESP family of microcontrollers by Espressif, including the popular ESP8266 and ESP32 series. In this post, we will take a hands-on look at using Esptool, a powerful Python-based utility for flashing firmware onto ESP devices. This walkthrough is based on a recent video tutorial that demonstrates how to flash precompiled firmware onto the XIAO ESP32C3 module, which is part of the designed by me open source hardware ANAVI Miracle Emitter.

What is Esptool?

Esptool is a command-line utility that helps you:

- Flash firmware to ESP8266 and ESP32 boards, including newer RISC-V based chips like ESP32C3 and ESP32C6
- Read flash contents
- Erase memory
- Update bootloaders or only the firmware

Since it is written in Python and released under the GPL version 2 license, Esptool works on Windows, macOS, and Linux. This tutorial uses Ubuntu 24.04 LTS.

Setting Up ESPTool on Ubuntu

To get started, follow these steps:

1. Open a terminal on your Ubuntu system.

2. Update your package list:

sudo apt update

3. Install Python 3 and pipx:

sudo apt install python3 pipx -y

4. Install Esptool using pip:

pipx install esptool
pipx ensurepath

5. Verify the installation:

esptool version

Esptool is now ready to use.

Flashing the Bootloader and Firmware Together

Anavi Miracle Emitter is an open-source board built around the XIAO ESP32C3. It is designed to control 5V addressable LED strips such as NeoPixels. The open source firmware is an Arduino sketch that has been precompiled and published on GitHub. You can download it here.

Here is how to flash both the bootloader and firmware:

1. Download and extract the precompiled firmware archive.

2. Connect your ESP32C3 board to your computer using a USB-C cable.

3. Run the following command in the terminal (adjust the port if necessary):

esptool.py --chip esp32c3 --port /dev/ttyACM0 --baud 460800 write_flash 0x0 anavi-miracle-emitter-sw/build/esp32.esp32.XIAO_ESP32C3/anavi-miracle-emitter-sw.ino.merged.bin

This command sets the chip type, specifies the correct port, and writes the merged binary to memory address 0x0.

Once the flashing process is complete, Esptool will reset the board and boot it with the new firmware.

Flashing Only the Firmware (Without the Bootloader)

If you want to update only the firmware and keep the existing bootloader unchanged, use this command instead:

esptool.py --chip esp32c3 --port /dev/ttyACM0 --baud 460800 write_flash 0x10000 anavi-miracle-emitter-sw/build/esp32.esp32.XIAO_ESP32C3/anavi-miracle-emitter-sw.ino.bin

In this case, the memory address is 0x10000, which is where the firmware typically resides after the bootloader. Because this method flashes a smaller file, it is a bit faster than writing both components. To summarize: use correct memory addresses such as 0x0 for both bootloader and firmware and 0x10000 for firmware only.

Why ANAVI Miracle Emitter?

ANAVI Miracle Emitter is open-source both in hardware and software. Designed in KiCad, it is ideal for NeoPixel LED projects and is built around the modern RISC-V ESP32C3 microcontroller. It supports 5V addressable LED strips and provides a compact, flexible development platform for makers and automation enthusiasts. You can find the design files, firmware, and documentation on git and GitHub repositories of ANAVI Technology.

Be sure to check out the full YouTube tutorial for a step-by-step demonstration. If you found this helpful, consider subscribing to my YouTube channel for more open-source hardware and software content.



  Home | About | Contact | Disclaimer | Sitemap © 2009-2022 Leon Anavi. All rights reserved.