M5Stack Tab5

The M5Stack Tab5 [1] is a tablet format board based on Espressif's ESP32-P4 chip which features a dual-core 400 MHz RISC-V processor (running at 360 MHz on this board), with 16 Mbytes of flash and 768 KB of on-chip SRAM. It also has 32 Mbytes of PSRAM.

It features a 5" colour TFT display with a resolution of 1280 x 720 and a touchscreen, and a SC2356 camera (not yet supported). It has a ESP32-C6 coprocessor to provide Wi-Fi capabilities, and a micro SD card, RTC, and IMU.

It can be powered by a standard NP-F550/750/950 Li-ion battery that will clip onto the back of the unit.

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

  • 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 (2 x 6.5 MB app/3.6 MB SPIFFS)"
PSRAM: "Enabled"

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

  • Download release 4.9 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 Tab5.

Using uLisp

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

You can also use uLisp via a serial terminal such as CoolTerm or iTerm, and these feature a slow Paste option to avoid buffer problems when uploading long Lisp programs. For more information see Using uLisp from a terminal.

General features

LittleFS and 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

You can ignore this, and it will subsequently work without error.

Analogue inputs

The Tab5 has 14 analogue inputs, on pins 16 to 23 and 49 to 54.

Serial

The Tab5 has one serial port on pin numbers 38 (RX) and 37 (TX).

SPI

The Tab5 has one SPI port on pin numbers 42 (SS), 39 (MISO), 44 (MOSI), and 43 (SCK).

I2C

The Tab5 has two I2C ports; an external port on pins 53 (SDA) and 54 (SCL), and an internal port on pins 31 (SDA) and 32 (SCL)

SD Card

The Tab5 has an SD card socket that can be used to read from and write to SD cards from uLisp. If the SD card interface is enabled the (save-image) command saves the workspace to the SD card.

To return a list of the files on an SD card give the command directory:

> (directory)
("ULISP.IMG" "Cards.gif" "JapanCat.gif")

For details of using SD cards see SD card interface.

If you don't want to use SD cards, upload the firmware with the following line commented out:

// #define sdcardsupport

The (save-image) command will then use the flash memory to save the workspace.

Graphics

The Tab5 supports the full range of Graphics extensions.

Touchscreen

The Tab5 includes a touchscreen that you can read with the touchscreen function. It returns with a list of the x and y coordinates of the touch, or nil if no touch is being registered. For example:

> (touchscreen)
(167 118)

For a simple application of the touchscreen see the Touchdraw graphics example.

Wi-Fi

The Tab5 supports Wi-Fi via the ESP32-C6 coprocessor. 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.


  1. ^ M5Stack Tab5 on M5Stack Shop.