Adafruit ESP32 C-series boards
These Adafruit boards are based on Espressif's ESP32-C3 and C6 modules which are based on a RISC-V single-core processor running at 160 MHz. They support Wi-Fi IEEE 802.11 at 2.4 GHz, and Bluetooth LE 5.
These boards have a USB-C connector, and use the ESP32-C series native CDC USB, avoiding the need for a UART chip. However, they don't offer a TinyUSB software USB alternative, so the USB interface cannot be used for the reliable upload of long Lisp programs to uLisp.
When uploading a program it is therefore necessary to use the workaround of a terminal that provides a Slow Paste option, such as CoolTerm or iTerm. For details see Pasting in long programs on the ESP32.
Note: The ESP32 C-series boards are supported by the ESP version of uLisp even though they use RISC-V processors.
Boards
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 Preferencesdialog 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:
Adafruit Feather ESP32-C6
Adafruit QT Py ESP32-C3
- Set USB CDC On Boot: to "Enabled".
- Set Upload Mode: to "Internal USB".
- Set Partition Scheme to Default 4MB with spiffs.
- Set PSRAM: to "Enabled" to use it (recommended), or "Disabled" to disable it.
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.
- Select the board's USB port from the Port menu.
- Upload uLisp to the board.
Uploading Lisp programs
To upload a program to uLisp:
- Select it, including the comment at the top of the program, and do Copy.
- Using a terminal that provides a Slow Paste option or an equivalent, such as CoolTerm or iTerm, select Slow Paste.
The comment disables echo, which can 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 on pin :pin-neopixel. The following program slowly displays the full range of colours on the LED using the rgbledwrite function:
; NeoPixel spectrum
(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 :pin-neopixel (fix (+ c 768)) (fix (+ c 256)) (fix (+ c 1280)))
(delay 50)))
(rgbledwrite :pin-neopixel 0 0 0)))
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; for example, the QT Py ESP32-C3 drops from 30 mA to 0.9 mA in sleep.
Adafruit QT Py ESP32-C3
The Adafruit QT Py ESP32-C3 [1] adopts the same compact format as their other QT Py boards:

It provides 4 MB of Flash memory and 400 KB of SRAM, but no PSRAM.
Analogue inputs
The QT Py ESP32-C3 has 5 analogue inputs, on pins 0, 1, and 3 to 5.
Serial
The QT Py ESP32-C3 has one serial port on pin numbers 20 (RX) and 21 (TX).
SPI
The QT Py ESP32-C3 has one SPI port on pin numbers 6 (SS), 8 (MISO), 7 (MOSI), and 10 (SCK).
I2C
The QT Py ESP32-C3 has one I2C port on pins 5 (SDA) and 6 (SCL).
Adafruit ESP32-C6 Feather
The Adafruit ESP32-C6 Feather [2] adopts the same format as Adafruit's other Feather boards, making it compatible with a number of their Featherwings:
It provides 4 MB flash and no PSRAM, and includes a JST connector for a Lipo battery, a Lipo charger to allow the battery to be charged from the USB port, and an I2C MAX17048 battery monitor chip. The board also has a QWIIC/STEMMA QT connector for connecting I2C modules.
LEDs
As with other Feather boards the ESP32-C6 Feather has a red LED connected to the digital pin 15 which you can flash with the following program:
(defun blink (&optional x) (pinmode :led-builtin t) (digitalwrite :led-builtin x)
(delay 1000) (blink (not x)))
Run it by typing:
(blink)
Exit by entering ~.
Analogue inputs
The ESP32-C6 Feather has 7 analogue inputs, on pins 0 to 6.
Serial
The ESP32-C6 Feather has one serial port on pin numbers 17 (RX) and 16 (TX).
SPI
The ESP32-C6 Feather has one SPI port on pin numbers 0 (SS), 23 (MISO), 22 (MOSI), and 21 (SCK).
I2C
The ESP32-C6 Feather has one I2C ports on pins 19 (SDA) and 18 (SCL).
- ^ Adafruit QT Py ESP32-S2 Board on Adafruit.
- ^ Adafruit ESP32-S2 Feather Board on Adafruit.
