refactor: 确定路径A架构(NO_SYS=0+netconn+多TCP任务),精确化任务设计与内存预算

- FreeRTOSConfig.h: 堆8->10KB, 优先级56->7, 添加lwIP sys_arch宏和任务优先级/栈大小定义
- lwipopts.h: LWIP_SOCKET=0节省RAM, LWIP_TCPIP_CORE_LOCKING=1, MEM_SIZE 8KB,
  PBUF_POOL 10, MEMP_NUM_NETCONN 8, TCP_SND_BUF/WND 8xMSS, 关闭DHCP/UDP,
  TCPIP_THREAD_STACKSIZE/PRIO明确指定
- 项目技术实现: 9+1任务架构, netconn阻塞模式每连接独立任务, 零拷贝route_msg_t,
  内存精确估算49KB(RCT6超1KB需优化或换RDT6), 模块重写/复用清单
- 项目需求说明: 明确netconn API路线, 添加RDT6备选, 更新任务列表9个任务
This commit is contained in:
2026-04-15 19:23:48 +08:00
parent dc277b040b
commit c81bd93205
4 changed files with 378 additions and 142 deletions
+38 -3
View File
@@ -59,13 +59,13 @@
#define configUSE_PREEMPTION 1
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES ( 56 )
#define configMAX_PRIORITIES ( 7 )
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
#define configTOTAL_HEAP_SIZE ((size_t)8192) /* Fit R8 RAM budget with dynamic tasks */
#define configTOTAL_HEAP_SIZE ((size_t)10240)
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
@@ -151,6 +151,41 @@ standard names. */
/* USER CODE BEGIN Defines */
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
/* lwIP sys_arch compatibility macros */
#define sys_arch_protect() vPortEnterCritical()
#define sys_arch_unprotect(x) vPortExitCritical()
#define sys_now() ((uint32_t)xTaskGetTickCount())
#define SYS_ARCH_DECL_PROTECT(lev) uint32_t lev
#define SYS_ARCH_PROTECT(lev) (lev) = vPortEnterCritical()
#define SYS_ARCH_UNPROTECT(lev) vPortExitCritical()
/* Application task priorities (higher number = higher priority) */
#define TASK_PRIORITY_TCPIP 6
#define TASK_PRIORITY_NET_POLL 5
#define TASK_PRIORITY_TCP_SERVER 4
#define TASK_PRIORITY_TCP_CLIENT 4
#define TASK_PRIORITY_UART_RX 4
#define TASK_PRIORITY_ROUTE 3
#define TASK_PRIORITY_CONFIG 2
#define TASK_PRIORITY_DEFAULT 1
/* Application task stack sizes (in words) */
#define TASK_STACK_TCPIP 512
#define TASK_STACK_NET_POLL 384
#define TASK_STACK_TCP_SERVER 384
#define TASK_STACK_TCP_CLIENT 256
#define TASK_STACK_UART_RX 384
#define TASK_STACK_ROUTE 512
#define TASK_STACK_CONFIG 256
#define TASK_STACK_DEFAULT 128
/* Route message pool for zero-copy inter-task communication */
#define ROUTE_MSG_POOL_SIZE 8
#define ROUTE_MSG_MAX_PAYLOAD 512
/* lwIP thread name for tcpip_thread */
#define TCPIP_THREAD_NAME "tcpip"
/* USER CODE END Defines */
#endif /* FREERTOS_CONFIG_H */