Skip to content

ESP-IDF Setup

ESP-IDF (Espressif IoT Development Framework) is Espressif’s official development framework, providing full access to all ESP32-S3 features.

Prerequisites

  • 4GB+ free disk space
  • Python 3.8+
  • Git
  • Build essentials (gcc, make)
Terminal window
sudo apt-get install git wget flex bison gperf python3 python3-pip \
python3-venv cmake ninja-build ccache libffi-dev libssl-dev \
dfu-util libusb-1.0-0

Installation

  1. Clone ESP-IDF

    Terminal window
    mkdir -p ~/esp
    cd ~/esp
    git clone -b v5.2 --recursive https://github.com/espressif/esp-idf.git
  2. Install tools for ESP32-S3

    Terminal window
    cd ~/esp/esp-idf
    ./install.sh esp32s3

    This installs the Xtensa toolchain, OpenOCD, and Python dependencies.

  3. Set up environment (required each session)

    Terminal window
    source ~/esp/esp-idf/export.sh

    Add this to your shell profile for convenience:

    Terminal window
    echo 'alias get_idf=". ~/esp/esp-idf/export.sh"' >> ~/.bashrc

    Then use get_idf to activate the environment.

Create Your First Project

  1. Copy the blink example

    Terminal window
    cd ~/esp
    cp -r $IDF_PATH/examples/get-started/blink .
    cd blink
  2. Set the target chip

    Terminal window
    idf.py set-target esp32s3
  3. Configure for N16R8 memory

    Terminal window
    idf.py menuconfig

    Navigate to:

    • Serial flasher config → Flash size16 MB
    • Component config → ESP PSRAM → Support for external, SPI-connected RAM → Enable
    • Component config → ESP PSRAM → SPI RAM config → Mode (QUAD/OCT)Octal Mode
    • Example Configuration → Blink GPIO number38 (V1.1) or 48 (V1.0)
  4. Build the project

    Terminal window
    idf.py build
  5. Flash to board

    Terminal window
    idf.py -p /dev/ttyUSB0 flash
  6. Monitor output

    Terminal window
    idf.py -p /dev/ttyUSB0 monitor

    Press Ctrl+] to exit.

Project Configuration (sdkconfig)

Key settings for ESP32-S3-DevKitC-1-N16R8:

# Target and memory
CONFIG_IDF_TARGET="esp32s3"
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
# USB console (if using native USB)
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
# Wi-Fi
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32

Useful Commands

CommandDescription
idf.py set-target esp32s3Set chip target
idf.py menuconfigInteractive configuration
idf.py buildCompile project
idf.py flashFlash to board
idf.py monitorSerial monitor
idf.py flash monitorFlash and monitor
idf.py fullcleanClean all build artifacts
idf.py sizeShow firmware size
idf.py size-componentsSize per component

Example Projects

ESP-IDF includes many examples:

Terminal window
ls $IDF_PATH/examples/

Notable examples for DevKitC-1:

ExamplePathDescription
Blinkget-started/blinkGPIO LED control
Wi-Fi Stationwifi/getting_started/stationConnect to AP
Wi-Fi SoftAPwifi/getting_started/softAPCreate AP
USB Serial/JTAGperipherals/usb/device/tusb_serial_deviceUSB CDC
PSRAM Testsystem/himemHigh memory allocation
Cameraperipherals/cameraCamera interface

Troubleshooting

Cannot find ttyUSB0

Terminal window
# Check device connection
dmesg | grep -i cp210
# Add user to dialout group
sudo usermod -aG dialout $USER
# Log out and back in

Build fails with memory errors

Terminal window
# Increase swap space or use
idf.py build -j 2 # Limit parallel jobs

Flash fails

  1. Hold BOOT while pressing RST
  2. Release both buttons
  3. Run flash command

PSRAM not detected

Verify in menuconfig:

  • Component config → ESP PSRAM → Support for external RAM is enabled
  • SPI RAM config → Mode matches your module (OCT for N8R8/N16R8)

Next Steps