$npx -y skills add easyzoom/aix-skills --skill rt-thread-integrationUse when integrating, porting, configuring, or debugging RT-Thread, Env, Kconfig, FinSH, device framework, DFS, networking, packages, or board support
| 1 | # RT-Thread Integration |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Use this skill to debug RT-Thread by separating BSP configuration, kernel |
| 6 | objects, device framework registration, components, and packages. RT-Thread |
| 7 | problems often come from missing component config or device registration order. |
| 8 | |
| 9 | ## When To Use |
| 10 | |
| 11 | Use this skill when: |
| 12 | |
| 13 | - The user is working with RT-Thread, RT-Thread Studio, Env, SCons, BSPs, or |
| 14 | packages. |
| 15 | - The issue involves threads, semaphores, mailboxes, message queues, timers, |
| 16 | FinSH/MSH, device drivers, DFS, SAL, lwIP, or OTA components. |
| 17 | - A peripheral, filesystem, shell command, or network interface is present in |
| 18 | code but missing at runtime. |
| 19 | |
| 20 | Do not use this skill for a generic MCU peripheral with no RT-Thread component |
| 21 | surface. Use `embedded-peripheral-bringup` first. For generic RTOS scheduling |
| 22 | triage, use `rtos-debug`. |
| 23 | |
| 24 | ## First Questions |
| 25 | |
| 26 | Ask for: |
| 27 | |
| 28 | - RT-Thread version, BSP, board, toolchain, build system, and `rtconfig.h`. |
| 29 | - Enabled components/packages from menuconfig or RT-Thread Studio. |
| 30 | - Device name, driver registration path, init level, and FinSH output. |
| 31 | - Thread list, stack sizes, priorities, heap size, and console log. |
| 32 | - Current symptom and the command or API that fails. |
| 33 | |
| 34 | ## Integration Checklist |
| 35 | |
| 36 | 1. Reproduce the build configuration. |
| 37 | Capture BSP, toolchain, package versions, `rtconfig.h`, and generated files. |
| 38 | |
| 39 | 1. Prove console and shell. |
| 40 | Bring up UART console and FinSH/MSH before deeper component debugging. |
| 41 | |
| 42 | 1. Check kernel objects. |
| 43 | Inspect thread state, stack, priority, tick, heap, and IPC object ownership. |
| 44 | |
| 45 | 1. Prove device registration. |
| 46 | Confirm driver init level, device name, class, open flags, and `list_device`. |
| 47 | |
| 48 | 1. Add components one layer at a time. |
| 49 | For DFS, SAL, lwIP, USB, or OTA, verify the lower device and config first. |
| 50 | |
| 51 | 1. Validate package assumptions. |
| 52 | Check package versions, include paths, component symbols, and board hooks. |
| 53 | |
| 54 | ## Common Failures |
| 55 | |
| 56 | - `rtconfig.h` does not include the component the code expects. |
| 57 | - Device is registered under a different name than the application opens. |
| 58 | - Driver init runs before clocks, pins, DMA, or heap are ready. |
| 59 | - Thread stack is too small for shell, filesystem, or networking code. |
| 60 | - FinSH command exists but is compiled out by component config. |
| 61 | - Package code assumes a POSIX, DFS, or SAL layer that is not enabled. |
| 62 | |
| 63 | ## Verification |
| 64 | |
| 65 | Before claiming RT-Thread integration works: |
| 66 | |
| 67 | - State RT-Thread version, BSP, build command, and enabled components. |
| 68 | - Confirm console/shell output and relevant `list_*` command evidence. |
| 69 | - Confirm device registration and open/read/write or control behavior. |
| 70 | - Confirm stack and heap margins for the exercised path. |
| 71 | |
| 72 | ## Example |
| 73 | |
| 74 | User: |
| 75 | |
| 76 | ```text |
| 77 | RT-Thread 里 spi device 找不到。 |
| 78 | ``` |
| 79 | |
| 80 | Agent: |
| 81 | |
| 82 | 1. Checks BSP config, SPI component symbols, and board pin init. |
| 83 | 1. Uses shell device listing to confirm registration name and class. |
| 84 | 1. Fixes init order or device name before changing the application driver. |