控制台日志实现迁出HAL生成文件至App/log并新增设计说明;defaultTask任务体迁至App/task,freertos.c恢复纯CubeMX接线形态
This commit is contained in:
@@ -534,7 +534,7 @@ if (nand_ftl_format() == 0) {
|
||||
|
||||
### 10.1 台架实证增补(2026-09,CCM 扩容 + 存储套件排障沉淀)
|
||||
|
||||
7. **单写者规则** — 存储由 **defaultTask 独占**:挂载 / `f_mkfs` / 卷健康探针 / `net_cfg_load` / syslog 落盘 / 配置引擎全收敛于它。netTask / uiTask **不得**直接触碰配置引擎或 FatFS。启用存储测试套件(`TEST_SUITE_STORAGE`)时存储所有权整体移交 testTask,defaultTask 必须**完全跳过**存储 bring-up(`Src/freertos.c` 中 `#if !defined(TEST_SUITE_STORAGE)` 包裹)——否则后台文件写与测试的 `nand_ftl_deinit` 掉电模拟并发,互相踩坏 FTL/FatFs 状态(实测:mkfs 半途冻结 + BBT 被误写)。
|
||||
7. **单写者规则** — 存储由 **defaultTask 独占**:挂载 / `f_mkfs` / 卷健康探针 / `net_cfg_load` / syslog 落盘 / 配置引擎全收敛于它。netTask / uiTask **不得**直接触碰配置引擎或 FatFS。启用存储测试套件(`TEST_SUITE_STORAGE`)时存储所有权整体移交 testTask,defaultTask 必须**完全跳过**存储 bring-up(`App/task/default_task.c` 中 `#if !defined(TEST_SUITE_STORAGE)` 包裹,2026-09-25 自 `Src/freertos.c` 迁出)——否则后台文件写与测试的 `nand_ftl_deinit` 掉电模拟并发,互相踩坏 FTL/FatFs 状态(实测:mkfs 半途冻结 + BBT 被误写)。
|
||||
8. **内存布局与 DMA/CCM 约束** — FreeRTOS 堆(含全部任务栈)已迁至 **CCM `0x10000000`**(64KB,直连 M4 零等待),但 **DMA1/DMA2 物理不可达 CCM**。GD5F 驱动 `GD5F_DMA_THRESHOLD = 1024`:栈上的小缓冲(dhara meta 读 132B、`dhara_nand_is_free` 64B)一律走 **CPU 轮询**、绝不经 DMA;页级大块(2048)才走 DMA 且源/目的**全部是文件作用域静态缓冲**(落 SRAM)。新增任何 DMA 收发缓冲必须①文件作用域静态②大小≥阈值③确认落 SRAM。违反任一条 = 静默数据损坏(CCM 首轮扩容实验实证)。换料注意:克隆片可能缺 SRAM3(CCM),必须重测。
|
||||
9. **LVGL 绘制缓冲越界护栏** — LVGL 9.3.0 对 I1(1bpp) 整帧渲染会在其算出的 `stride*h`(160×160/8=3200) 之后**多写 1 个字节**,紧邻 `g_ui_draw_buf` 之后的 `.bss`(如 `ui_menu_view` 的 `s_frame_box`)指针最低字节被打成 `0xFF` → 野指针 → HardFault(`PC=lv_obj_get_scroll_y`)。`ui_port.c` 的 `g_ui_draw_buf` 已预留 `UI_DRAW_BUF_GUARD=32` 字节护栏吸收该越界写(逻辑尺寸仍按 `UI_FB_SIZE` 上报,渲染数学不变)。**勿删护栏、勿把缓冲缩到与邻接 `.bss` 紧邻**。Lib/LVGL 为第三方不改。
|
||||
10. **FatFs 严格 8.3 短名** — 详见 AGENTS。补充:含冒号 `:` 的名字被 FatFs 先解析为**盘符前缀** → `f_open` 返回 `FR_INVALID_DRIVE`(11) 而非 `FR_INVALID_NAME`(6);两者都属合法拒绝(测试用例须同时接受)。
|
||||
|
||||
+55
-7
@@ -9,11 +9,15 @@ digraph refgraph_full {
|
||||
"App/cfg_file.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/cfg_file_store.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/cfg_file_store_mcu.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/log/console_log.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/log/console_log.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/log/sys_log.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/log/sys_log_mcu.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/sys_events.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/adc_task.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/adc_task.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/default_task.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/default_task.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/net_task.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/net_task.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"App/task/rs485_task.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
@@ -135,6 +139,7 @@ digraph refgraph_full {
|
||||
"simulator/main.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"simulator/sim/cfg_file_store_sim.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"simulator/sim/net_socket_sim.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"simulator/sim/sim_latency_stub.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"simulator/sim/sim_port.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"simulator/sim/sim_port.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"simulator/sim/sim_syslog.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
@@ -144,6 +149,8 @@ digraph refgraph_full {
|
||||
"test/ch395f_test_task.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/gd5f_test.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/gd5f_test_task.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/net_latency_test.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/net_latency_test.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/net_test_task.c" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/net_test_task.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"test/sd2506_test.h" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
@@ -167,13 +174,23 @@ digraph refgraph_full {
|
||||
"App/app_main.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/cfg_file.c" -> "App/cfg_file.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/cfg_file.c" -> "App/cfg_file_store.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/cfg_file.c" -> "App/log/sys_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/cfg_file.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/cfg_file.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/cfg_file.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/cfg_file_store.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/cfg_file_store_mcu.c" -> "App/cfg_file_store.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/cfg_file_store_mcu.c" -> "Lib/FatFs/ff.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/cfg_file_store_mcu.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/cfg_file_store_mcu.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/log/console_log.c" -> "App/log/console_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/log/console_log.c" -> "App/sys_events.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/log/console_log.c" -> "Inc/usart.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/log/console_log.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/log/console_log.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/log/console_log.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/task.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/log/console_log.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/log/console_log.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/log/sys_log.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/log/sys_log_mcu.c" -> "App/log/sys_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/log/sys_log_mcu.c" -> "App/util/sys_clock.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -186,6 +203,19 @@ digraph refgraph_full {
|
||||
"App/task/adc_task.c" -> "Drivers/BSP/TPAFE5160/tpafe5160.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/adc_task.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/adc_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/task/default_task.c" -> "App/cfg_file.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "App/log/sys_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "App/sys_events.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "App/task/default_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "Drivers/BSP/GD5F2GQ5UE/nand_ftl.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "Drivers/BSP/NETCFG/net_cfg.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/default_task.c" -> "Lib/FatFs/ff.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/task/default_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/task/default_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/task/default_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/task.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/task/default_task.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/net_task.c" -> "App/log/sys_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/net_task.c" -> "App/sys_events.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/net_task.c" -> "App/task/net_task.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -210,6 +240,8 @@ digraph refgraph_full {
|
||||
"App/task/ui_task.c" -> "Drivers/BSP/UI/ui_standby.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/ui_task.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/ui_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"App/task/ui_task.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/ui_task.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/task/ui_task.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"App/time_sync.c" -> "App/sys_events.h" [color="#2563eb", penwidth=1.0];
|
||||
"App/time_sync.c" -> "App/time_sync.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -266,6 +298,8 @@ digraph refgraph_full {
|
||||
"Drivers/BSP/NET/net_socket.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Drivers/BSP/NET/net_socket.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Drivers/BSP/NET/net_socket.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/task.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Drivers/BSP/NET/net_socket.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/NET/net_socket.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/NET/net_socket.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/NET/net_socket.h" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/NET/net_socket.h" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
@@ -339,6 +373,8 @@ digraph refgraph_full {
|
||||
"Drivers/BSP/UI/ui_net_sink.c" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_net_sink.c" -> "Drivers/BSP/UI/ui_net_sink.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_net_sink.c" -> "Drivers/BSP/UI/ui_net_sink_backend.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_net_sink.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_net_sink.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_net_sink.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/UI/ui_net_sink.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/UI/ui_net_sink_backend.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
@@ -368,6 +404,7 @@ digraph refgraph_full {
|
||||
"Drivers/BSP/UI/ui_page_selftest.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/UI/ui_page_selftest.h" -> "Drivers/BSP/UI/ui_content_page.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_port.c" -> "Drivers/BSP/UI/ui_port.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_port.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/UI/ui_port.c" -> "Lib/lvgl/lvgl.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Drivers/BSP/UI/ui_port.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/UI/ui_port.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
@@ -378,6 +415,7 @@ digraph refgraph_full {
|
||||
"Drivers/BSP/UI/ui_standby.c" -> "Lib/lvgl/lvgl.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Drivers/BSP/UI/ui_standby.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/UI/ui_standby.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Drivers/BSP/dbg_log.h" -> "App/log/console_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/dbg_log.h" -> "App/util/sys_clock.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/dbg_log.h" -> "Drivers/BSP/dbg_cfg.h" [color="#2563eb", penwidth=1.0];
|
||||
"Drivers/BSP/dbg_log.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
@@ -401,25 +439,21 @@ digraph refgraph_full {
|
||||
"Inc/stm32f4xx_hal_conf.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Inc/usart.h" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/dma.c" -> "Inc/dma.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "App/cfg_file.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "App/log/sys_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "App/sys_events.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "App/task/default_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "App/task/net_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "App/time_sync.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Drivers/BSP/CH395F/ch395f.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Drivers/BSP/NET/lftpd/lftpd.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/freertos.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Drivers/BSP/NETCFG/net_cfg.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Inc/usart.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "Lib/FatFs/ff.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/freertos.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/freertos.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/freertos.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/task.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/freertos.c" -> "test/ch395f_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "test/ch395f_test_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/freertos.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"Src/gpio.c" -> "Inc/gpio.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/i2c.c" -> "Inc/i2c.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -447,9 +481,9 @@ digraph refgraph_full {
|
||||
"Src/stm32f4xx_hal_timebase_tim.c" -> "Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/stm32f4xx_it.c" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/stm32f4xx_it.c" -> "Inc/stm32f4xx_it.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/stm32f4xx_it.c" -> "Inc/usart.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/system_stm32f4xx.c" -> "Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h" [color="#94a3b8", penwidth=0.7];
|
||||
"Src/usart.c" -> "Inc/usart.h" [color="#2563eb", penwidth=1.0];
|
||||
"Src/usart.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"simulator/dbg_log.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"simulator/main.c" -> "App/cfg_file.h" [color="#2563eb", penwidth=1.0];
|
||||
"simulator/main.c" -> "App/cfg_file_store.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -466,6 +500,7 @@ digraph refgraph_full {
|
||||
"simulator/sim/cfg_file_store_sim.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"simulator/sim/net_socket_sim.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
|
||||
"simulator/sim/net_socket_sim.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"simulator/sim/sim_latency_stub.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"simulator/sim/sim_port.c" -> "Lib/lvgl/lvgl.h" [color="#94a3b8", penwidth=0.7];
|
||||
"simulator/sim/sim_port.c" -> "simulator/SDL2/SDL2-2.32.10/include/SDL.h" [color="#94a3b8", penwidth=0.7];
|
||||
"simulator/sim/sim_port.c" -> "simulator/sim/sim_port.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -486,6 +521,7 @@ digraph refgraph_full {
|
||||
"test/ch395f_test_task.c" -> "test/ch395f_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/ch395f_test_task.c" -> "test/ch395f_test_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/ch395f_test_task.c" -> "test/gd5f_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/ch395f_test_task.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/ch395f_test_task.c" -> "test/net_test_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/ch395f_test_task.c" -> "test/sd2506_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/ch395f_test_task.c" -> "test/storage_test.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -496,9 +532,19 @@ digraph refgraph_full {
|
||||
"test/gd5f_test_task.c" -> "Drivers/BSP/GD5F2GQ5UE/nand_ftl.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/gd5f_test_task.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/gd5f_test_task.c" -> "Lib/FatFs/ff.h" [color="#94a3b8", penwidth=0.7];
|
||||
"test/gd5f_test_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h" [color="#94a3b8", penwidth=0.7];
|
||||
"test/gd5f_test_task.c" -> "test/gd5f_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/gd5f_test_task.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/gd5f_test_task.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"test/net_latency_test.c" -> "Drivers/BSP/CH395F/ch395f.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "Inc/main.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "test/ch395f_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_latency_test.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"test/net_latency_test.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"test/net_test_task.c" -> "Drivers/BSP/NET/net_select.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_test_task.c" -> "Drivers/BSP/NET/net_socket.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_test_task.c" -> "Drivers/BSP/NET/net_types.h" [color="#2563eb", penwidth=1.0];
|
||||
@@ -506,6 +552,7 @@ digraph refgraph_full {
|
||||
"test/net_test_task.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
"test/net_test_task.c" -> "test/ch395f_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_test_task.c" -> "test/ch395f_test_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_test_task.c" -> "test/net_latency_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_test_task.c" -> "test/net_test_task.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/net_test_task.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"test/sd2506_test.h" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
@@ -523,6 +570,7 @@ digraph refgraph_full {
|
||||
"test/storage_test_task.c" -> "Lib/FatFs/diskio.h" [color="#94a3b8", penwidth=0.7];
|
||||
"test/storage_test_task.c" -> "Lib/FatFs/ff.h" [color="#94a3b8", penwidth=0.7];
|
||||
"test/storage_test_task.c" -> "test/storage_test.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/storage_test_task.c" -> "test/test_config.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/storage_test_task.c" -> "外部/系统头文件" [color="#f59e0b", penwidth=0.6, style=dashed];
|
||||
"test/test_config.c" -> "Drivers/BSP/dbg_log.h" [color="#2563eb", penwidth=1.0];
|
||||
"test/test_config.c" -> "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h" [color="#94a3b8", penwidth=0.7];
|
||||
|
||||
+362
-46
@@ -29,6 +29,14 @@
|
||||
"path": "App/cfg_file_store_mcu.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "App/log/console_log.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "App/log/console_log.h",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "App/log/sys_log.h",
|
||||
"class": "fp"
|
||||
@@ -49,6 +57,14 @@
|
||||
"path": "App/task/adc_task.h",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "App/task/default_task.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "App/task/default_task.h",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "App/task/net_task.c",
|
||||
"class": "fp"
|
||||
@@ -5461,6 +5477,10 @@
|
||||
"path": "simulator/sim/net_socket_sim.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "simulator/sim/sim_latency_stub.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "simulator/sim/sim_port.c",
|
||||
"class": "fp"
|
||||
@@ -5497,6 +5517,14 @@
|
||||
"path": "test/gd5f_test_task.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "test/net_latency_test.c",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "test/net_latency_test.h",
|
||||
"class": "fp"
|
||||
},
|
||||
{
|
||||
"path": "test/net_test_task.c",
|
||||
"class": "fp"
|
||||
@@ -5643,6 +5671,12 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "cfg_file_store.h"
|
||||
},
|
||||
{
|
||||
"from": "App/cfg_file.c",
|
||||
"to": "App/log/sys_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_log.h"
|
||||
},
|
||||
{
|
||||
"from": "App/cfg_file.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
@@ -5679,6 +5713,12 @@
|
||||
"kind": "fp-ext",
|
||||
"include": "string.h"
|
||||
},
|
||||
{
|
||||
"from": "App/cfg_file_store_mcu.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "FreeRTOS.h"
|
||||
},
|
||||
{
|
||||
"from": "App/cfg_file_store_mcu.c",
|
||||
"to": "App/cfg_file_store.h",
|
||||
@@ -5739,6 +5779,60 @@
|
||||
"kind": "fp-ext",
|
||||
"include": "stdint.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "App/log/console_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "console_log.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdio.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "Inc/usart.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "usart.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "FreeRTOS.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/task.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "task.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "cmsis_os.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.c",
|
||||
"to": "App/sys_events.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_events.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.h",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdio.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/console_log.h",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdint.h"
|
||||
},
|
||||
{
|
||||
"from": "App/log/sys_log.h",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -5817,6 +5911,84 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "App/task/default_task.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "default_task.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "cmsis_os.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "FreeRTOS.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/task.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "task.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Inc/main.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "main.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Lib/FatFs/ff.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "ff.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Drivers/BSP/GD5F2GQ5UE/nand_ftl.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "nand_ftl.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Drivers/BSP/NETCFG/net_cfg.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_cfg.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "App/cfg_file.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "cfg_file.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "App/log/sys_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_log.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "App/sys_events.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_events.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/default_task.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/net_task.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -5961,6 +6133,18 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_clock.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/ui_task.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/ui_task.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "App/task/ui_task.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
@@ -6069,6 +6253,12 @@
|
||||
"kind": "fp-ext",
|
||||
"include": "stddef.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/dbg_log.h",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdint.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/dbg_log.h",
|
||||
"to": "Drivers/BSP/dbg_cfg.h",
|
||||
@@ -6081,6 +6271,12 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_clock.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/dbg_log.h",
|
||||
"to": "App/log/console_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "console_log.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/CH395F/ch395f.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -6315,6 +6511,18 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "ch395f.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/NET/net_socket.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/NET/net_socket.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/NET/net_socket.c",
|
||||
"to": "Inc/main.h",
|
||||
@@ -6561,6 +6769,12 @@
|
||||
"kind": "tp-ext",
|
||||
"include": "stdarg.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/NET/lftpd/lftpd_log.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
"kind": "tp-tp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/NET/lftpd/lftpd_string.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -7053,6 +7267,18 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "ui_net_sink_backend.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/UI/ui_net_sink.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/UI/ui_net_sink.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/UI/ui_net_sink.h",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -7233,6 +7459,12 @@
|
||||
"kind": "fp-tp",
|
||||
"include": "lvgl.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/UI/ui_port.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "Drivers/BSP/UI/ui_port.h",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -8775,6 +9007,12 @@
|
||||
"kind": "tp-tp",
|
||||
"include": "diskio.h"
|
||||
},
|
||||
{
|
||||
"from": "Lib/FatFs/ff.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
"kind": "tp-tp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "Lib/FatFs/ff.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -38259,6 +38497,12 @@
|
||||
"kind": "fp-ext",
|
||||
"include": "stdio.h"
|
||||
},
|
||||
{
|
||||
"from": "simulator/sim/cfg_file_store_sim.c",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdlib.h"
|
||||
},
|
||||
{
|
||||
"from": "simulator/sim/cfg_file_store_sim.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -38307,6 +38551,12 @@
|
||||
"kind": "fp-ext",
|
||||
"include": "stdio.h"
|
||||
},
|
||||
{
|
||||
"from": "simulator/sim/sim_latency_stub.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "simulator/sim/sim_port.c",
|
||||
"to": "simulator/sim/sim_port.h",
|
||||
@@ -38415,6 +38665,12 @@
|
||||
"kind": "fp-tp",
|
||||
"include": "cmsis_os.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -38445,24 +38701,6 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "net_socket.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "Inc/usart.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "usart.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "Lib/FatFs/ff.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "ff.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "Drivers/BSP/GD5F2GQ5UE/gd5f2gq5ue.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "gd5f2gq5ue.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "Drivers/BSP/NET/lftpd/lftpd.h",
|
||||
@@ -38495,21 +38733,9 @@
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "App/log/sys_log.h",
|
||||
"to": "App/task/default_task.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "sys_log.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "Drivers/BSP/NETCFG/net_cfg.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_cfg.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/freertos.c",
|
||||
"to": "App/cfg_file.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "cfg_file.h"
|
||||
"include": "default_task.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/gpio.c",
|
||||
@@ -38673,6 +38899,12 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "stm32f4xx_it.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/stm32f4xx_it.c",
|
||||
"to": "Inc/usart.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "usart.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/system_stm32f4xx.c",
|
||||
"to": "Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h",
|
||||
@@ -38685,12 +38917,6 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "usart.h"
|
||||
},
|
||||
{
|
||||
"from": "Src/usart.c",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdio.h"
|
||||
},
|
||||
{
|
||||
"from": "test/ch395f_test.h",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -38721,6 +38947,12 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "net_test_task.h"
|
||||
},
|
||||
{
|
||||
"from": "test/ch395f_test_task.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "test/ch395f_test_task.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h",
|
||||
@@ -38799,6 +39031,12 @@
|
||||
"kind": "fp-ext",
|
||||
"include": "string.h"
|
||||
},
|
||||
{
|
||||
"from": "test/gd5f_test_task.c",
|
||||
"to": "Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h",
|
||||
"kind": "fp-tp",
|
||||
"include": "FreeRTOS.h"
|
||||
},
|
||||
{
|
||||
"from": "test/gd5f_test_task.c",
|
||||
"to": "test/test_config.h",
|
||||
@@ -38829,6 +39067,60 @@
|
||||
"kind": "fp-tp",
|
||||
"include": "ff.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "string.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "test/ch395f_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "ch395f_test.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "Drivers/BSP/CH395F/ch395f.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "ch395f.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "Drivers/BSP/NET/net_socket.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_socket.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "Inc/main.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "main.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_latency_test.h",
|
||||
"to": "外部/系统头文件",
|
||||
"kind": "fp-ext",
|
||||
"include": "stdint.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_test_task.c",
|
||||
"to": "外部/系统头文件",
|
||||
@@ -38871,6 +39163,12 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "net_test_task.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_test_task.c",
|
||||
"to": "test/net_latency_test.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "net_latency_test.h"
|
||||
},
|
||||
{
|
||||
"from": "test/net_test_task.c",
|
||||
"to": "Drivers/BSP/dbg_log.h",
|
||||
@@ -38967,6 +39265,12 @@
|
||||
"kind": "fp-fp",
|
||||
"include": "dbg_log.h"
|
||||
},
|
||||
{
|
||||
"from": "test/storage_test_task.c",
|
||||
"to": "test/test_config.h",
|
||||
"kind": "fp-fp",
|
||||
"include": "test_config.h"
|
||||
},
|
||||
{
|
||||
"from": "test/storage_test_task.c",
|
||||
"to": "test/storage_test.h",
|
||||
@@ -39085,6 +39389,13 @@
|
||||
"App/cfg_file_store_mcu.c": [
|
||||
"string.h"
|
||||
],
|
||||
"App/log/console_log.c": [
|
||||
"stdio.h"
|
||||
],
|
||||
"App/log/console_log.h": [
|
||||
"stdint.h",
|
||||
"stdio.h"
|
||||
],
|
||||
"App/log/sys_log.h": [
|
||||
"stddef.h",
|
||||
"stdint.h"
|
||||
@@ -39269,6 +39580,7 @@
|
||||
],
|
||||
"Drivers/BSP/dbg_log.h": [
|
||||
"stddef.h",
|
||||
"stdint.h",
|
||||
"stdio.h"
|
||||
],
|
||||
"Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h": [
|
||||
@@ -40481,9 +40793,6 @@
|
||||
"stdio.h",
|
||||
"string.h"
|
||||
],
|
||||
"Src/usart.c": [
|
||||
"stdio.h"
|
||||
],
|
||||
"simulator/SDL2/SDL2-2.32.10/include/SDL2/SDL_assert.h": [
|
||||
"signal.h"
|
||||
],
|
||||
@@ -40730,6 +41039,7 @@
|
||||
],
|
||||
"simulator/sim/cfg_file_store_sim.c": [
|
||||
"stdio.h",
|
||||
"stdlib.h",
|
||||
"string.h",
|
||||
"sys/stat.h"
|
||||
],
|
||||
@@ -40760,6 +41070,12 @@
|
||||
"test/gd5f_test_task.c": [
|
||||
"string.h"
|
||||
],
|
||||
"test/net_latency_test.c": [
|
||||
"string.h"
|
||||
],
|
||||
"test/net_latency_test.h": [
|
||||
"stdint.h"
|
||||
],
|
||||
"test/net_test_task.c": [
|
||||
"string.h"
|
||||
],
|
||||
@@ -40781,11 +41097,11 @@
|
||||
]
|
||||
},
|
||||
"stats": {
|
||||
"files_indexed": 1396,
|
||||
"includes_parsed": 5588,
|
||||
"resolved": 4539,
|
||||
"unresolved": 1049,
|
||||
"nodes_fp": 126,
|
||||
"files_indexed": 1403,
|
||||
"includes_parsed": 5634,
|
||||
"resolved": 4579,
|
||||
"unresolved": 1055,
|
||||
"nodes_fp": 133,
|
||||
"nodes_tp": 1256,
|
||||
"ext_names": 353
|
||||
},
|
||||
|
||||
+2199
-1911
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 287 KiB After Width: | Height: | Size: 304 KiB |
+33
-26
@@ -28,7 +28,7 @@ digraph refgraph_module {
|
||||
"test" [fillcolor="#dbeafe", color="#1d4ed8"];
|
||||
"其他(第三方)" [fillcolor="#f3f4f6", color="#9ca3af"];
|
||||
"外部/系统头文件" [shape=ellipse, fillcolor="#fef3c7", color="#d97706"];
|
||||
"App" -> "App/log" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App" -> "App/log" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App" -> "App/util" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"App" -> "BSP/GD5F2GQ5UE" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
@@ -37,32 +37,38 @@ digraph refgraph_module {
|
||||
"App" -> "BSP/SD2506" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App" -> "BSP/TPAFE5160" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App" -> "FatFs" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×7"];
|
||||
"App/log" -> "App" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "App/util" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "FatFs" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×2"];
|
||||
"App/task" -> "App" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App/task" -> "App/log" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"App/log" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/log" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×4"];
|
||||
"App/task" -> "App" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"App/task" -> "App/log" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App/task" -> "App/util" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"App/task" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×5"];
|
||||
"App/task" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "BSP/GD5F2GQ5UE" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "BSP/NET" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App/task" -> "BSP/NETCFG" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "BSP/NETCFG" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App/task" -> "BSP/RS485" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "BSP/TPAFE5160" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "BSP/UI" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"App/task" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"App/task" -> "test" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "FatFs" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×7"];
|
||||
"App/task" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/task" -> "test" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"App/task" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×2"];
|
||||
"App/util" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/util" -> "BSP/SD2506" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/util" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"App/util" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"App/util" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×4"];
|
||||
"BSP(公共)" -> "App/log" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"BSP(公共)" -> "App/util" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"BSP(公共)" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
"BSP/CH395F" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
@@ -77,6 +83,7 @@ digraph refgraph_module {
|
||||
"BSP/NET" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/NET" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×8"];
|
||||
"BSP/NET" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/NET" -> "test" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/NET" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×3"];
|
||||
"BSP/NETCFG" -> "App" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"BSP/NETCFG" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
@@ -87,14 +94,16 @@ digraph refgraph_module {
|
||||
"BSP/TPAFE5160" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"BSP/TPAFE5160" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/UI" -> "App/log" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/UI" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"BSP/UI" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×5"];
|
||||
"BSP/UI" -> "BSP/NET" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/UI" -> "BSP/NETCFG" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"BSP/UI" -> "LVGL" [color="#2563eb", penwidth=1.2, label="×9"];
|
||||
"BSP/UI" -> "test" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"BSP/UI" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×20"];
|
||||
"CMSIS" -> "HAL" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
"CMSIS" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×22"];
|
||||
"FatFs" -> "App/util" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
"FatFs" -> "BSP(公共)" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
"FatFs" -> "FreeRTOS" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
"FatFs" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×2"];
|
||||
"FreeRTOS" -> "CMSIS" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
@@ -109,27 +118,24 @@ digraph refgraph_module {
|
||||
"LVGL" -> "其他(第三方)" [color="#94a3b8", penwidth=0.7, label="×1"];
|
||||
"LVGL" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×204"];
|
||||
"SDL2" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×36"];
|
||||
"Src/Inc (CubeMX)" -> "App" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"Src/Inc (CubeMX)" -> "App/log" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "App/task" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "App" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"Src/Inc (CubeMX)" -> "App/task" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"Src/Inc (CubeMX)" -> "App/util" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/GD5F2GQ5UE" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/GD5F2GQ5UE" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/NET" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/NETCFG" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/RS485" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/SD2506" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "BSP/TPAFE5160" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "CMSIS" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "FatFs" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"Src/Inc (CubeMX)" -> "HAL" [color="#2563eb", penwidth=1.2, label="×14"];
|
||||
"Src/Inc (CubeMX)" -> "lftpd" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"Src/Inc (CubeMX)" -> "test" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"Src/Inc (CubeMX)" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×5"];
|
||||
"Src/Inc (CubeMX)" -> "test" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"Src/Inc (CubeMX)" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×4"];
|
||||
"dhara" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×5"];
|
||||
"lftpd" -> "BSP(公共)" [color="#94a3b8", penwidth=0.7, label="×3"];
|
||||
"lftpd" -> "BSP(公共)" [color="#94a3b8", penwidth=0.7, label="×4"];
|
||||
"lftpd" -> "BSP/NET" [color="#94a3b8", penwidth=0.7, label="×3"];
|
||||
"lftpd" -> "FatFs" [color="#94a3b8", penwidth=0.7, label="×2"];
|
||||
"lftpd" -> "FreeRTOS" [color="#94a3b8", penwidth=0.7, label="×2"];
|
||||
@@ -141,16 +147,17 @@ digraph refgraph_module {
|
||||
"simulator" -> "BSP/UI" [color="#2563eb", penwidth=1.2, label="×5"];
|
||||
"simulator" -> "LVGL" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"simulator" -> "SDL2" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"simulator" -> "test" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"simulator" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×6"];
|
||||
"test" -> "App" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"test" -> "App/task" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"test" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×6"];
|
||||
"test" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"test" -> "BSP(公共)" [color="#2563eb", penwidth=1.2, label="×7"];
|
||||
"test" -> "BSP/CH395F" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"test" -> "BSP/GD5F2GQ5UE" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"test" -> "BSP/NET" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"test" -> "BSP/NET" [color="#2563eb", penwidth=1.2, label="×5"];
|
||||
"test" -> "BSP/SD2506" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"test" -> "FatFs" [color="#2563eb", penwidth=1.2, label="×3"];
|
||||
"test" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×4"];
|
||||
"test" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×1"];
|
||||
"test" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×10"];
|
||||
"test" -> "FreeRTOS" [color="#2563eb", penwidth=1.2, label="×5"];
|
||||
"test" -> "Src/Inc (CubeMX)" [color="#2563eb", penwidth=1.2, label="×2"];
|
||||
"test" -> "外部/系统头文件" [color="#94a3b8", penwidth=0.7, label="×12"];
|
||||
}
|
||||
|
||||
+603
-554
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 97 KiB |
@@ -204,7 +204,7 @@ void vApplicationMallocFailedHook(void)
|
||||
|
||||
#### 0.2 运行时栈水位(已落地:`stack_probe_poll`,2026-09-21)
|
||||
|
||||
实现位置:`Src/freertos.c` 的 USER CODE 区(**不新增文件**,无 Keil/CMake 双端注册成本)。
|
||||
实现位置:`App/task/default_task.c` 的 `stack_probe_poll`(2026-09-21 落地于 `Src/freertos.c` USER CODE 区,2026-09-25 随 defaultTask 任务体整体迁出至 `App/task/` 并注册 Keil 工程 App 组)。
|
||||
数据源是本版 CMSIS/FreeRTOS **已有**的 API:`osThreadGetStackSpace()`(剩余字节,内部走
|
||||
`uxTaskGetStackHighWaterMark`,特征值法与 `configCHECK_FOR_STACK_OVERFLOW=2` 同源)。
|
||||
本版**没有** `osThreadGetStackSize` 实现,也**没有** `ulTaskGetStackDepth` /
|
||||
|
||||
@@ -0,0 +1,315 @@
|
||||
# 控制台单写者日志设计说明
|
||||
|
||||
> **版本**:v1.1(已实施)
|
||||
> **日期**:2026-09-25
|
||||
> **状态**:已实施并验证——`@build` 0 错误 0 警告、`@test` 硬件闭环 PASS(2026-09-25,见 §10);设计 2026-09-24 加固实施(当时位于 `Src/usart.c` USER CODE 区),2026-09-25 实现迁出至 `App/log/`(HAL 生成文件不含应用代码);同日写者任务体自 `Src/freertos.c` 迁至 `App/task/default_task.c`(与其余 5 任务文件同址归位)
|
||||
> **关联文档**:`项目架构总览.md` · `运行与自检记录设计说明.md`(姊妹模块:持久化日志,同一写者任务) · `测试说明/链路延迟测试说明.md`(D6 日志税 / S8 非阻塞日志,需求出处) · AGENTS.md「平台约束」
|
||||
|
||||
## 1. 背景:实测故障与根因
|
||||
|
||||
### 1.1 实测故障(2026-09-24,双证据)
|
||||
|
||||
| # | 症状 | 实测证据 | 后果 |
|
||||
|---|------|---------|------|
|
||||
| F1 | 日志行字符级交错 | 崩溃前两行日志逐字符交错:`"[2026-[2026-0909-24 15:2-24 15:27:37:39]…"` | @test 必检标记可能假性丢失、日志不可读 |
|
||||
| F2 | HardFault(脏指针直接进入 UART) | BFAR=0x10010000(恰为 CCM 末尾+1),PC 落在 `HAL_UART_Transmit` 的缓冲读取处 | 崩溃上报路径自身再崩;被破坏的字符串指针被 UART 逐字节读取 |
|
||||
|
||||
前兆:2026-09-22 链路延迟测试实测**开机连续丢行**(多任务并发 `printf` → 非重入 `fputc`/`HAL_UART_Transmit` 丢整行,~2s 自恢复;`链路延迟测试说明.md` §9.2)——同类竞态的温和形态,当时列为 S8 待办(日志非阻塞化)。
|
||||
|
||||
### 1.2 根因分析(旧路径:`DBG_*` → `printf` → `fputc`)
|
||||
|
||||
| # | 根因 | 机理 | 对应故障 |
|
||||
|---|------|------|---------|
|
||||
| C1 | 逐字符发送 | `fputc` 每字符一次 `HAL_UART_Transmit(1 字节)`;两次调用之间可发生任务切换 | F1 交错 |
|
||||
| C2 | 调用方缓冲直达 UART | `HAL_UART_Transmit` 的缓冲指针是调用方(可能已被破坏)的指针 | F2 HardFault |
|
||||
| C3 | 多任务并发直触 UART | 轮询 Transmit 的并发保护是 `gState` 状态标志(§3.4):竞争失败方**立即**返回 `HAL_BUSY`(不等待、不重试),返回值被忽略 → 静默丢数据 | 09-22 丢行 |
|
||||
|
||||
HAL 并发语义(本仓库实现实测,`stm32f4xx_hal_uart.c:1135`):轮询版 `HAL_UART_Transmit` **不加** `__HAL_LOCK`(`huart->Lock` 标志仅 IT/DMA 路径使用,`stm32f4xx_hal_def.h:93`);入函数检查 `gState==READY`,全程保持 `BUSY_TX` 直到发完 —— **单次调用是原子的,但调用之间没有排队机制**:并发调用方立即拿到 `HAL_BUSY`。逐字符路径下(C1)"单次调用 = 单字节",原子性退化为字节级(→ F1);整行路径下竞争失败方整行丢失(→ C3)。
|
||||
|
||||
## 2. 设计目标与约束
|
||||
|
||||
### 2.1 目标
|
||||
|
||||
| # | 目标 | 达成方式 |
|
||||
|---|------|---------|
|
||||
| G1 | 行级原子:不同行不再逐字符交错 | 整行一次性入环形缓冲;唯一写者发出(UART 全局只有一个发送调用点) |
|
||||
| G2 | 指针可控:进入 `HAL_UART_Transmit` 的缓冲恒受本模块控制 | 调用方指针只经拷贝入环、到不了 UART;写者发出的缓冲恒为环形缓冲或模块本地静态缓冲 |
|
||||
| G3 | 不新增任务、不用 C 库堆、不新增内核对象 | 复用既有 defaultTask 作写者;环形缓冲 = 4KB 静态 BSS;复用 `sys_evt` 事件标志位 |
|
||||
| G4 | 内核启动前 / 写者未注册 / ISR / 异常钩子路径不降级 | 回退:有界直发(`dbg_console_write_raw`,≤256B 截断、不等待、不死锁、零内核对象) |
|
||||
| G5 | 缓冲满丢行必须可观测 | 丢弃计数 + 写者刷出 `[ERR] CONSOLE dropped N lines` —— 含 `[ERR]` 模式,`@test` Forbidden 判 FAIL,丢失永不静默 |
|
||||
|
||||
### 2.2 约束
|
||||
|
||||
| # | 约束 | 出处 |
|
||||
|---|------|------|
|
||||
| K1 | 内核启动前禁止创建/使用任何 FreeRTOS/CMSIS-RTOS 对象 | AGENTS.md 平台约束(2026-09-20 启动失败实证根因)→ 本模块内核前纯 BSS/寄存器机制 |
|
||||
| K2 | 禁止 `malloc/calloc/realloc`(C 堆仅 512B) | AGENTS.md P0-1 → 全部状态静态 BSS |
|
||||
| K3 | HAL 生成文件(`Src/`、`Inc/`)不含应用代码 | 2026-09-25 迁移动机 → 实现位于 `App/log/` |
|
||||
| K4 | 生产者阻塞时间有界 | 最多 `DBG_CON_WAIT_MS`(200ms),日志不得阻塞业务 |
|
||||
| K5 | RAM 预算紧张,新增静态内存必须核算 | §8 |
|
||||
|
||||
## 3. 总体架构
|
||||
|
||||
### 3.1 单写者模型
|
||||
|
||||
| 角色 | 实体 | 职责 |
|
||||
|------|------|------|
|
||||
| 生产者 | 全部任务 + 内核前主线程 + ISR | 调用点格式化整行(库 `snprintf`)→ `dbg_console_write_line()` |
|
||||
| 写者 | **defaultTask(唯一)** | 进主循环前 `dbg_console_writer_attach()` 注册为唯一发送者;循环内周期 `dbg_console_drain()` |
|
||||
| 物理通道 | USART1(PA9 TX / PA10 RX,115200,8N1) | 轮询发送(`HAL_UART_Transmit`);CubeMX 配置的 DMA TX(DMA2_Stream7)未使用 |
|
||||
| 唤醒 | `SYS_EVT_CONSOLE_TX`(`sys_evt` bit 6) | **消费型命令位**(`osFlagsWaitAny` 默认消费,与 AGENTS.md 事件位语义一致;区别于就绪位必须 `osFlagsNoClear`) |
|
||||
|
||||
**与其他日志子系统的关系**(同一"单写者纪律",同一属主任务):
|
||||
|
||||
| 子系统 | 通道 | 写者 | 持久化 |
|
||||
|--------|------|------|--------|
|
||||
| 控制台单写者(本文档) | USART1 串口 | defaultTask | 无(易失,复位丢失)——实时调试流 |
|
||||
| sys_log 运行/自检记录 | FatFS `/log/*.log` | defaultTask(同一任务) | 是(定长 64B 记录,`运行与自检记录设计说明.md`) |
|
||||
| 配置引擎 | FatFS `/config.ini` | defaultTask(同一任务) | 是 |
|
||||
|
||||
defaultTask 主循环按序处理:控制台排空 → 配置保存执行 → 2s 配置轮询 → LED 心跳 → syslog 落盘 → 栈水位观测——同一任务串行化三类 I/O,任务间零竞争。
|
||||
|
||||
### 3.2 文件清单
|
||||
|
||||
| 文件 | 端 | 角色 |
|
||||
|------|-----|------|
|
||||
| `App/log/console_log.h` | MCU | API 声明:5 个控制台函数 + `fputc` retarget + `DBG_CON_LINE_MAX` |
|
||||
| `App/log/console_log.c` | MCU | 实现:环形缓冲 / 生产者 / 写者 / 裸发 / `fputc` |
|
||||
| `Drivers/BSP/dbg_log.h` | 共享 | `#include "console_log.h"`;`DBG_PRINT` 宏绑定 `dbg_console_write_line`(整行一次入环) |
|
||||
| `simulator/dbg_log.h` | 模拟器 | `printf` stub——模拟器不编译本模块(宿主 `printf` 天然串行,无需单写者) |
|
||||
| `App/task/default_task.c` | MCU | 写者任务体:`dbg_console_writer_attach()` 注册 + 主循环 `dbg_console_drain()`;含存储 bring-up / 配置引擎 / syslog 落盘 / LED / 栈水位(2026-09-25 自 `Src/freertos.c` 迁出) |
|
||||
| `Src/freertos.c` | MCU | CubeMX 接线:6 任务创建 + netMsgQueue + sys_evt;栈溢出/堆失败钩子裸发(任务名先范围校验再拷入本地缓冲) |
|
||||
| `Src/usart.c` | MCU | 纯 CubeMX 生成(UART 初始化 / MspInit / 句柄声明)——零应用代码 |
|
||||
|
||||
### 3.3 拓扑
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph P["生产者(任意上下文)"]
|
||||
P1["netTask / ftpTask / uiTask / timeSync / testTask"]
|
||||
P2["内核前主线程<br/>(MX init / app_main_init)"]
|
||||
P3["ISR / 异常钩子"]
|
||||
end
|
||||
R["环形缓冲 4KB<br/>BSS(SRAM1)<br/>head/tail 16 位回绕"]
|
||||
E["sys_evt bit6<br/>SYS_EVT_CONSOLE_TX"]
|
||||
W["写者 = defaultTask<br/>dbg_console_drain()"]
|
||||
U["USART1 115200<br/>(PA9/PA10, 轮询)"]
|
||||
|
||||
P1 -- "dbg_console_write_line(整行 ≤192B)" --> R
|
||||
R --> E --> W
|
||||
W -- "HAL_UART_Transmit(块 ≤256B)" --> U
|
||||
P2 -- "写者未注册:整行直发" --> U
|
||||
P3 -- "有界直发 ≤256B" --> U
|
||||
```
|
||||
|
||||
### 3.4 HAL 并发语义与本设计的配合(实现实测)
|
||||
|
||||
轮询 `HAL_UART_Transmit`(`stm32f4xx_hal_uart.c:1135`):`gState READY → BUSY_TX(全程)→ READY`;并发调用见非 READY **立即**返回 `HAL_BUSY`(不排队)。本设计的三个运行区间:
|
||||
|
||||
| 区间 | 发送者构成 | 并发行为 |
|
||||
|------|-----------|---------|
|
||||
| 内核启动前 | 仅主线程(单线程) | 无并发,直发安全 |
|
||||
| 写者未注册(内核启动 → defaultTask attach,时长取决于存储 bring-up,通常秒级) | 多任务直发 | 竞争失败方立即 `HAL_BUSY` → **整行丢失(未计数、未告警)**;`gState` 检查跨整行保持 → **只丢不交错** |
|
||||
| 写者已注册(稳态) | 任务上下文唯一调用者 = 写者 | 任务上下文零竞争;残余窗口 = ISR 直发撞写者发送中(立即返回、丢失、不挂死,§7) |
|
||||
|
||||
## 4. 详细设计
|
||||
|
||||
### 4.1 环形缓冲
|
||||
|
||||
| 参数 | 值 | 理由 |
|
||||
|------|-----|------|
|
||||
| 容量 `DBG_CON_RING_SIZE` | 4096B | 2 的幂 → `&(SIZE-1)` 回绕免除法;≈21 整行(192B/行)余量 |
|
||||
| head/tail | `uint16` + `volatile`,单生产者/单写者 | head = 生产者写位置,tail = 写者读位置 |
|
||||
| 已用字节 | `(head - tail) & (SIZE-1)` | 无符号差自然回绕,免锁可读 |
|
||||
| 单行可接收上限 | `SIZE/2 = 2048B` | 保证"一行恒可入环";正常路径受 `DBG_CON_LINE_MAX=192B` 约束,不触发 |
|
||||
| 位置 | BSS(SRAM1,非 CCM) | CCM = FreeRTOS 堆,放 BSS 不占堆;轮询发送不依赖 DMA 可达性(CCM 的 DMA 不可达约束不适用) |
|
||||
|
||||
### 4.2 生产者路径(`con_append`)
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["dbg_console_write_line / fputc"] --> B{"写者已注册?<br/>(writer_up)"}
|
||||
B -- "否(内核前 / 未 attach)" --> R["write_raw 整行直发<br/>(≤256B 截断, 不等待)"]
|
||||
B -- 是 --> C{"中断/异常上下文?<br/>(__get_IPSR() ≠ 0)"}
|
||||
C -- 是 --> R
|
||||
C -- 否 --> D{"当前任务 == 写者?"}
|
||||
D -- 是 --> E["先 dbg_console_drain()<br/>(腾空环形缓冲, 避免自等)"]
|
||||
D -- 否 --> F{"环内空间 ≥ 行长?"}
|
||||
E --> F
|
||||
F -- 是 --> G["临界区:整行拷贝<br/>(head→环尾 + 回绕两段) + 推进 head"]
|
||||
F -- 否 --> H["vTaskDelay(1) 等待<br/>最多 200ms (200 tick)"]
|
||||
H -- 出现空间 --> G
|
||||
H -- 超时 --> I["丢弃:s_con_drop++<br/>(写者随后刷 [ERR] CONSOLE dropped N lines)"]
|
||||
G --> J["osEventFlagsSet(SYS_EVT_CONSOLE_TX)<br/>唤醒写者(句柄 NULL 保护)"]
|
||||
```
|
||||
|
||||
关键机制:
|
||||
|
||||
- **整行原子入环**:拷贝与 head 推进在同一次 `taskENTER_CRITICAL` 内完成 → 写者永不见"半行";临界区时长有界(≤192B 拷贝,微秒级)。
|
||||
- **自等待规避**:写者自身记录日志时先 `drain` 腾空(否则"等写者腾出的空间"会等自己,死锁);腾空后入环必立即成功。
|
||||
- **丢弃可观测**:丢弃累计 `s_con_drop`,写者每次 drain 后把累计值刷成 `[ERR]` 行(§4.3)——`[ERR]` 触发 `@test` Forbidden 判定,丢行永不静默。
|
||||
- **唤醒**:入环后置 `SYS_EVT_CONSOLE_TX` 命令位 → 写者立即被唤醒(零时延);写者循环另有 50ms 超时兜底(事件位异常也不滞留日志)。
|
||||
|
||||
### 4.3 写者路径(`attach` / `drain`)
|
||||
|
||||
```c
|
||||
/* 注册(defaultTask 进主循环前一次,App/task/default_task.c) */
|
||||
dbg_console_writer_attach(); /* 记录任务句柄 + writer_up=1 */
|
||||
|
||||
/* 写者主循环(事件唤醒 / 50ms 兜底) */
|
||||
osEventFlagsWait(sys_evtHandle, SYS_EVT_CFG_SAVE | SYS_EVT_CONSOLE_TX,
|
||||
osFlagsWaitAny, 50u);
|
||||
dbg_console_drain();
|
||||
```
|
||||
|
||||
`drain` 算法(仅写者任务调用):
|
||||
|
||||
1. 循环 `while (used != 0)`:取连续段 `tail → 环尾`,截断至 `DBG_CON_CHUNK_MAX`(256B) → `HAL_UART_Transmit(&huart1, &s_con_ring[tail], n, 0xFFFFu)` → **临界区内推进 `tail`**(交给 UART 的缓冲指针恒为环形缓冲——G2);
|
||||
2. 刷丢弃计数:`s_con_drop != 0` → 组帧 `"\r\n[ERR] CONSOLE dropped N lines\r\n"` → **`write_raw` 直发**(不经环:写者自身输出若走环会 `con_append` → `drain` 重入当前 `drain`,无限递归)。
|
||||
|
||||
稳态时序:
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant P as 生产者任务(netTask 等)
|
||||
participant R as 环形缓冲 4KB(BSS)
|
||||
participant E as sys_evt 事件标志
|
||||
participant W as 写者 defaultTask
|
||||
participant U as USART1(115200)
|
||||
|
||||
P->>R: dbg_console_write_line(整行 ≤192B)
|
||||
Note over P,R: 临界区:整行拷贝 + 推进 head
|
||||
P->>E: osEventFlagsSet(SYS_EVT_CONSOLE_TX)
|
||||
E-->>W: 唤醒(50ms 超时兜底)
|
||||
loop 直到 used == 0
|
||||
W->>R: dbg_console_drain():取连续段 ≤256B
|
||||
W->>U: HAL_UART_Transmit(块)
|
||||
Note over W,R: 临界区:推进 tail
|
||||
end
|
||||
opt s_con_drop != 0
|
||||
W->>U: "[ERR] CONSOLE dropped N lines"(直发)
|
||||
end
|
||||
```
|
||||
|
||||
### 4.4 裸发(`dbg_console_write_raw`)
|
||||
|
||||
- 有界:`len > 256 → 256`(截尾);单次阻塞 `HAL_UART_Transmit`(超时 `0xFFFF`),不持临界区、不等待状态;
|
||||
- 适用:内核前 / 未注册期、ISR、异常钩子(栈溢出 / 堆失败)、崩溃上报;
|
||||
- 调用方纪律:**只交已知合法的缓冲**——钩子侧先做指针范围校验(Flash / SRAM / CCM 窗口)并拷入本地缓冲再发,TCB 指针不接触 UART(`Src/freertos.c vApplicationStackOverflowHook`,2026-09-24 加固;指针不可信时发占位文本,"上报崩溃的代码不能再崩一次")。
|
||||
|
||||
### 4.5 `fputc` 重定向(MicroLIB `printf`)
|
||||
|
||||
`fputc(ch, f)` → `con_append(&b, 1)`:库内部 / 遗留 `printf` 调用同样收敛到单写者路径(注册期逐字节入环;一条完整 `printf` 行 = 环内连续字节,写者按块发出 → 仍行级原子)。
|
||||
|
||||
**`printf` 是遗留路径**:逐字节 = 一次临界区 + 一次事件置位;新代码一律用 `DBG_*` 宏(调用点格式化整行、一次入环、一次事件)。两路行为一致,仅效率差异。
|
||||
|
||||
### 4.6 时间参数(实测 / 推导)
|
||||
|
||||
| 参数 | 值 | 推导 |
|
||||
|------|-----|------|
|
||||
| 字节率 @115200 8N1 | 86.8 µs/B(10 bit/字节) | 115200 / 10 |
|
||||
| 单块 256B | ≈22 ms | 写者单次 `HAL_UART_Transmit` 上限 |
|
||||
| 单行 192B(最坏) | ≈17 ms | `DBG_CON_LINE_MAX` |
|
||||
| 生产者最长等待 | 200 ms(200 × 1ms tick) | ≈9 个发送块的时间,稳态下环恒被及时排空 |
|
||||
| 写者兜底周期 | 50 ms | 事件位失效时日志滞留上限 |
|
||||
| 实测日志时延 | 事件唤醒级(无丢失) | 2026-09-25 @test:67 行开机日志完整、无交错、无丢行告警 |
|
||||
|
||||
## 5. API 参考
|
||||
|
||||
全部声明位于 `App/log/console_log.h`(仅 MCU 端;模拟器无对应实现,共享代码勿调用):
|
||||
|
||||
| 函数 | 签名 | 调用上下文 | 语义 | 备注 |
|
||||
|------|------|-----------|------|------|
|
||||
| `dbg_console_write_line` | `int (const char *line, unsigned len)` | 生产者(任务上下文) | 整行入环 / 直发;0 = 写入字节数,-1 = 参数非法 / 被丢弃 | 截断 ≤192B(保行首时间戳/标记信息) |
|
||||
| `dbg_console_write_raw` | `void (const char *buf, unsigned len)` | **任意**(ISR / 钩子 / 内核前) | 有界直发 ≤256B,不等待、不加锁 | 缓冲须已知合法 |
|
||||
| `dbg_console_writer_attach` | `void (void)` | 写者任务、主循环前 | 注册唯一写者 | 仅一次(defaultTask) |
|
||||
| `dbg_console_drain` | `void (void)` | **仅写者任务** | 排空环并发出 + 刷丢弃计数 | defaultTask 主循环周期调用 |
|
||||
| `dbg_console_dropped` | `uint32_t (void)` | 任意 | 诊断:累计丢弃行数 | 外部读取 |
|
||||
| `fputc` | `int (int ch, FILE *f)` | `printf` 调用点 | MicroLIB retarget 钩子 → 逐字节 `con_append` | 须为全局符号(C 库链接) |
|
||||
|
||||
## 6. 常量
|
||||
|
||||
| 常量 | 值 | 定义处 | 含义 |
|
||||
|------|-----|--------|------|
|
||||
| `DBG_CON_LINE_MAX` | 192 | `console_log.h` | 单行文本上限(含结尾 `'\0'`);`DBG_PRINT` 宏行缓冲尺寸;超限截断 |
|
||||
| `DBG_CON_RING_SIZE` | 4096 | `console_log.c` | 环形缓冲字节数(必须为 2 的幂) |
|
||||
| `DBG_CON_CHUNK_MAX` | 256 | `console_log.c` | 写者单次发送上限 = 裸发上限 |
|
||||
| `DBG_CON_WAIT_MS` | 200 | `console_log.c` | 缓冲满时生产者最长等待(1ms/轮,仍满 → 丢弃 + 计数) |
|
||||
| 写者循环超时 | 50 ms | `App/task/default_task.c` | `osEventFlagsWait` 兜底周期 |
|
||||
|
||||
## 7. 失效模式与可观测性
|
||||
|
||||
| 失效 | 行为 | 可观测性 | 残余风险 |
|
||||
|------|------|---------|---------|
|
||||
| 缓冲满(日志突发 / 写者卡滞) | 生产者等 200ms 后丢行 | `s_con_drop` 累计 → 写者刷 `[ERR] CONSOLE dropped N lines`(@test FAIL,永不静默) | — |
|
||||
| 写者未注册(内核前) | 单线程直发 | — | 无(无并发) |
|
||||
| 未注册期多任务并发直发 | 竞争失败方立即 `HAL_BUSY` → 整行丢失 | **未计数、未告警**(已知折中,§3.4 / §9-D5) | 启动窗口(秒级);2026-09-25 实测未发生 |
|
||||
| ISR 直发撞写者发送中 | 立即 `HAL_BUSY` 返回 → 丢失,不挂死 | 未计数 | ISR 日志频率极低,best-effort 语义 |
|
||||
| 内核状态损坏(栈溢出 / 堆耗尽) | 钩子裸发固定文本 → 复位(栈溢出)/ 仅告警(堆) | `[ERR] STACK OVERFLOW task=…` / `[ERR] MALLOC FAILED …`;任务名范围校验 + 本地拷贝,TCB 指针不入 UART | — |
|
||||
| 调用方指针损坏(脏指针) | 无法进入 UART(缓冲恒为环 / 模块本地) | 2026-09-24 HardFault 路径结构性消除 | — |
|
||||
| UART 物理失效(发送卡死 / 超时) | `HAL_UART_Transmit` 返回 `HAL_TIMEOUT`;调用点忽略返回值(best-effort 控制台),该块丢弃 | 不入丢弃计数(与"缓冲满"独立);UART 故障由其他可观测面暴露(自检 / 其余日志) | 已知缺口:超时未计数(v2 可加超时计数) |
|
||||
| `sys_evt` 对象缺失(句柄 NULL) | 唤醒空操作,50ms 兜底 | 至多 50ms 时延 | — |
|
||||
|
||||
## 8. 内存预算
|
||||
|
||||
| 项 | 大小 | 位置 |
|
||||
|----|------|------|
|
||||
| `s_con_ring` | 4096 B | BSS(SRAM1,非 CCM) |
|
||||
| `s_con_head/tail/drop/writer_up/writer_task` | ≈14 B | BSS |
|
||||
| 生产者行缓冲 `__con_line`(`DBG_PRINT` 宏局部) | 192 B/调用 | 调用者任务栈(入环后即释放,峰值非累积) |
|
||||
|
||||
**结论:静态 +4.1KB(SRAM1);FreeRTOS 堆零增量、无新任务/栈、无新内核对象。** 2026-09-25 实测:`heap free=8776B, min_ever=4816B`(CCM 堆不受影响);`__con_line` 192B 峰值在各任务既有栈预算内(任务栈按 2026-09-21 实测峰值 ×1.5 + 1KB ISR 余量定档,见 AGENTS.md 任务栈表;当日栈水位复测 6 任务全 PASS)。
|
||||
|
||||
## 9. 设计决策与否决的替代方案
|
||||
|
||||
| # | 替代方案 | 否决 / 采纳理由 |
|
||||
|---|---------|----------------|
|
||||
| D1 | 逐字符 `fputc` + `gState` 检查(旧方案) | 原子性退化为字节级 → 字符交错(F1);调用方脏指针直达 UART(F2);并发立即 `HAL_BUSY` → 静默丢行(C3) |
|
||||
| D2 | 整行 `HAL_UART_Transmit` + `gState` 检查 | 消除交错,但不解决脏指针(调用方缓冲仍入 UART);竞争失败方无等待/重试,整行静默丢;调用方阻塞时长不受控(等 UART 物理速率) |
|
||||
| D3 | 专用日志任务 | 违反 G3(RAM 紧张不新增任务/栈);defaultTask 本就是存储子系统唯一写者,单写者纪律收敛到同一任务,且主循环已是 50ms 事件驱动 |
|
||||
| D4 | TX DMA / 中断驱动发送 | 发送率低(115200、日志行稀疏),收益不足;不解决 G2(DMA 同样读调用方缓冲);DMA 缓冲可达性 / 所有权 / 双缓冲复杂度不值 |
|
||||
| D5 | 环 + 直发双路径(**采纳**) | 注册稳态走环(零丢失、有计数);内核前 / ISR / 钩子走有界直发(G4:不等待、不死锁、零内核对象);未注册期"只丢不交错、未计数"是 K1/K3 约束下的代价,启动窗口秒级、实测未发生(§3.4) |
|
||||
| D6 | 每生产者 SPSC 无锁队列 | 多生产者仍需 MPMC;单环 + 临界区整行拷贝更简,生产者临界区 ≤192B 微秒级;事件位复用免新增内核对象 |
|
||||
| D7 | `printf` 保为主路径 | MicroLIB 逐字符回调开销 + 遗留语义;`DBG_*` 宏调用点格式化整行一次入环(一次入环、一次事件) |
|
||||
|
||||
## 10. 验证记录
|
||||
|
||||
| 日期 | 验证 | 结果 |
|
||||
|------|------|------|
|
||||
| 2026-09-24 | HardFault 定位:BFAR=0x10010000(=CCM 末尾+1),PC 在 `HAL_UART_Transmit` 缓冲读取处;崩溃前交错行留证 | 根因确认(F1/F2)→ 单写者加固实施 |
|
||||
| 2026-09-25 | `@build`(Keil MDK v5 / ARMCC C99) | **0 Error, 0 Warning**(`console_log.c` 注册于 App 组) |
|
||||
| 2026-09-25 | `@test` 硬件闭环(烧录 → 开机日志采集 → 标记校验) | **PASS**:Required 3/3(`App init OK` / `Network Init` / `net init: OK`);Forbidden 5/5 缺席(`FAIL`/`ERROR`/`HardFault`/`assert`/`[ERR]`,大小写不敏感);67 行开机日志完整、无交错、无丢行 |
|
||||
| 2026-09-25 | 静态门禁:C 代码规范 V1.0 + U+FFFD 乱码 + cppcheck(warning, performance, portability, style) | 0 违规 |
|
||||
| 2026-09-25 | 迁移验收:实现迁出 `Src/usart.c`(该文件恢复 478 行纯 CubeMX 形态),双端行为不变 | `@build` 0/0 + `@test` 复测 PASS;引用关系图重生成 |
|
||||
|
||||
## 11. 实施时间线
|
||||
|
||||
| 日期 | 事件 |
|
||||
|------|------|
|
||||
| 2026-09-22 | 链路延迟测试:开机并发 `printf` 丢行(连续 4 行)实证 → S8 非阻塞日志立项(`链路延迟测试说明.md` §10.2) |
|
||||
| 2026-09-24 | 字符交错 + HardFault 实证 → 单写者加固实施(4KB 环 + defaultTask 唯一发送 + 裸发回退 + `fputc` 收敛);当时位于 `Src/usart.c` USER CODE 区 |
|
||||
| 2026-09-25 | 迁出至 `App/log/console_log.{h,c}`(HAL 生成文件不含应用代码);`dbg_log.h` 改 `#include "console_log.h"`;Keil 工程 App 组注册;`@build` 0/0、`@test` PASS、引用关系图与本文档同步 |
|
||||
| 2026-09-25 | 写者任务体迁出:`Src/freertos.c` 的 `StartDefaultTask` 任务体(存储 bring-up / 配置引擎 / 控制台 attach+drain / syslog / LED / 栈水位)整体移入 `App/task/default_task.c`(`default_task_func()`,与其余 5 任务文件同址);`freertos.c` 恢复"接线 + 崩溃钩子"的 CubeMX 形态(719→361 行);行为零变化,`@build` 0/0 + `@test` PASS 复验 |
|
||||
|
||||
## 12. 开放问题
|
||||
|
||||
| # | 项 | 说明 |
|
||||
|---|----|------|
|
||||
| O1 | 未注册期窗口丢行未计数 | 启动窗口(内核启动 → attach)直发竞争丢整行且无计数(HAL `HAL_BUSY` 立即返回);若未来开机日志密度上升,可升级为"内核前静态待发行 + attach 后统一补发"或有界等待直发 |
|
||||
| O2 | `HAL_UART_Transmit` 超时未计数 | 超时块(UART 物理失效)丢弃但不入 `s_con_drop`;v2 可加独立超时计数 |
|
||||
| O3 | `printf` 逐字节开销 | 遗留 `printf` 路径 = 逐字节临界区 + 逐字节事件置位;遗留调用点全部切 `DBG_*` 宏后开销自然消失(不改变机制) |
|
||||
|
||||
## 13. 相关文档
|
||||
|
||||
- `项目架构总览.md` —— 六层分层 / 启动时序 / 6 任务(写者任务与就绪屏障位置)
|
||||
- `运行与自检记录设计说明.md` —— sys_log 持久化日志(姊妹模块:同写者任务、不同通道)
|
||||
- `测试说明/链路延迟测试说明.md` —— D6 日志税 / S8 非阻塞日志(需求出处与 09-22 丢行实证)
|
||||
- `测试说明/自动化测试流程.md` —— `@test` 标记体系(Required / Forbidden 模式,`[ERR]` 语义)
|
||||
- AGENTS.md —— 平台约束(内核前禁内核对象 / C 堆禁令 / 事件位语义 / 内存预算)
|
||||
|
||||
## 修订记录
|
||||
|
||||
| 版本 | 日期 | 说明 |
|
||||
|------|------|------|
|
||||
| v1.0 | 2026-09-25 | 初版:完整设计说明(背景根因 / 单写者模型 / 详细设计 / API / 参数 / 失效模式 / 内存预算 / 设计决策 / 验证记录);实现位于 `App/log/console_log.{h,c}` |
|
||||
| v1.1 | 2026-09-25 | 文件拆分同步:写者任务体迁至 `App/task/default_task.c`(`Src/freertos.c` 只留 CubeMX 接线与崩溃钩子);§3.2 文件清单 / §4.3 / §6 / §11 位置引用更新 |
|
||||
+6
-3
@@ -164,7 +164,7 @@ flowchart LR
|
||||
```
|
||||
|
||||
- 掉电持久化:`net_cfg` 配置(通用配置文件 `/config.ini`,INI `[network]` 段,cfg_file 引擎),保存后下次上电生效、或立即生效(网络重建)、外部变更 4s 沉降后自动重载;旧版 NCFG 二进制(`/cfg/netcfg.bin`)首启自动迁移。
|
||||
- 日志记录:`sys_log` 引擎写定长 64B 文本记录到 `/log/run.log`(运行记录)与 `/log/selftest.log`(自检记录),defaultTask 唯一写者,FTP 可直下(详见 `docs/运行与自检记录设计说明.md`)。
|
||||
- 日志记录:`sys_log` 引擎写定长 64B 文本记录到 `/log/run.log`(运行记录)与 `/log/selftest.log`(自检记录),defaultTask 唯一写者,FTP 可直下(详见 `docs/运行与自检记录设计说明.md`);实时调试流 = 控制台单写者日志(USART1,4KB 环形缓冲 + defaultTask 唯一发送,详见 `docs/控制台单写者日志设计说明.md`)。
|
||||
- NAND 坏块表(BBT)持久化在保留块池,不交给 dhara 管理。
|
||||
|
||||
---
|
||||
@@ -249,14 +249,14 @@ flowchart TB
|
||||
```
|
||||
STM32F4-Base/
|
||||
├── Src/ Inc/ CubeMX 生成:main.c / freertos.c / HAL 外设 / 中断 / 时基
|
||||
│ ├── freertos.c 6 任务 + netMsgQueue + sys_evt 创建(USER CODE 区自定义,含栈水位探针 stack_probe_poll)
|
||||
│ ├── freertos.c 6 任务 + netMsgQueue + sys_evt 创建(CubeMX 接线 + 崩溃钩子;任务体在 App/task/)
|
||||
│ └── main.c 入口 → app_main_init → osKernelStart
|
||||
├── App/ 应用层(业务编排,非 CubeMX)
|
||||
│ ├── app_main.c 启动编排(时间子系统优先)
|
||||
│ ├── time_sync.c TCP 对时服务
|
||||
│ ├── sys_events.h 就绪屏障 bit 定义(就绪位等待须 osFlagsNoClear,见 §2.2)
|
||||
│ ├── app_cfg.h 功能编译开关(APP_NET/ADC/RS485_ENABLE)
|
||||
│ ├── task/ net_task / ui_task / adc_task* / rs485_task*
|
||||
│ ├── task/ default_task / net_task / ui_task / adc_task* / rs485_task*
|
||||
│ ├── log/ sys_log 记录引擎(定长 64B;MCU 后端落盘 /log/*.log)
|
||||
│ └── util/ crc(CRC-16/8)、ringbuf、sys_clock(墙钟)
|
||||
├── Drivers/BSP/ 纯手工驱动/服务(不受 CubeMX 保护)
|
||||
@@ -308,6 +308,7 @@ flowchart LR
|
||||
| 启动顺序 / 就绪屏障 | `docs/项目启动顺序管理.md` |
|
||||
| 存储架构(NAND/FTL/FatFs) | `docs/STM32F4-Base存储架构说明.md` |
|
||||
| 墙钟时间维护 | `docs/系统墙钟时间维护说明.md` |
|
||||
| 控制台单写者日志(USART1 调试流) | `docs/控制台单写者日志设计说明.md` |
|
||||
| RAM 预算与优化 | `docs/内存管理/RAM使用分析与优化方案.md` |
|
||||
| 栈/内存观测工具 | `scripts/stack_report.py`(Keil 静态调用图 × 串口 `[STACK]` 水位,判定取两者更坏者)· `scripts/ram_report.py`(.map 静态占用)—— 用法与基线见内存方案 §0.6 |
|
||||
| FTP 功能与陷阱 | `docs/测试说明/FTP_Test_Guide.md`(启动门 §8.6 / 单客户端 §8.7)· 脚本 `test/ftp_up_dl_test.py`、`test/ftp_speed_test.py` |
|
||||
@@ -338,3 +339,5 @@ flowchart LR
|
||||
| 2026-09-14 | 运行/自检记录:新增 `App/log/sys_log`(定长 64B 文本记录引擎,MCU 后端 `/log/run.log`·`selftest.log`,defaultTask 唯一写者)+ UI 页面插件 `ui_page_runlog`/`ui_page_selftest`(动态列表)+ `ui_standby` 待机屏(空闲超时切入);密码页错误提示;字体 111→122 字(217 字形);详见 `docs/运行与自检记录设计说明.md` |
|
||||
| 2026-09-21 | **§2.2 屏障语义修正 + FTP 永不监听缺陷修复**:`osEventFlagsWait` 默认消费所等位,就绪位(`NET_READY`/`STORAGE_READY`)被 netTask/uiTask/timeSync 先消费后,`ftpTask` 的 `WaitAll(两位)` 永不成立 → 任务永久阻塞、21 端口从未监听(静默);5 处就绪位等待统一加 `osFlagsNoClear`(命令位 `CFG_SAVE`/`NET_RECONFIG` 保持消费型)。同轮新增**栈可观测性**:`Src/freertos.c` 的 `stack_probe_poll`(串口 `[STACK]` 水位)+ `scripts/stack_report.py`(Keil 静态调用图 × 运行时水位,判定取两者更坏者);§2.1 任务表补齐实测栈数据并修正过期的 defaultTask/testTask 栈配置,§3 时序图补 `NoClear` 与 FTP 启动日志,§5 补 FTP 启动门/单客户端实测注意 |
|
||||
| 2026-09-21 | **栈宽整改落地(内存方案 §1.4:lftpd 大局部缓冲静态化)**:`Drivers/BSP/NET/lftpd/lftpd.c` + `lftpd_log.c` 共 **9 处**大局部数组(`message[256]`/`response[512]`/`name[256]`×2/`buffer[1024]`×2/`read_buffer[512]`/`arg_buf[512]`/`client` 会话上下文/日志 `buffer[256]`)改为函数级 `static`(lftpd 单客户端、全部在 ftpTask 内串行);**ftpTask 实测峰值 3480 → 1184 B(余量 15% → 71%,判定 PASS)**,静态调用图 2528 → 472 B,代价静态 BSS +4,616 B(RW_IRAM1 82,048 / 131,072 B,余量仍 ~48 KB);§2.1 栈实测数据同步,原"涨栈到 1600 words"方案取消;FTP 功能回归 10/10 + 128KB 逐字节一致 |
|
||||
| 2026-09-24 → 09-25 | **控制台单写者日志**(09-24 实证驱动:多任务并发日志字符级交错 + HardFault 脏指针直达 UART):4KB 环形缓冲 + defaultTask 唯一发送(行级原子 + 指针可控)+ 内核前/ISR/异常钩子有界直发回退 + `fputc` 收敛到单写者路径;09-24 初版实施于 `Src/usart.c` USER CODE 区,09-25 迁出至 `App/log/console_log.{h,c}`(HAL 生成文件不含应用代码),`dbg_log.h` 改 `#include "console_log.h"`(调用点零改动),`Src/usart.c` 恢复纯 CubeMX 形态;`@build` 0/0 + `@test` PASS;详见 `docs/控制台单写者日志设计说明.md` |
|
||||
| 2026-09-25 | **defaultTask 任务体文件拆分**:`Src/freertos.c` 的 `StartDefaultTask` 任务体(存储 bring-up / 配置引擎属主 / 控制台单写者 attach+drain / syslog 落盘 / LED / 栈水位探针 `stack_probe_poll`)整体迁至 `App/task/default_task.c`(`default_task_func()`,与其余任务文件同址);`freertos.c` 恢复"CubeMX 接线 + 崩溃钩子"形态(719→361 行),`@build` 0/0 复验;栈配置属性仍定义于 `freertos.c`(`stack_report` 数据源不变) |
|
||||
|
||||
Reference in New Issue
Block a user