FreeRTOS+TCP Integration
Overview
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.
When To Use
Use this skill when:
- The user wants FreeRTOS+TCP on an MCU.
- The issue involves network interface porting, DHCP, ARP, sockets, buffer descriptors, IP task, DNS, or TCP/UDP stalls.
- The project uses FreeRTOS tasks and FreeRTOS+TCP APIs instead of lwIP.
Do not use this skill for lwIP projects. Use lwip-integration instead.
First Questions
Ask for:
- MCU/SoC, PHY/module, MAC driver, FreeRTOS version, and FreeRTOS+TCP version.
- Network interface source and buffer allocation scheme.
- Static IP/DHCP config, MAC address, gateway, DNS, and hostname.
- IP task priority/stack, driver task/ISR model, and heap size.
- Current symptom and network logs/counters.
Integration Checklist
Prove link and MAC.
Confirm PHY link, MAC address, RX/TX interrupts, and descriptor rings.
Configure buffer management.
Choose and size network buffers intentionally; track leaks and ownership.
Verify IP task health.
IP task stack, priority, event queue, and timer behavior must be stable.
Test layers.
Link, ARP, ping, UDP, TCP connect, DNS, DHCP, and reconnect separately.
Check thread rules.
Use FreeRTOS+TCP APIs from valid task contexts and avoid unsafe ISR use.
Common Failures
- Network buffers leak after RX error paths.
- IP task stack is too small.
- MAC DMA cache maintenance is missing.
- DHCP fails because link state is not reported correctly.
- Socket timeouts are treated as fatal connection state.
Verification
Before claiming FreeRTOS+TCP works:
- State driver, buffer scheme, IP config, IP task priority/stack, and heap.
- Confirm link, IP address, ping, UDP/TCP test, and reconnect behavior.
- Report buffer usage/leak evidence if available.
- Confirm cache/DMA handling when relevant.
Example
User:
FreeRTOS+TCP DHCP 成功但 TCP 连接会卡死。
Agent:
- Asks for socket code, IP task stack, buffer scheme, driver logs, and heap stats.
- Checks buffer ownership and IP task health before protocol logic.
- Verifies UDP and TCP separately.
1---2name: freertos-plus-tcp-integration3description: Use when integrating, porting, configuring, or debugging FreeRTOS+TCP networking, network interface drivers, buffer management, DHCP, sockets, or embedded TCP/IP issues4---56# FreeRTOS+TCP Integration78## Overview910Use 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.1112## When To Use1314Use this skill when:1516- The user wants FreeRTOS+TCP on an MCU.17- The issue involves network interface porting, DHCP, ARP, sockets, buffer descriptors, IP task, DNS, or TCP/UDP stalls.18- The project uses FreeRTOS tasks and FreeRTOS+TCP APIs instead of lwIP.1920Do not use this skill for lwIP projects. Use `lwip-integration` instead.2122## First Questions2324Ask for:2526- MCU/SoC, PHY/module, MAC driver, FreeRTOS version, and FreeRTOS+TCP version.27- Network interface source and buffer allocation scheme.28- Static IP/DHCP config, MAC address, gateway, DNS, and hostname.29- IP task priority/stack, driver task/ISR model, and heap size.30- Current symptom and network logs/counters.3132## Integration Checklist33341. Prove link and MAC.35 Confirm PHY link, MAC address, RX/TX interrupts, and descriptor rings.36371. Configure buffer management.38 Choose and size network buffers intentionally; track leaks and ownership.39401. Verify IP task health.41 IP task stack, priority, event queue, and timer behavior must be stable.42431. Test layers.44 Link, ARP, ping, UDP, TCP connect, DNS, DHCP, and reconnect separately.45461. Check thread rules.47 Use FreeRTOS+TCP APIs from valid task contexts and avoid unsafe ISR use.4849## Common Failures5051- Network buffers leak after RX error paths.52- IP task stack is too small.53- MAC DMA cache maintenance is missing.54- DHCP fails because link state is not reported correctly.55- Socket timeouts are treated as fatal connection state.5657## Verification5859Before claiming FreeRTOS+TCP works:6061- State driver, buffer scheme, IP config, IP task priority/stack, and heap.62- Confirm link, IP address, ping, UDP/TCP test, and reconnect behavior.63- Report buffer usage/leak evidence if available.64- Confirm cache/DMA handling when relevant.6566## Example6768User:6970```text71FreeRTOS+TCP DHCP 成功但 TCP 连接会卡死。72```7374Agent:75761. Asks for socket code, IP task stack, buffer scheme, driver logs, and heap stats.771. Checks buffer ownership and IP task health before protocol logic.781. Verifies UDP and TCP separately.