Skip to content
Nicola Sabaini

Projects

NucleoOS

An operating system for the M5Stack Cardputer: 512 KB of RAM, no PSRAM, and on top of it an offline AI assistant, a bilingual voice and a desktop-class shell served by the device.

Kind
System
Status
In development
SoC
ESP32-S3
RAM
512 KB, no PSRAM
Stack
C · ESP-IDF · WASM
ANIMA, the offline assistant of NucleoOS, open in the browser shell served by the Cardputer

The Cardputer fits in one hand and carries an ESP32-S3: 512 kilobytes of RAM, no PSRAM, and once the system has loaded there are about eighteen kilobytes of heap left. NucleoOS puts a real operating system on top of that, not a menu of tools, which is what usually runs on this hardware.

An app registry with declared capabilities, an event-sourced bus, pairing and auth, OTA with rollback, an i18n engine, notifications, a power manager.

The decision that makes the rest possible

There are two complete interfaces speaking one contract: the native firmware on the 240×135 screen, and a web shell served by the device that opens in any browser on the local network.

That is not duplication, it is a division of labour, and it is the single idea holding everything else up: heavy work goes to the browser, never to the 18 KB device heap. The file manager, the spreadsheet, the image editor, the IDE all run on the machine of whoever is looking. The device serves data and holds state.

Even screen capture follows the rule: GET /api/screen streams the physical panel out as a BMP, with no canvas and next to no heap.

One binary covers both the original Cardputer and the Cardputer ADV: the keymap and the audio codec are detected at boot, so you build once and flash either.

ANIMA, which does not make things up

ANIMA is the assistant, and it runs in two places at once.

On the firmware it is a natural-language engine written in C: a three-level retrieval cascade, neuro-symbolic reasoning, a knowledge graph, maths and units, learning and profile tiers. It is not a language model, and that is the point: it is grounded by construction and cannot assert a fact it does not hold. An LLM would not fit in 18 KB of heap, and even if it did, an assistant that invents things inside an operating system is worse than no assistant.

In the web shell it is the same assistant compiled to WebAssembly, running entirely inside the browser: offline, private, instant.

And it speaks. Speech synthesis is concatenative and bilingual: a finite vocabulary is pre-vocalised on a PC, and at runtime the right clips are pasted together. Natural voice, essentially zero RAM, no network. It reads the time to the minute, confirms launches, states status. For anything that should not be said out loud it replies that you can read it on screen.

When a real model is needed

For work ANIMA cannot do there are frontier models (Claude, Groq, Grok, Gemini), configurable together with automatic fallback. Two details matter:

  • Keys live on the device’s SD card and are never logged.
  • The browser talks to the provider, not the Cardputer: the microcontroller is not in the loop and does not have to hold a TLS session to the outside world while doing everything else.

There is also ANIMA Code, a sandboxed JavaScript runtime with an os.* API (os.fs, os.http, os.anima, os.notify): write a script, hit Run, drive the system.

And the rest

On-device transcription with a Vosk model in WebAssembly, Italian and English, with the screen off to save battery. Recording that can be streamed live to the web shell and transcribed on the big screen. An image editor with local generation through WebGPU. Native multiplayer over ESP-NOW, so no router needed: every game reboots into a clean heap, which on this machine is the only way to have enough memory.

The project is free for noncommercial use; commercial use requires a paid licence. It includes security-testing tools, intended for authorised testing, research and education.

How it turned out

All of this is told at length in 512 KILOBYTE, the book: how it started with a chip answering no Embedded PSRAM, what got thrown away along the way, and the rules that stayed.