breadboard
docs

Example project · Start here

ESP32-P4 Arduino blink

Two real RISC-V cores run a compiled Arduino sketch and blink an external LED on J1 GPIO6. The P4 has no emulated radio. Its 40-position J1 header follows the physical Function EV Board v1.5.2, including the NC contacts.

The ESP32-P4 Arduino blink circuit as rendered by the simulator

How it works

This bench runs Arduino's blink sketch on the ESP32-P4, Espressif's high-performance chip with two RISC-V cores and no built-in radio. The firmware is a real image built with Arduino-ESP32 3.3.10 and ESP-IDF v5.5.4 for the rev3 chip at 400 MHz. setup() starts Serial at 115200 baud, makes GPIO6 an output and prints a banner. loop() writes the pin HIGH, waits 500 ms, writes it LOW and waits 500 ms, so one full cycle takes a second. delay() hands each wait to the FreeRTOS scheduler, so the blink rate comes from the emulated timers, not from the speed of your computer.

GPIO6 is pin 15 of the J1 header. The board art follows the 40 positions of J1 on the physical Function EV Board v1.5.2, including the contacts that are not connected. The pin drives a 220 Ω resistor and a red LED to GND. At 3.3 V logic, the resistor keeps the LED current under 10 mA, well inside its rating. The LED is a real circuit element: its brightness comes from the solved current, not from the pin's logic state.

What to watch

Serial prints ESP32-P4 Arduino blink on GPIO6 once at start-up. After that the red LED turns on for half a second and off for half a second. Probe GPIO6 in Scope to see a square wave between 0 V and 3.3 V with a period of one second.

What's on the bench

  • ESP32-P4-Function-EV-Board
  • LED
  • Resistor

How it's wired

  • ESP32-P4-Function-EV-Board · g6→Resistor · a
  • Resistor · b→LED · a
  • LED · k→ESP32-P4-Function-EV-Board · gnd

This project runs prebuilt firmware on the emulated board; open it in the simulator to watch it work and inspect every part live.

Firmware licence

Notice: this firmware uses the LGPL-licensed Arduino core library

esp32p4-blink.bin is statically linked with Arduino-ESP32 3.3.10. Parts of this library are licensed under the GNU Lesser General Public License, version 2.1 or (at your option) any later version. You may modify this work for your own use and reverse engineer it to debug those modifications. Download the relink package and corresponding source to rebuild it with a changed library.

Try this

  • Select the resistor and set it to 1 kΩ in the Inspector. The LED still blinks in step with GPIO6, but it is dimmer, because less current flows.
  • Select the board and choose MicroPython (rev3 Python REPL) in the Inspector’s Program section. In the REPL, type from machine import Pin and then Pin(6, Pin.OUT).value(1) to light the same LED by hand.
  • Open the ESP32-P4 MicroPython example next. It blinks GPIO54, a pin in the chip's second bank of GPIO registers.

Related projects