Skip to content

Instantly share code, notes, and snippets.

@planetis-m
Last active July 28, 2025 15:18
Show Gist options
  • Save planetis-m/bfb1c474f4db5b95c63475aa18d7b470 to your computer and use it in GitHub Desktop.
Save planetis-m/bfb1c474f4db5b95c63475aa18d7b470 to your computer and use it in GitHub Desktop.
ESP32-S3 Tutorial

ESP32 Development Setup Guide

This guide walks you through setting up an ESP-IDF project, configuring your ESP32, and flashing the firmware. Complementary video: https://www.youtube.com/watch?v=zW9wOples-Q


1. Set Up the Development Environment

First, install the ESP-IDF toolchain by following the official documentation for your operating system.


2. Configure the Project

Once the environment is set up, navigate to your project directory and configure it for your specific board.

  1. Set the target device. For this guide, we'll use the ESP32.

    idf.py set-target esp32
  2. Open the configuration menu.

    idf.py menuconfig
  3. Set the flash size. In the menu, navigate to Serial Flasher ConfigFlash Size and select 16MB.

  4. Increase the CPU frequency. Navigate to Component configESP System SettingsCPU frequency and change it to 240MHz.

  5. Save your changes and exit the menu.


3. Flash the Firmware

Now, you'll connect the board and flash your code.

  1. Find the device port.

    Open a terminal and run sudo udevadm monitor -u. Then, connect your ESP32 board using its USB-UART port. Look for a line in the output similar to this:

    UDEV  [31840.395431] add      /devices/.../tty/ttyACM0 (tty)
    

    This shows the device is connected at /dev/ttyACM0.

  2. Flash the device.

    Use the port you just found in the flash command:

    idf.py -p /dev/ttyACM0 flash

Troubleshooting Common Errors

  • Permission Denied Error

    If you see the error Error: Invalid value for '-p' / '--port': Path '/dev/ttyACM0' is not readable., you need to grant your user account permission to access the serial port.

    • First, find your username:

      whoami
    • Next, add your user to the dialout group (for most Linux distributions like Ubuntu) or the uucp group (for Arch Linux). Replace your_username with the output from the whoami command.

      # For Debian, Ubuntu, and most other distros
      sudo usermod -a -G dialout your_username
      # For Arch Linux
      sudo usermod -a -G uucp your_username
    • Log out and log back in for the group changes to take effect. You should now be able to run the flash command successfully.

  • Wrong Boot Mode Error

    If you get A fatal error occurred: Failed to connect to ESP32: Wrong Boot Mode, the board isn't in flashing mode. To fix it:

    1. Press and hold the BOOT button on your ESP32 board.
    2. While holding it, run the flash command again.
    3. Release the button once you see the Connecting... message in the terminal.

4. Monitor the Output

After flashing is complete, you can view the output from your ESP32.

  • Start the monitor:

    idf.py -p /dev/ttyACM0 monitor
  • Exit the monitor:

    Press the keyboard shortcut Ctrl + ]. You can also press Ctrl + T followed by Ctrl + H to see a help menu with all available shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment