agentleFS
easyzoomeasyzoom/aix-skills/skills/mcuboot-integration/SKILL.md

mcuboot-integration

Skill36 starsChanged 5 months agoMITView on GitHub

Use when integrating, porting, configuring, or debugging MCUboot secure boot, image slots, swap modes, image signing, rollback, or bootloader upgrades on MCUs

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to integrate MCUboot by proving the boot chain, flash map, image format, signing flow, and upgrade policy.

    line 10
  2. Distinctive:

    Use this skill when:

    line 14
  3. Very specific:

    Do not use this skill for application-level firmware transfer alone.

    line 20
  4. Distinctive:

    Verify image header, TLVs, signature, version, and load address before enabling OTA.

    line 38
  5. Distinctive:

    Test pending, test, confirm, revert, and permanent upgrade paths for the selected mode.

    line 44
  6. Distinctive:

    Add recovery and brick protection.

    line 46
  7. Distinctive:

    Keep serial recovery, debug access, watchdog policy, and factory image strategy clear.

    line 47
  8. Distinctive:

    Before claiming MCUboot works:

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MCUboot Integration

Overview

Use this skill to integrate MCUboot by proving the boot chain, flash map, image format, signing flow, and upgrade policy. Most failures come from slot geometry, trailer layout, or signing metadata mismatches rather than the application itself.

When To Use

Use this skill when:

  • The user wants to add MCUboot to Zephyr, Mynewt, NuttX, RIOT, Mbed OS, ESP-IDF, or a custom MCU platform.
  • The issue involves image validation, swap, overwrite-only upgrade, rollback, confirm flags, serial recovery, or signed images.
  • The project has dual slots, external flash, encrypted images, secure boot, or OTA requirements.

Do not use this skill for application-level firmware transfer alone. Use ota-update-integration first if the bootloader is already fixed and the issue is delivery. For generic bootloader jump/handoff debugging, use bootloader-debug.

First Questions

Ask for:

  • MCU/SoC, SDK/RTOS, boot flow, and current bootloader ownership.
  • Flash layout: bootloader, primary slot, secondary slot, scratch, trailer, and external flash if used.
  • Upgrade mode: swap, overwrite-only, direct-XIP, RAM-load, or serial recovery.
  • Image signing method, key type, image version, and whether rollback prevention is needed.
  • Current symptom and boot log from the bootloader.

Integration Checklist

  1. Freeze the flash map. Slot sizes, erase block size, alignment, scratch size, and trailer offsets must match the target flash.
  2. Build a minimal signed image. Verify image header, TLVs, signature, version, and load address before enabling OTA.
  3. Prove first boot. Boot one known-good image from the primary slot and record bootloader logs.
  4. Prove upgrade behavior. Test pending, test, confirm, revert, and permanent upgrade paths for the selected mode.
  5. Add recovery and brick protection. Keep serial recovery, debug access, watchdog policy, and factory image strategy clear.
  6. Lock security policy last. Enable key protection, rollback counters, encryption, or anti-tamper only after the basic upgrade loop is repeatable.

Common Failures

  • Primary and secondary slots have different erase geometry or alignment.
  • Signed image was built with the wrong header size, load address, or key.
  • App never confirms the image, so MCUboot reverts on the next reset.
  • Scratch area is too small for the largest erase sector.
  • Bootloader and app disagree about vector table, stack pointer, or flash offset.
  • Rollback protection is enabled before versioning and counter storage are proven.

Verification

Before claiming MCUboot works:

  • State flash layout, image mode, key type, and signing command.
  • Confirm clean boot from primary slot.
  • Confirm upgrade, confirm, and revert behavior with boot logs.
  • Confirm recovery path and watchdog behavior during interrupted upgrade.

Example

User:

MCUboot 升级后总是回滚。

Agent:

  1. Asks for flash layout, swap mode, signing command, image version, and boot log.
  2. Checks whether the app calls image confirm after the self-test passes.
  3. Verifies trailer flags and interrupted-upgrade behavior before changing OTA logic.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.