⚡ Firmware Flashing Guide

How to flash MicroPython firmware to your ESP32

← Back to Main Page

📋 Overview

This guide will walk you through flashing the MicroPython firmware to your ESP32 microcontroller for the PySTEM Mini Bot. The firmware enables Python programming and provides all the necessary libraries for robot control.

🔧 Current Firmware

ESP32_GENERIC-20250415-v1.25.0.bin

MicroPython v1.25.0 specifically configured for ESP32 Generic boards

💾 Download Firmware

⚠️ Before You Start

Flashing firmware will erase all existing code on your ESP32. Make sure to backup any important files before proceeding. Ensure your ESP32 is properly connected and your computer recognizes the device.

📋 Prerequisites

What You'll Need

  • ESP32 development board
  • USB cable (typically micro-USB or USB-C depending on your board)
  • Computer with Windows, macOS, or Linux
  • Internet connection for downloading tools
  • ESP32 drivers installed (if needed)

💻 Flashing Method: Command Line

💻 Command Line Flashing

Using esptool.py for more control

Requirements:
  • Python 3.6+ installed
  • pip package manager
  • Command line access

💡 Note:

If pip doesn't work, try pip3. Similarly, if python doesn't work, try python3.

  1. Install esptool:
    pip install esptool

    If this doesn't work, try: pip3 install esptool

  2. Open Terminal/Command Prompt:
    Windows: Press Win+R, type cmd, press Enter
    macOS: Press Cmd+Space, type terminal, press Enter
    Linux: Press Ctrl+Alt+T or search for "Terminal" in applications
  3. Connect ESP32:
    Plug your ESP32 into your computer using a USB cable
  4. Erase flash:
    esptool.py --chip esp32 erase_flash
  5. Flash firmware:
    esptool.py --chip esp32 --baud 460800 write_flash -z 0x1000 ESP32_GENERIC-20250415-v1.25.0.bin
  6. Test with LED blink:
    Go to our Python IDE and run the LED blink example program to verify everything is working

🔧 Troubleshooting

ESP32 Not Detected

  • Install ESP32 drivers from the manufacturer
  • Try a different USB cable (data cables, not just charging cables)
  • Try a different USB port
  • Press and hold the BOOT button while connecting

Flash Failed

  • Lower the baud rate (try 115200 instead of 460800)
  • Put ESP32 in download mode: Hold BOOT + press RESET, release RESET, then release BOOT
  • Ensure no other programs are using the serial port
  • Try flashing with a shorter USB cable

Permission Denied (Linux/macOS)

  • Add your user to the dialout group: sudo usermod -a -G dialout $USER
  • Or use sudo with esptool commands
  • Log out and back in after changing groups

✅ Verification

After successful flashing, verify your ESP32 is working correctly:

  1. Connect via Serial: Use a terminal program (PuTTY, Arduino Serial Monitor, or our web IDE)
  2. Check MicroPython: You should see the MicroPython REPL prompt >>>
  3. Test Basic Commands:
    >>> print("Hello PySTEM Mini Bot!")
    Hello PySTEM Mini Bot!
    >>> import machine
    >>> machine.freq()
    240000000

🎉 Success!

If you see the MicroPython prompt and can run basic commands, your firmware flash was successful! You're now ready to start programming your PySTEM Mini Bot.

🚀 Next Steps

With firmware successfully flashed, you're ready to start programming!

🚀 Open Python IDE

📚 What's Next?

  • Use our browser-based IDE to write Python programs
  • Start by running the LED blink example to test your ESP32
  • Try the example programs for motors, sensors, and movement
  • Connect your robot hardware following the assembly guide
  • Progress from simple LED blinking to complex robot behaviors