diff --git a/App/app_main.c b/App/app_main.c index 3109a4bd..0d3adfd2 100644 --- a/App/app_main.c +++ b/App/app_main.c @@ -53,7 +53,7 @@ int app_main_init(void) { */ sd2506_init(); if (sys_clock_init() != 0) { - syslog_post(SYSLOG_SELFTEST, "时钟芯片异常"); + syslog_post(SYSLOG_SELFTEST, "clock chip fault"); } /* 2) RS-485 初始化(UART4 + PD0 方向控制),初始化即自动开启接收 */ @@ -71,7 +71,7 @@ int app_main_init(void) { (ret == GD5F_ERASE_FAIL) ? "ERASE FAIL" : (ret == GD5F_ID_MISMATCH) ? "ID MISMATCH" : "UNKNOWN"); if (ret != GD5F_OK) { - syslog_post(SYSLOG_SELFTEST, "NAND异常"); + syslog_post(SYSLOG_SELFTEST, "NAND fault"); } /* 4) TPAFE5160 ADC 测试 */ @@ -79,7 +79,7 @@ int app_main_init(void) { DBG_INFO("ADC init: %s", (tp_ret == TPAFE5160_OK) ? "OK" : "TIMEOUT"); if (tp_ret != TPAFE5160_OK) { - syslog_post(SYSLOG_SELFTEST, "ADC异常"); + syslog_post(SYSLOG_SELFTEST, "ADC fault"); } /* 5) SD2506 RTC 诊断信息 */ diff --git a/App/log/sys_log.h b/App/log/sys_log.h index 828e719d..4870c0ae 100644 --- a/App/log/sys_log.h +++ b/App/log/sys_log.h @@ -51,7 +51,7 @@ typedef enum { #define SYSLOG_SELFTEST_MAX 512u /* /log/selftest.log:32KB */ /* - * 上电/重启分类窗口(秒):run.log 末条 epoch 距 now < 该值 → "装置重启记录",否则 "装置上电记录" + * 上电/重启分类窗口(秒):run.log 末条 epoch 距 now < 该值 → "reboot",否则 "power on" */ #define SYSLOG_REBOOT_WINDOW_S 600u diff --git a/App/log/sys_log_mcu.c b/App/log/sys_log_mcu.c index 1c6b84cc..da2f19eb 100644 --- a/App/log/sys_log_mcu.c +++ b/App/log/sys_log_mcu.c @@ -154,7 +154,7 @@ int syslog_mcu_init(void) { void syslog_mcu_mounted(void) { FILINFO finfo; uint32_t last = 0u; - const char *desc = "装置上电记录"; + const char *desc = "power on"; if (f_stat("/log", &finfo) != FR_OK) { FRESULT fr = f_mkdir("/log"); @@ -168,7 +168,7 @@ void syslog_mcu_mounted(void) { /* 上电/重启分类:末条 epoch 距 now < SYSLOG_REBOOT_WINDOW_S → 重启,否则上电 */ if (syslog_last_epoch(SYSLOG_RUN, &last) == 0 && sys_clock_get() != UINT32_MAX) { if ((uint32_t)(sys_clock_get() - last) < SYSLOG_REBOOT_WINDOW_S) { - desc = "装置重启记录"; + desc = "reboot"; } } (void)s_append(SYSLOG_RUN, desc); diff --git a/App/task/net_task.c b/App/task/net_task.c index f19b37ea..790ece87 100644 --- a/App/task/net_task.c +++ b/App/task/net_task.c @@ -10,7 +10,7 @@ * v1.1 2026-07-19 王建锋 migrate from freertos.c StartNetTask * v1.2 2026-07-21 王建锋 网络初始化移入本任务(net_init + TCP 监听) * v1.3 2026-07-22 王建锋 单连接模式重构,增加大文件/边界/KeepAlive 测试 - * v1.4 2026-09-14 王建锋 新增自检埋点:PHY 链路 3s 未建立 → sys_log "通讯异常" + * v1.4 2026-09-14 王建锋 新增自检埋点:PHY 链路 3s 未建立 → sys_log "comms fault" * v1.5 2026-09-15 王建锋 配置加载移交 defaultTask(配置引擎属主,P1-3); * 本任务只读 RAM 副本 * v1.6 2026-09-15 王建锋 P1-6:入口加 CH395F 硬件层测试模式自挂起守卫 @@ -123,7 +123,7 @@ int net_stack_bring_up(void) { /* 自检埋点:链路超时未建立 → 记入自检记录(仅故障才写) */ if (phy == CH395F_PHY_DISCONN) { - syslog_post(SYSLOG_SELFTEST, "通讯异常"); + syslog_post(SYSLOG_SELFTEST, "comms fault"); } /* 网络已重建完成、对外可用:递增代次号,通知各 TCP 服务(FTP/对时/远程显示) diff --git a/App/util/sys_clock.c b/App/util/sys_clock.c index 1c99fe24..dbe2eca2 100644 --- a/App/util/sys_clock.c +++ b/App/util/sys_clock.c @@ -253,7 +253,7 @@ int sys_clock_init(void) { /* * 降级基准:以编译期默认时间建立基准(仅 RAM、不依赖芯片)。 * 墙钟保持可用(日志时间戳为默认时间);返回值报告芯片故障, - * 触发 app_main 的"时钟芯片异常"自检。 + * 触发 app_main 的 "clock chip fault" 自检。 */ DBG_ERROR("sys_clock_init: RTC abnormal, fallback to default time"); sd_time.year = RTC_DEFAULT_YEAR; diff --git a/Src/freertos.c b/Src/freertos.c index c2ed47a3..a2b760dd 100644 --- a/Src/freertos.c +++ b/Src/freertos.c @@ -239,7 +239,7 @@ void StartDefaultTask(void *argument) } else { DBG_ERROR("[FS] f_mount failed (fr=%d)", (int)fr); /* 存储不可写:自检故障仅能滞留待发队列(串口已告警) */ - syslog_post(SYSLOG_SELFTEST, "文件系统异常"); + syslog_post(SYSLOG_SELFTEST, "filesystem fault"); } /* 注册"保存网络配置"请求通知:UI(uiTask)投递 → 置事件 → 本任务立即执行写盘 diff --git a/simulator/main.c b/simulator/main.c index 59063a62..3888644b 100644 --- a/simulator/main.c +++ b/simulator/main.c @@ -324,9 +324,9 @@ static int run_logtest(void) (void)remove("sim_run.log"); (void)remove("sim_selftest.log"); - syslog_post(SYSLOG_RUN, "装置上电记录"); - syslog_post(SYSLOG_SELFTEST, "时钟芯片异常"); - syslog_post(SYSLOG_SELFTEST, "NAND异常"); + syslog_post(SYSLOG_RUN, "power on"); + syslog_post(SYSLOG_SELFTEST, "clock chip fault"); + syslog_post(SYSLOG_SELFTEST, "NAND fault"); if (syslog_count(SYSLOG_RUN) != 1u) { printf("[logtest] FAIL run count = %u (expect 1)\n", (unsigned)syslog_count(SYSLOG_RUN)); @@ -346,7 +346,7 @@ static int run_logtest(void) printf("[logtest] FAIL ts format = \"%s\"\n", ts); return 1; } - if (strcmp(desc, "装置上电记录") != 0) { + if (strcmp(desc, "power on") != 0) { printf("[logtest] FAIL desc = \"%s\"\n", desc); return 1; } @@ -354,7 +354,7 @@ static int run_logtest(void) printf("[logtest] FAIL get_record(selftest, 1)\n"); return 1; } - if (strcmp(desc, "NAND异常") != 0) { + if (strcmp(desc, "NAND fault") != 0) { printf("[logtest] FAIL desc[1] = \"%s\"\n", desc); return 1; } @@ -390,7 +390,7 @@ static int run_logtest(void) (unsigned)SYSLOG_TS_LEN, (unsigned)(SYSLOG_DESC_OFFS - 1u)); return 1; } - for (uint32_t i = SYSLOG_DESC_OFFS + strlen("装置上电记录"); i < SYSLOG_REC_SIZE; i++) { + for (uint32_t i = SYSLOG_DESC_OFFS + strlen("power on"); i < SYSLOG_REC_SIZE; i++) { if (rec[i] != '\0') { printf("[logtest] FAIL NUL padding at [%u]\n", (unsigned)i); return 1;