8051-mcu-debug
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers,…
Use when integrating or debugging TensorFlow Lite Micro (LiteRT) on MCUs — op resolver, tensor arena sizing, AllocateTensors, Invoke, int8 quantization, and missing-op errors
Claude Code
$ npx -y skills add easyzoom/aix-skills --skill tflite-micro-integration --agent claude-code
Codex
$ npx skills add easyzoom/aix-skills --skill tflite-micro-integration -a codex -y
Cursor
$ npx skills add easyzoom/aix-skills --skill tflite-micro-integration -a cursor -y
Gemini CLI
$ npx skills add easyzoom/aix-skills --skill tflite-micro-integration -a gemini-cli -y
GitHub Copilot
$ npx skills add easyzoom/aix-skills --skill tflite-micro-integration -a github-copilot -y
OpenCode
$ npx skills add easyzoom/aix-skills --skill tflite-micro-integration -a opencode -y
Windsurf
$ npx skills add easyzoom/aix-skills --skill tflite-micro-integration -a windsurf -y
name: tflite-micro-integration description: Use when integrating or debugging TensorFlow Lite Micro (LiteRT) on MCUs — op resolver, tensor arena sizing, AllocateTensors, Invoke, int8 quantization, and missing-op errors
Use this skill to bring up TensorFlow Lite for Microcontrollers (TFLM / LiteRT for Microcontrollers) on an MCU: register exactly the ops the model uses, size the `tensor_arena` correctly, and quantize inputs so `Invoke()` returns valid output. Most failures are missing ops, an undersized arena, or unquantized input, not model logic. TFLM is Google's official microcontroller runtime and is integrated by several vendor toolchains — Espressif `esp-tflite-micro` (with ESP-NN kernels), NXP eIQ, and ST X-CUBE-AI, where TFLM is available as an optional runtime alongside ST's own proprietary Cube.AI runtime. Use `tinymaix-integration` instead when you want a lighter, dependency-free runtime.
Use this skill when:
Do not use this skill when the model is not yet converted and quantized to `.tflite`; run the TFLite converter and validate on the host first.
Ask for:
1. Convert and embed the model. Produce a quantized `.tflite`, then `xxd -i model.tflite > model.cc`. Reference it via `tflite::GetModel(g_model)` and check `model->version() != TFLITE_SCHEMA_VERSION`.
1. Register only the needed ops. Use `tflite::MicroMutableOpResolver<N>` where `N` matches the exact count of `AddConv2D()`, `AddDepthwiseConv2D()`, `AddFullyConnected()`, `AddReshape()`, `AddSoftmax()`, `AddQuantize()`, etc. `AllOpsResolver` (which registers all built-in ops) bloats flash; avoid it in production.
1. Allocate the tensor arena. Declare `alignas(16) uint8_t tensor_arena[kTensorArenaSize];`, construct `tflite::MicroInterpreter` with the model, resolver, `tensor_arena`, and `kTensorArenaSize`, then use `MicroPrintf` for logging.
1. Allocate tensors and check the code. Call `interpreter.AllocateTensors()` and confirm it returns `kTfLiteOk`. Grow `kTensorArenaSize` if it fails, then trim toward `interpreter.arena_used_bytes()`.
1. Quantize the input. Read `input->params.scale` and `input->params.zero_point`, compute `q = round(real / scale) + zero_point`, clamp to `[-128, 127]`, and write `input->data.int8[i]`.
1. Invoke and dequantize. Check `interpreter.Invoke() == kTfLiteOk`, then convert `output->data.int8[i]` back with `real = (q - zero_point) * scale`.
Before claiming TFLM inference works:
User:
TFLM 里 Invoke 报 "Didn't find op for builtin opcode 'DEPTHWISE_CONV_2D'"。
Agent:
1. Asks for the model op list (Netron/`flatc`) and the current `MicroMutableOpResolver<N>` registrations. 1. Adds `resolver.AddDepthwiseConv2D()` and bumps `N` to match the total `Add*` count. 1. Re-runs, confirms `AllocateTensors()` and `Invoke()` return `kTfLiteOk`, and checks a golden vector.
AIX Skills is a public collection of Agent Skills, templates, and references for building repeatable AI workflows.
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers,…
Use when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers,…
Use when integrating or debugging Li-ion charger/fuel gauge ICs (BQ24295, BQ27441, MAX17048) over I2C, covering charge start,…
Use when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications,…
Use when debugging embedded bootloaders, application jumps, vector table offsets, firmware upgrade flow, OTA state, image…
Use when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.