🛠 First Startup of the Metro ESP32-P4 Hydra
Objectives
This tutorial guides you through the initial setup of the Adafruit Metro ESP32-P4 Hydra. You will learn to install the necessary tools, flash the TinyUF2 firmware, and run your first program to validate serial communication. This step is crucial to leverage the high performance of the ESP32-P4 SoC.
Required Hardware
- Adafruit Metro ESP32-P4 Hydra board
- USB-C data cable (charge-only cables will not work)
- Computer (Windows, macOS, or Linux)
- Arduino IDE (version 2.x recommended) or VS Code with PlatformIO
Steps
- Environment Setup: Open Arduino IDE. Go to
File > Preferencesand add the Adafruit board manager URL:https://adafruit.github.io/arduino-board-index/package_adafruit_index.json. Restart the IDE. - Add Board: In
Tools > Board > Boards Manager, search for "Adafruit ESP32 Boards" and install the latest version. - Bootloader Mode: Press and hold the
BOOTbutton on the board. While holding the button, plug the USB-C cable into the computer. Release theBOOTbutton only after 2 seconds. The board is now in TinyUF2 mode. - Flash Firmware: A "TINYUF2" storage drive appears on your computer. Download the
.uf2file suitable for the Metro ESP32-P4 Hydra from the Adafruit website. Copy it to the TINYUF2 drive. The board restarts automatically once the transfer is complete. - IDE Configuration: In the
Toolsmenu, selectAdafruit Metro ESP32-P4 Hydraas the board type. Select the corresponding serial port (often COMx on Windows or /dev/tty.usbmodemX on Mac/Linux). - Test Program: Open the
Blinkexample viaFile > Examples > Basics > Blink. Modify theloop()function to use the onboard LED if needed, or addSerial.begin(115200)insetup()andSerial.println("Hello Hydra!")inloop(). - Upload: Click the "Upload" button. Wait for compilation and writing to the board to finish.
Verification
Open the Arduino IDE Serial Monitor (magnifying glass icon top right). Set the speed to 115200 bauds. You should see the message "Hello Hydra!" displayed in a loop. If the LED also blinks, the board is correctly powered and programmed. If it fails, ensure the USB cable is a data cable and the selected port is correct.
Going Further
Once the basics are validated, explore advanced interfaces. Try connecting a MIPI DSI screen via one of the 22-pin connectors to display a graphical interface, or use the USB-A host port to plug in a USB drive and read files, leveraging the power of the dual-core RISC-V processor.
Other tutorials for this board
- First connection and startup of the Metro ESP32-P4 Hydra
- Controlling GPIOs and a Simple Display on Metro ESP32-P4 Hydra
- Store Data on Adafruit Metro ESP32-P4 Hydra
- Controlling an I2C sensor with ESP32-P4 Hydra
- Advanced Startup: Power, USB, and Debugging on ESP32-P4 Hydra
- High-Speed USB Storage Automation on ESP32-P4 Hydra
Code examples for this board
esp32-p4-hydra-gpio-blink.inoC++ (Arduino)esp32-p4-hydra-mpu6050-i2c.inoC++ (Arduino)esp32-p4-hydra-wifi-http.inoC++ (Arduino)esp32-p4-hydra-sdcard-write.inoC++ (Arduino)esp32-p4-hydra-usb-host-mouse.inoC++ (Arduino)esp32-p4-hydra-gpio-led-blink.inoC++ (Arduino)