ESP32-P4 boards

These boards are based on Espressif's new ESP32-P4 chip which features a dual-core 400 MHz RISC-V processor (running at 360 MHz on these boards), with 16 Mbytes of flash and 768 KB of on-chip SRAM. It can also support up to 32 Mbytes of PSRAM. It's now the fastest ESP32 processor for running uLisp.

USB CDC

The ESP32-P4 has a USB CDC (Communications Device Class) that can emulate a serial port over USB. This allows the ESP32-P4 to communicate with a PC or other host device via USB without needing a separate USB-to-serial converter.

However, the current implementation of the USB CDC has a problem that causes it to hang up when transferring long messages, such as a uLisp program. Boards that rely on the USB CDC are therefore unsuitable for use with uLisp.

The following boards provide a separate USB-to-serial converter, such as the CP2102N or CH340, and so avoid this problem. These are therefore the only ESP32-P4 boards recommended for use with uLisp.

Boards

ESP32-P4 Function EV Board

Waveshare ESP32-P4-NANO

Installing uLisp from the Arduino IDE

Install the ESP32 Arduino core

  • 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.2.0.

  • Select ESP32 Arduino from the Board menu, and ESP32P4 Dev Module from the submenu.

Leave the options set as follows:

USB Mode: "Hardware CDC and JTAG"
Flash Size: "16MB (128Mb)"
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" (or PSRAM: "QSPI PSRAM")

You can leave all the other options at their defaults.

The currently available ESP32-P4 chips are engineering samples and they are limited to running at 360 MHz.

Upload uLisp

If you are using the ESP32-P4 Function EV Board, connect to the board via the USB-UART connection.

  • Download release 4.8d or later of the ESP version of uLisp from the Download uLisp page.
  • Select the board's USB port from the Port menu.
  • Upload uLisp to the board.

Using uLisp

  • Select Serial Monitor from the Tools menu.
  • Enter Lisp commands.

General features

LittleFS and save-image

The ESP32 version of uLisp now uses LittleFS to allow you to save the entire workspace on all ESP32 boards using (save-image).

The first time you call save-image LittleFS allocates the file system, and an error may be displayed such as:

./components/esp_littlefs/src/littlefs/lfs.c:1071:error: Corrupted dir pair at {0x0, 0x1}
E (62578) esp_littlefs: mount failed,  (-84)
E (62579) esp_littlefs: Failed to initialize LittleFS

It should subsequently work without error.

Wi-Fi

Both boards support Wi-Fi. For examples of using the Wi-Fi features see Wi-Fi examples, and for reference information see Wi-Fi extensions.

ESP32-P4 Function EV Board

The ESP32-P4 Function EV Board is a platform from Espressif for evaluating their new ESP32-P4 RISC-V processor. It's available from Espressif's store on AliExpress [1].

ESP32-P4-EV.jpg

The board includes the following additional features:

  • An ESP32-C6-MINI-1 module which provides 2.4 GHz Wi-Fi 6 & Bluetooth 5 (LE).
  • A 7-inch capacitive touch screen with a resolution of 1024 x 600.
  • A 2MP camera with MIPI CSI.
  • A microphone.
  • An audio CODEC chip, audio amplifier, and loudspeaker connector.
  • An Ethernet chip and RJ45 Ethernet port.
  • A USB to UART chip.
  • A MicroSD Card slot (on reverse).
  • RESET and BOOT buttons.

The current version of uLisp doesn't yet support all these additional features, but I hope to add support in future releases.

For full information about the board see ESP32-P4-Function-EV-Board on docs.espressif.com.

Peripherals

Analogue inputs

The ESP32-P4 Function EV Board has 14 analogue inputs, on pins 16 to 23 and 49 to 54.

Serial

The ESP32-P4 Function EV Board has one serial port on pin numbers 38 (RX) and 37 (TX).

SPI

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

I2C

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

Waveshare ESP32-P4-NANO

The Waveshare ESP32-P4-Nano is a 50 x 50 mm board that manages to pack in many of the same features as Espressif's own Function EV Board [2]:

ESP32-P4-Nano.jpg

Analogue inputs

The ESP32-P4-Nano has 14 analogue inputs, on pins 16 to 23 and 49 to 54.

Serial

The ESP32-P4-Nano has one serial port on pin numbers 38 (RX) and 37 (TX).

SPI

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

I2C

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


  1. ^ ESP32-P4-Function-EV-Board on AliExpress.
  2. ^ ESP32-P4-NANO on waveshare.com