Skip to content

tflite: builds and runs on the ESP32-S31 - #687

Merged
bdbarnett merged 1 commit into
mainfrom
tflite-s31
Nov 25, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
tflite-s31

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

tflite now builds for the ESP32-S31 as well as the P4 and S3, so microWakeWord and other TensorFlow Lite Micro models run there. Nothing else in the module changes. esp-tflite-micro 1.3.7 resolves esp-nn 1.5.0, which gives the S31 the P4's RISC-V PIE kernels.

I checked it on a Waveshare ESP32-S31-Touch-LCD-4.3C built with --modules all,tflite,btclassic. import tflite works and the hey_jarvis microWakeWord model loads with a 19,728-byte arena. One predict() takes 3.8 ms (1.8 ms on a P4). Two spoken "Hey Jarvis" clips fed digitally into medialink.wakeword.MicroWakeWord both fire. Through the board's own microphones, with the clips played from a nearby speaker, the Wake word app caught all six plays.

tflite adds 436 KB to the image: 7,577,600 bytes against 7,141,120 for all,btclassic. That no longer fits beside the 9,088 KB filesystem the LCD-4.3C had, so building with tflite moves the filesystem to 8,896 KB. Copy your files off before you flash.

Not covered: the S31 Zero (only the LCD-4.3C was flashed), and a CI build of the S31 with tflite, since no workflow builds that combination.

The module now builds for the ESP32-S31 as well as the P4 and S3. The
component manager resolves esp-nn 1.5.0 for esp-tflite-micro 1.3.7, and
that esp-nn gives the S31 the P4's RISC-V PIE kernels, so nothing else
changes.

Checked on a Waveshare ESP32-S31-Touch-LCD-4.3C built with
--modules all,tflite,btclassic: import tflite works, the microWakeWord
hey_jarvis model loads (19,728-byte arena) and runs in 3.8 ms per predict(),
and medialink's MicroWakeWord fires on two spoken "Hey Jarvis" clips fed
digitally and on all six plays through the board's own microphones. tflite
adds 436 KB to the image (7,577,600 bytes against 7,141,120).
@bdbarnett
bdbarnett merged commit ead896e into main Nov 25, 2026
9 checks passed
@bdbarnett
bdbarnett deleted the tflite-s31 branch November 25, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant