ESP32-C5 board

Espressif's new ESP32-C5 module features a 240 MHz RISC-V processor, with 16 Mbytes of flash and 384 KB of on-chip SRAM, and 4 Mbytes of PSRAM. It has 2.4 and 5 GHz Dual-band Support supporting Wi-Fi 6 (802.11ax) with 802.11a/b/g/n/ac backwards compatibility. It also supports Bluetooth 5 (LE), Zigbee, and Thread.

USB CDC

The ESP32-C5 has a USB CDC (Communications Device Class) that can emulate a serial port over USB. This allows it 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. I therefore don't recommend boards that only provide the USB CDC for use with uLisp.

The following board provides a separate CP2102N USB-to-serial converter, and so is ideal for use with uLisp.

Board

ESP32-C5-DevKitC-1

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.3.0, which is the first core supporting the ESP32-C5. Note that on MacOS a dylib used by the core when uploading requires MacOS Catalina (10.15) or later.

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

Check that the options are set as follows:

USB CDC On Boot: "Disabled"
CPU Frequency: "240MHz (WiFi)"
Flash Size: "8MB (64Mb)"

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 uLisp

Connect to the board via the UART connection.

  • Download release 4.8e 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

The ESP32-DevKitC-1 Board supports Wi-Fi. To connect to a Wi-Fi network give the wifi-connect command with the network name and password; for example:

> (wifi-connect "Geronimo" "secret99")
"10.0.1.28"

If successful it will return the IP address you are connected to.

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

Note that on connecting to a Wi-Fi network with the ESP32-C5 you may get the error:

can not get wifi protocol under WiFi band mode WIFI_BAND_MODE_AUTO,
please use esp_wifi_get_protocols instead

This can be ignored.

ESP32-C5-DevKitC-1 Board

The ESP32-DevKitC-1 Board is a development board from Espressif for evaluating their new ESP32-C5 module:

ESP32-C5.jpg

For full information about the board see ESP32-C5-DevKitC-1 on docs.espressif.com.

Peripherals

NeoPixel

The ESP32-DevKitC-1 Board has a NeoPixel connected to digital pin 27.

The Arduino Core lets you use this like a conventional white LED with digitalwrite, so you can blink it with the following program:

(defun blink (&optional x)
  (digitalwrite :led-builtin x)
  (delay 1000)
  (blink (not x)))

Run it by typing:

(blink)

Exit by entering ~.

Analogue inputs

The ESP32-DevKitC-1 Board has 6 analogue inputs, on pins 1 (A0) to 6 (A5).

Serial

The ESP32-DevKitC-1 Board has one serial port on pin numbers 12 (RX) and 11 (TX).

SPI

The ESP32-DevKitC-1 Board has one SPI port on pin numbers 6 (SS), 9 (MISO), 8 (MOSI), and 10 (SCK).

I2C

The ESP32-DevKitC-1 Board has one I2C port on pins 2 (SDA) and 3 (SCL).