Espressif ESP32 S-series boards

Espressif release development boards for each of their low-cost Wi-Fi microcontroller modules. This is a selection of the Espressif boards for the ESP32-S3 and ESP32-S3.

These boards all provide a USB to Serial chip, and that gives a reliable USB interface with minimum RAM usage. These boards can therefore be recommended for use with uLisp, even when uploading large uLisp programs via the Serial Monitor. 

Boards

ESP32-S2-Saola-1 WROVER

ESP32-S2-Saola-1 WROOM

ESP32-S3-DevKitM-1

General features

The following features apply to both boards.

Installing 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.

Setting up the Board options

The installation procedure is the same for both of these boards:

  • Select ESP32 Arduino from the Board menu.
  • Select the appropriate Board option: ESP32-S2 Dev Module or ESP32-S3 Dev Module.
  • Set USB CDC On Boot: to "Disabled".
  • Set Upload Mode: to "UART0", or "UART0 / Hardware CDC".
  • Set Partition Scheme to Default 4MB with spiffs.

If your board has PSRAM and you want to use it (recommended):

  • Set PSRAM: to "Enabled" or "QSPI PSRAM".

Otherwise:

  • Set PSRAM: to "Disabled".

You can leave the other options at their defaults.

Uploading uLisp

  • Download release 4.9a or later of the ESP version of uLisp from the Download uLisp page.
  • If the board has two USB sockets, connect to the board via the one labelled UART.
  • Select the board's USB port from the Port menu.
  • Upload uLisp to the board.

If you enabled PSRAM on a board that doesn't have it you will get the error:

PSRAM couldn't be initialized

Uploading Lisp programs

To upload a program to uLisp:

  • Select it, including the comment at the top of the program, and do Copy.
  • Click in the Arduino Serial Monitor input field and do Paste, then press Return.

The comment disables echo, which could interfere with the serial upload.

LittleFS and save-image

The ESP32 version of uLisp 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.

If you have previously used the board with an older version of the Arduino ESP32 core and you get the error:

assert failed: lfs_fs_grow_ lfs.c:5263 (block_count >= lfs->block_count)

upload uLisp again after selecting the option:

  • Erase All Flash Before Sketch Upload: "Enabled"

Wi-Fi

All these boards support 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.

NeoPixel

These boards include a NeoPixel RGB LED. The following program slowly displays the full range of colours on the LED using the rgbledwrite function:

; NeoPixel spectrum

(defvar neopixel 48)

(defun fix (y)
  (setq y (mod y 1536))
  (if (>= y 768) (setq y (- 1535 y)))
  (setq y (max (min (- y 256) 255) 0)))

(defun spectrum ()
  (unwind-protect
      (loop 
       (dotimes (c 1536)
         (rgbledwrite neopixel (fix (+ c 768)) (fix (+ c 256)) (fix (+ c 1280)))
         (delay 50)))
    (rgbledwrite neopixel 0 0 0)))

Set neopixel to the pin corresponding to the NeoPixel. The unwind-protect turns off the LED if you escape from the program.

To run the program enter:

(spectrum)

To exit type a ~.

Sleep

The sleep function can be used to put these boards into light sleep for a specified number of seconds. The current consumption typically drops to 5% of normal power.

ESP32-S2-Saola-1 WROVER

The ESP-S2-Saola-1 WROVER is Espressif's official development board based on the ESP32-S2-WROVER module. It uses a CP2102N USB-to-Serial chip for the serial interface:

ESP32S2Wrover.jpg

It has 4 Mbytes of SPI flash and 2 Mbytes of PSRAM.

ESP32-S2-Saola-1 WROOM

An alternative version of this board is available with a WROOM module which has 4 Mbytes of SPI flash but no PSRAM:

ESP32S2Wroom.jpg

In other respects it is identical to the ESP-S2-Saola-1 WROVER above.

NeoPixel

The ESP32-S2-Saola-1 boards have a NeoPixel connected to digital pin 18.

Analogue inputs

The ESP32-S2-Saola-1 boards have analogue inputs on pins 1 to 20.

Analogue outputs

You can generate an analogue output using PWM on any of the digital pins. The precision is 8 bits.

Serial

The ESP32-S2-Saola-1 boards have one serial port on pin numbers 44 (RX) and 43 (TX).

SPI

The ESP32-S2-Saola-1 boards have one SPI port on pin numbers 34 (SS), 35 (MOSI), 36 (SCK), and 37 (MISO).

I2C

The ESP32-S2-Saola-1 boards have one I2C port on pin numbers 8 (SDA) and 9 (SCL).

ESP32-S3-DevKitM-1

This is Espressif's official DevKit board for the ESP32-S3 based on the ESP32-S3-MINI-1 module [1]. It provides 8 Mbytes of flash, 512 KB SRAM, and no PSRAM. A variety of other S3 boards are also available with the options of 32 Mbytes of flash, and 2 Mbytes or 8 Mbytes of PSRAM.

The DevKit S3 boards have two USB connections: the one labelled UART uses a CP2102 USB-to-Serial chip for the serial interface, and the one labelled USB connects to the ESP32-S3's built-in USB CDC interface:

DevKitS3.jpg

NeoPixel

The ESP32-S3-DevKitM-1 has a NeoPixel connected to digital pin 48.

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-S3-DevKitM-1 has analogue inputs on pins 1 to 20.

Analogue outputs

You can generate an analogue output using PWM on any of the digital pins. The precision is 8 bits.

Serial

The ESP32-S3-DevKitM-1 has one serial port on pin numbers 44 (RX) and 43 (TX).

SPI

The ESP32-S3-DevKitM-1 has one SPI port on pin numbers 10 (SS), 11 (MOSI), 12 (SCK), and 13 (MISO).

I2C

The ESP32-S3-DevKitM-1 has one I2C port on pin numbers 8 (SDA) and 9 (SCL).


  1. ^ ESP-S3-DevKitM-1 on Adafruit.