Topics

► Games

► Sound & Music

► Watches & Clocks

► Wireless

► GPS

► Power Supplies

► Computers

► Graphics

► Lighting

► Thermometers

► Educational

► Wearables

► Test Equipment

► Tutorials

► Libraries

► PCB-Based Projects

By processor

AVR ATtiny

► ATtiny10

► ATtiny2313

► ATtiny84

► ATtiny841

► ATtiny85

► ATtiny861

► ATtiny88

AVR ATmega

► ATmega328

► ATmega1284

AVR 0, 1, and 2-series

► ATmega1608

► ATmega4808

► ATmega4809

► ATtiny1604

► ATtiny1614

► ATtiny202

► ATtiny3216

► ATtiny3224

► ATtiny3227

► ATtiny402

► ATtiny404

► ATtiny414

► ATtiny814

AVR DA/DB/DD-series

► AVR128DA28

► AVR128DA32

► AVR128DA48

► AVR128DB28

► AVR128DB48

► AVR64DD14

► AVR32DD28

ARM

► ATSAMD21

► RP2040

► RA4M1

RISC-V

► ESP32-P4

About me

  • About me
  • Twitter
  • Mastodon

Feeds

RSS feed

ESP32-P4 Feather Board

25th February 2026

This is a Feather-format board based on the new ESP32-P4 high performance processor from Espressif:

P4Feather.jpg

The ESP32-P4 Feather board.

The ESP32-P4 is a dual-core RISC-V processor running at up to 400MHz, with 768KB of on-chip SRAM, 32Mbytes of on-chip PSRAM, and up to 32Mbytes of external flash.

Introduction

After designing the AVR128DA32 Feather Board I read about Espressif's new ESP32-P4 processor, a high-performance processor with a RISC-V core, and decided it would be an interesting challenge to design a Feather-format board based on that. Like other recent ESP32-series chips the ESP32-P4 includes an internal native USB interface, so I decided to design the board to support USB via a USB-to-serial chip as well as this native USB.

The design

When I started the design I looked at three main sources of information: The ESP32-P4 datasheet [1], the ESP32-P4 Hardware Design Guidelines [2], and the Waveshare ESP32-P4 Nano circuit diagram [3].

I underestimated how much harder this board was going to be compared to the earlier AVR128DA32 Feather Board, and I soon realised that it would only be possible by changing to using 0402 resistors and capacitors, rather than the 0805 ones I was using, and by switching to a four-layer board. I checked on OSH Park and JLCPCB and was relieved that this wouldn't be much more expensive than a two-layer board.

The layers have the following functions:

Layer Function
Top Components and most signal traces.
Second Ground plane.
Third Power traces.
Bottom More signal traces, where necessary.

For simplicity there are no blind vias, so each via connects between all four layers.

Switching to a four-layer board really made the layout much easier. The ground plane layer makes it unnecessary to think about routing the ground, apart from placing vias to connect through to it. Also, the third layer makes routing the power supply connections much easier.

The Feather specification

I've kept to the Adafruit Feather specification [4], but with the following extensions:

  • Two additional pins at the top right corner of the board give access to the D+ and D- pins on the P4 USB interface.
  • There's an output from the 1.2V supply.
  • Analogue input GPIO22 is connected to the BAT battery voltage output via a voltage divider, so you can monitor the battery voltage.
  • There's a BOOT button for uploading programs.

Power supplies

The ESP32-P4 has several power domains. The following table shows which GPIO pins are on each domain:

Pins Power supply Voltage
GPIO0-GPIO3 VDDPST_1/VBAT 3.3V
GPIO4-GPIO15 VDDPST_1 3.3V
GPIO16-GPIO23 VDDPST_2 3.3V
GPIO24-GPIO38 VDDPST_4 3.3V
GPIO39-GPIO48 VDDPST_5 1.2V
GPIO49-GPIO54 VDDPST_6 3.3V

Even though the board doesn't use any of the I/O pins on the 1.2V power domain, it's still needed to power the ESP32-P4 core.

The Espressif design documents recommend the use of a buck converter such as the TLV62569 to derive the 3.3V supply from the 5V USB input, but I decided to use simpler APA2112 linear regulators for both the 3.3V and 1.2V supply rails. These are capable of supplying up to 600mA, and so should be adequate for the ESP32-P4, given that I'm not planning to connect power-hungry peripherals. I measured the current consumption of the final board at about 150mA, rising to 200mA when PSRAM was enabled, well within the capability of the regulators.

Chip identification

The second character of the four-character manufacturing code indicates the chip revision number [5]:

Chip Revision XAXX XCXX XEXX XFXX XGXX
Manufacturing Code v0.0 v1.0 v1.3 v3.0 v3.1

The chips I bought from AliExpress all have the code FEF0 which indicates v1.3.

The circuit

Here's the circuit:

ESP32-P4Circuit.gif

Circuit of the ESP32-P4 Feather board.
Click to open a larger version in a new window.

USB to Serial Converter

The board uses a Silicon Labs CP2102N QFN24 USB-to-Serial converter chip to interface between the USB D+/D- signals and the ESP32-P4 RXD and TXD pins. You could also use the CP2104 which is pin compatible and functionally identical in this circuit.

The ESP32-P4 also includes a native USB interface, and I've brought this out to two pins labelled D+ and D- at the top right corner of the board, giving you the option to use this instead or as well as the main USB socket for USB connectivity.

Flash memory

The flash memory chip can be between 2MB and 32MB. Specify the amount of flash you want to make available, up to the size of your chip, in the Flash Size option on the Boards menu. You'll also have to set the Partition Scheme to an appropriate option.

Here's the parts list (click to expand):

► Parts list

Construction

I created a four-layer PCB in Eagle, and ordered a set of PCBs from JLCPCB. I used these to build three complete prototypes, two of which are shown in the photographs.

All the components are mounted on the top of the board, and there are expanded pin legends on the underside:

P4FeatherBack.jpg

The underside of the P4 Feather board.

All the resistors and capacitors are 0402 size, and the processor chip is a 104-pin QFN package, so the board is quite tricky to solder by hand. I used a Miniware MHP50-B5 50x50mm hotplate [6] [7] at 235°C with Chip Quik SMD291AX10T3 solder paste; the board neatly fits diagonally on the plate.

For the ESP32-P4 and CP2102N chips I used a pin to make a thin worm of solder paste along the rows of pads. Time spent getting the line of solder paste thin and even saves time later sorting out solder bridges. I also put some dots of solder paste on the centre pad of each chip. I then dropped the chips in place with a pair of Rhino SW-11 tweezers [8], if necessary giving them a few taps to position them.

After mounting the ESP32-P4 and CP2102N chips I inspected the pins carefully for any solder bridges. One way of removing them is with a fine-tipped soldering iron and desoldering braid, but I dislike that method because it tends to scratch the PCB. My preferred method is prepare a length of stranded connecting wire, with a few millimetres at the end stripped and dipped in flux. I then heat up the area around the solder bridges with a hot air gun, and when the solder melts apply the end of the wire to soak up the excess solder. 

For the 0402 components I put a blob of solder paste on each of the pads, and then positioned the component with the tweezers. I recommend soldering the components into place in batches; otherwise if you try to place too many at once it's easy to accidentally knock the earlier ones out of position.

Finally, I recommend running solder through the holes in the square pads on the underside of the USB connector to firmly anchor its mounting lugs.

Testing the board

Here's my recommended sequence for initially testing the board:

  • Apply +5V between USB and GND while monitoring the current consumption; it should be about 105 mA. Anything much above this indicates a possible short, so disconnect quickly and check for shorts between tracks on the board.
  • Apply +5V between USB and GND again, and check for +3.3V between the 3V3 pin and GND, and 1.2V between the 1V2 pin and GND.
  • Connect the board to a computer check in the Arduino IDE that there's a Serial port on the Port submenu on the Tools menu. If no port appears it probably indicates a problem with the D+ or D- connections between the USB socket and the CP2102N chip.
  • Open the Arduino IDE Serial Monitor set to 115200 baud and press the RESET button on the ESP32-P4 Feather.

You should see the following prompt from the ESP32-P4:

ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0xa (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1

followed by some addresses. This indicates that the ESP32-P4 is attempting to boot from flash, the default boot method which would run a program that you have uploaded.

The next step is to try uploading an example program, such as BlinkSOS, as described in the following section.

Note that it's normal for the orange CHG LED to flicker when no battery is connected.

Running a program

Here's a simple C program BlinkSOS to test the P4 Feather board. It's a more interesting variation of the standard Arduino Blink example that flashes SOS in morse code on the built-in LED:

#define LED_BUILTIN 1

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  uint64_t message = 0b10000000101010001110111011100010101;
  do {
    digitalWrite(LED_BUILTIN, message & 1);
    delay(250);
    message = message >> 1;
  } while (message > 1);
}

It uses a binary constant to specify the sequence of dots and dashes. For more information about the format and timing of morse code see AM Morse-Code Transmitter.

Uploading a program via the USB socket

Install the ESP32 Arduino core

If you don't already have the ESP32 Arduino Core installed:

  • Add the following URL to the Additional Boards Manager URLs list in the Arduino IDE Preferences dialog box:
https://espressif.github.io/arduino-esp32/package_esp32_index.json
  • In the Arduino IDE search for the ESP32 Arduino core in Boards Manager and install it.

I tested this with core version 3.3.7.

Set up the Board options

  • Select ESP32 Arduino from the Board menu, and ESP32P4 Dev Module from the submenu.
  • Set the Board options as follows:

USB CDC On Boot: "Disabled"
Upload Mode: "UART0 / Hardware CDC" 
Flash Size: "4MB (32Mb)"
Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"
PSRAM: "Disabled"

or, if you want to use PSRAM (more workspace but slightly slower):

PSRAM: "Enabled"

You can leave all the other options at their defaults.

Upload the program

  • Connect a 10kΩ resistor between the GPIO36 (SCK) and 3.3V connections on the board's edge connectors.
  • Hold down the BOOT button, press and release the RESET button, then release BOOT.
  • Select the board's USB port from the Port menu.
  • Select Upload in the Arduino IDE to upload the program to the board.
  • Press and release RESET.

The BlinkSOS program should start running, blinking the red LED.

You can remove the 10kΩ resistor after uploading.

Troubleshooting

If the upload fails with an error such as:

A fatal error occurred: Failed to connect to ESP32-P4: No serial data received.

check the following:

  • Open the Arduino IDE Serial Monitor set to 115200 baud, hold down the BOOT button, press and release the RESET button, and then release BOOT.

You should see a prompt from the ESP32-P4 similar to:

ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0x307 (DOWNLOAD(USB/UART0/SPI))
waiting for download

This confirms that the ESP32-P4 is waiting for data.

Running at 400MHz

Although the final ESP32-P4 chips will be certified to run at 400MHz, the currently available chips are limited to 360MHz in ESP-IDF and Arduino core. However, you can run at 400MHz by including the directive:

#define CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=400

I didn't encounter any problems doing this.

Using the ESP32-P4 Feather board

Pins

The function of each pin on the edge connector is described in the following table:

Pin Description
RST Reset.
3.3V 3.3V output from the regulator for powering external circuits; up to 500mA.
GND Ground.
A0-A5 Analogue inputs, or general pins 16 to 21. The default resolution is 12 bits.
SCK, MOSI, MISO SPI pins, or general pins 36, 32, and 33.
RX, TX Serial pins, available as Serial0, or general pins 38 and 37.
GND Extra GND pin.
SDA, SCL I2C pins, or general pins 7 and 8.
24, 25 General pins.
2 to 6 General pins *.
USB 5V output from the USB connector. †
EN Take low to disable the regulators.
BAT Direct output from the LiPo battery.
D+, D- Native CDC USB port.

* The pin legends for these pins are incorrect on the prototype boards shown in the photographs, but have been corrected on the final board files.
† Can also be used to power the board from an external 5V supply, in which case the USB port should be left unconnected.

Using a LiPo battery

If you have a LiPo battery connected it will power the board, but if you connect the USB cable the board will be powered by USB and the LiPo battery will be charged. The CHG LED will light when the battery is charging.

Check the polarity of your LiPo battery before connecting it; some LiPo batteries use the same connector but with the opposite polarity, which would damage the board.

The maximum recommended charge rate for a LiPo battery is 1C, which means for a 200mAh battery it should not be more than 200mA. The charge rate on the Feather board is set to 200mA by R4. If you have a larger battery and want a faster charge rate you can change this resistor; see the table on the circuit diagram.

Checking the battery voltage

Pin GPIO22 is connected to the battery via a potential divider, setting it at half the battery voltage, so you can check the battery voltage with analogRead(22).

Graphics demo

Here's an example showing the ESP32-P4 board running the graphics demo for my Compact TFT Graphics Library, which lets you interface to a range of different TFT colour displays using SPI. Here it's using the Adafruit 1.14" 240x135 display [9]:

ESP32-P4Demo.jpg

A demo graphics program running on the ESP32-P4 Feather board.

Using uLisp

One of my objectives in designing the ESP32-P4 Feather board was to use it as a platform for my Lisp interpreter, uLisp.

Installing uLisp

Get the latest release of the ESP version of uLisp from: Download and install uLisp.

Then install it as described above for uploading a program.

You should then be able to type or copy and paste Lisp programs into the field at the top of the Serial Monitor window, and click the Send button or press Return to enter them.

The ESP32-P4 Feather board running at 400MHz runs my Tak benchmark in 1.5s, compared to 64.6s for an Arduino Uno.

LED

The ESP32-P4 Feather board has a red LED connected to pin 1.  You can blink it with the following program:

(defun blink (&optional x)
  (pinmode 1 :output)
  (digitalwrite 1 x)
  (delay 1000)
  (blink (not x)))

You can flash "SOS" in morse code with the following blink-sos program:

(defun blink-sos ()
  (let ((message #*1010100011101110111000101010000000))
    (pinmode 1 :output)
    (loop
     (dotimes (i (length message))
       (digitalwrite 1 (aref message i))
       (delay 250)))))

This is similar to the C version above, except that it uses a Lisp bit array to specify the sequence of dots and dashes. Run it by typing:

(blink-sos)

Exit from the program by entering ~ followed by return.

You can save the blink program to flash memory by typing the command:

(save-image)

You can now load it again after a reset by typing:

(load-image)

Analogue inputs

The ESP32-P4 Feather board provides 6 analogue inputs accessible on the edge connector on pins 16 to 21. The default resolution is 12 bits, but you can change it with analogreadresolution.

Pin 22 is connected to the battery via a potential divider, setting it at half the battery voltage, so you can check the battery voltage with:

> (/ (* (analogread 22) 6.6) 4096)
3.33867

SPI

The ESP32-P4 Feather Board has one SPI port on pin numbers 33 (MISO), 32 (MOSI), and 36 (SCK).

I2C

The ESP32-P4 Feather Board has one I2C port on pins 7 (SDA) and 8 (SCL).

You can verify that the SPI port is working by connecting an SPI device to SDA, SCL, 3V3, and GND and running the following scan program:

(defun scan () 
  (dotimes (p 127)
    (with-i2c (str p)
      (when str (print p)))))

To run it type

(scan)

It should print out the I2C addresses of the devices on the bus.

Uploading a program using the native CDC USB

This is an alternative to using the USB socket and CP2102N to upload a program.

  • Set the Board options as follows:

USB Mode: "USB-OTG (TinyUSB)"
USB CDC On Boot: "Enabled"
Upload Mode: "USB-OTG CDC (TinyUSB)" 
Flash Size: "4MB (32Mb)"
Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"
PSRAM: "Disabled"

or, if you want to use PSRAM (more workspace but slightly slower):

PSRAM: "Enabled"

You can leave all the other options at their defaults.

Upload the program

  • Connect a USB cable to the board as follows:

5V to USB, D+ to D+, D- to D-, and GND to GND.

I used a USB-A shell [10] wired with a four-core ribbon cable.

  • Connect a 10kΩ resistor between the GPIO36 (SCK) and 3.3V connections on the board's edge connectors.
  • Hold down the BOOT button, press and release the RESET button, then release BOOT.
  • Select the board's USB port from the Port menu.
  • Select Upload in the Arduino IDE to upload the program to the board.

The program should start running immediately after the upload.

You can remove the 10kΩ resistor after uploading.

Resources

Get the Eagle or Gerber files for the PCB here: https://github.com/technoblogy/esp32-p4-feather.

Or order boards from OSH Park here: ESP32-P4 Feather Board.


  1. ^ ESP32-P4 Datasheet on espressif.com.
  2. ^ ESP32-P4 Hardware Design Guidelines on espressif.com.
  3. ^ ESP32-P4 Nano Schematic on waveshare.com.
  4. ^ Introducing Adafruit Feather on Adafruit.
  5. ^ ESP32-P4 Chip Revision Identification on docs.espressif.com.
  6. ^ MHP50-B5 on Adafruit.
  7. ^ MHP50-B5 on AliExpress.
  8. ^ Rhino SW-11 Tweezers on Adafruit.
  9. ^ Adafruit 1.14" 240x135 Color TFT Display on Adafruit.
  10. ^ USB DIY Connector Shell on Adafruit.

Previous: Light Lab


blog comments powered by Disqus