Guides integration and debugging of TensorFlow Lite Micro on MCUs: op resolver setup, tensor arena sizing, AllocateTensors, Invoke, int8 quantization, and missing-op errors.
Ships in aix-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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:
tensorflow/tflite-micro and works with tflite::MicroInterpreter, tflite::MicroMutableOpResolver, AllocateTensors(), or Invoke().Didn't find op for builtin opcode 'CONV_2D', 'QUANTIZE', arena/AllocateTensors failures, or output that is all zeros or drifting..tflite model as a C array (xxd -i) and needs int8 scale/zero_point handling.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:
.tflite model, its op list (from Netron or flatc), and its input/output dtype (int8, uint8, or float32).kTensorArenaSize and whether AllocateTensors() returns kTfLiteOk.scale/zero_point and expected output; a known golden input/output pair.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.
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.
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.
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().
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].
Invoke and dequantize.
Check interpreter.Invoke() == kTfLiteOk, then convert output->data.int8[i] back with real = (q - zero_point) * scale.
Didn't find op for builtin opcode 'CONV_2D' / 'QUANTIZE': op missing from the resolver, or N in MicroMutableOpResolver<N> too small to hold all Add* calls.version 'N' plus "An older version of this builtin might be supported"): model exported by a newer converter than the runtime; rebuild tflite-micro or re-export.AllocateTensors() fails or returns non-kTfLiteOk because kTensorArenaSize is too small.scale/zero_point.AllocateTensors()/Invoke(): give the calling thread enough stack (typically several KB).tensor_arena (missing alignas(16)) causing allocation errors.Before claiming TFLM inference works:
kTensorArenaSize vs arena_used_bytes().AllocateTensors() and Invoke() both return kTfLiteOk.scale/zero_point.User:
TFLM 里 Invoke 报 "Didn't find op for builtin opcode 'DEPTHWISE_CONV_2D'"。
Agent:
flatc) and the current MicroMutableOpResolver<N> registrations.resolver.AddDepthwiseConv2D() and bumps N to match the total Add* count.AllocateTensors() and Invoke() return kTfLiteOk, and checks a golden vector.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tflm, tensorflow-lite-micro, mcu, embedded-ml, int8-quantization
/aix-skills:tflite-micro-integrationfrom aix-skills
npx claudepluginhub easyzoom/aix-skills --plugin aix-skills76 skills in this plugin
/8051-mcu-debugUse when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures/avem-integrationUse when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers, middleware, or application architecture/battery-charger-fuel-gauge-integrationUse when integrating or debugging Li-ion charger/fuel gauge ICs (BQ24295, BQ27441, MAX17048) over I2C, covering charge start, watchdog host mode, NTC/JEITA faults, and SOC jumpsOther plugins' skills for the same job