$npx -y skills add easyzoom/aix-skills --skill freertos-plus-tcp-integrationUse when integrating, porting, configuring, or debugging FreeRTOS+TCP networking, network interface drivers, buffer management, DHCP, sockets, or embedded TCP/IP issues
| 1 | # FreeRTOS+TCP Integration |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Use this skill to integrate FreeRTOS+TCP by proving the network interface driver, buffer management, IP task, and socket behavior separately. Most failures come from driver callbacks, buffer ownership, or task priority/stack sizing. |
| 6 | |
| 7 | ## When To Use |
| 8 | |
| 9 | Use this skill when: |
| 10 | |
| 11 | - The user wants FreeRTOS+TCP on an MCU. |
| 12 | - The issue involves network interface porting, DHCP, ARP, sockets, buffer descriptors, IP task, DNS, or TCP/UDP stalls. |
| 13 | - The project uses FreeRTOS tasks and FreeRTOS+TCP APIs instead of lwIP. |
| 14 | |
| 15 | Do not use this skill for lwIP projects. Use `lwip-integration` instead. |
| 16 | |
| 17 | ## First Questions |
| 18 | |
| 19 | Ask for: |
| 20 | |
| 21 | - MCU/SoC, PHY/module, MAC driver, FreeRTOS version, and FreeRTOS+TCP version. |
| 22 | - Network interface source and buffer allocation scheme. |
| 23 | - Static IP/DHCP config, MAC address, gateway, DNS, and hostname. |
| 24 | - IP task priority/stack, driver task/ISR model, and heap size. |
| 25 | - Current symptom and network logs/counters. |
| 26 | |
| 27 | ## Integration Checklist |
| 28 | |
| 29 | 1. Prove link and MAC. |
| 30 | Confirm PHY link, MAC address, RX/TX interrupts, and descriptor rings. |
| 31 | |
| 32 | 1. Configure buffer management. |
| 33 | Choose and size network buffers intentionally; track leaks and ownership. |
| 34 | |
| 35 | 1. Verify IP task health. |
| 36 | IP task stack, priority, event queue, and timer behavior must be stable. |
| 37 | |
| 38 | 1. Test layers. |
| 39 | Link, ARP, ping, UDP, TCP connect, DNS, DHCP, and reconnect separately. |
| 40 | |
| 41 | 1. Check thread rules. |
| 42 | Use FreeRTOS+TCP APIs from valid task contexts and avoid unsafe ISR use. |
| 43 | |
| 44 | ## Common Failures |
| 45 | |
| 46 | - Network buffers leak after RX error paths. |
| 47 | - IP task stack is too small. |
| 48 | - MAC DMA cache maintenance is missing. |
| 49 | - DHCP fails because link state is not reported correctly. |
| 50 | - Socket timeouts are treated as fatal connection state. |
| 51 | |
| 52 | ## Verification |
| 53 | |
| 54 | Before claiming FreeRTOS+TCP works: |
| 55 | |
| 56 | - State driver, buffer scheme, IP config, IP task priority/stack, and heap. |
| 57 | - Confirm link, IP address, ping, UDP/TCP test, and reconnect behavior. |
| 58 | - Report buffer usage/leak evidence if available. |
| 59 | - Confirm cache/DMA handling when relevant. |
| 60 | |
| 61 | ## Example |
| 62 | |
| 63 | User: |
| 64 | |
| 65 | ```text |
| 66 | FreeRTOS+TCP DHCP 成功但 TCP 连接会卡死。 |
| 67 | ``` |
| 68 | |
| 69 | Agent: |
| 70 | |
| 71 | 1. Asks for socket code, IP task stack, buffer scheme, driver logs, and heap stats. |
| 72 | 1. Checks buffer ownership and IP task health before protocol logic. |
| 73 | 1. Verifies UDP and TCP separately. |