Skip to content

First Flash

This tutorial takes you from an unboxed board to a running program. You will connect the board, enter download mode, flash a simple demo, and verify the output over the serial monitor.

  1. Locate the Type-C UART port on the board. This is the port used for programming and serial output. It is labeled on the silkscreen — do not confuse it with the Type-C USB OTG port.

  2. Connect a USB Type-A to Type-C cable between your computer and the Type-C UART port.

  3. Verify the connection:

    Terminal window
    ls /dev/ttyUSB* /dev/ttyACM*

    You should see a new device, typically /dev/ttyUSB0 or /dev/ttyACM0.

    If no device appears, install the CH343 or CP210x driver for your kernel. The board uses a USB-to-UART bridge chip.

The ESP32-P4 must be in download (bootloader) mode to receive firmware over UART.

  1. Hold the BOOT button on the board.

  2. While holding BOOT, press and release the RST (reset) button.

  3. Release the BOOT button.

The board is now in download mode. There will be no visible indication on the board itself — this is normal. The serial port will still be enumerated by your OS.

  1. Open the hello_world example project you created during ESP-IDF setup.

  2. In the VSCode status bar at the bottom, verify the target chip is set to ESP32-P4.

  3. Click the serial port selector in the status bar and choose the port your board is connected to (e.g., /dev/ttyUSB0 or COM3).

  4. Click the Build button (or press Ctrl+E then B). Wait for the build to complete successfully.

    Project build complete. To flash, run:
    idf.py flash
  5. Click the Flash button (or press Ctrl+E then F). The tool will upload the firmware to the board.

  6. When the flash completes, press the RST button on the board to start the program.

Alternatively, from the ESP-IDF terminal:

Terminal window
idf.py set-target esp32p4
idf.py build
idf.py -p /dev/ttyUSB0 flash
idf.py -p /dev/ttyUSB0 monitor
  1. Open the serial monitor:

    • ESP-IDF: Click the Monitor button in the status bar, or run idf.py -p /dev/ttyUSB0 monitor.
    • Arduino: Go to Tools > Serial Monitor and set the baud rate to 115200.
  2. You should see output from your program:

    Hello from ESP32-P4
    Hello from ESP32-P4
    Hello from ESP32-P4
  3. If you have a display connected, display demos will render on the screen after flashing the appropriate firmware. See the Display guide for details.

SymptomCauseFix
No /dev/ttyUSB* or COM port appearsMissing USB-UART driverInstall the CH343 or CP210x driver for your OS (links above)
Device appears then disappearsDamaged or charge-only cableTry a different USB cable — it must support data transfer
Permission denied (Linux)User not in dialout groupRun sudo usermod -aG dialout $USER and log out/in
SymptomCauseFix
”Failed to connect”Board not in download modeRepeat the BOOT + RST button sequence
”Timed out waiting for packet header”Wrong serial port selectedCheck the port selection in your IDE
”Wrong chip/target”Target set to wrong ESP32 variantSet target to ESP32-P4 specifically
Flash succeeds but program does not startBoard stuck in download modePress the RST button to restart normally
SymptomCauseFix
”Toolchain not found”ESP-IDF installation incompleteRe-run the EXPRESS setup wizard in VSCode
Missing component errorsESP-IDF version too oldUpgrade to v5.3.1 or later
Arduino “Board not supported”Board package too old or missingInstall esp32 board package v3.2.0+

Your board is flashed and responding. From here you can explore the peripheral guides: