From a36cc15cf2107c23c4a0baaf72406d66a7dacf73 Mon Sep 17 00:00:00 2001 From: wangfq Date: Thu, 13 Aug 2026 17:22:31 +0800 Subject: [PATCH] =?UTF-8?q?test(vd960DBN):=20=E4=BA=8C=E5=88=86=E5=8D=A1?= =?UTF-8?q?=E6=AD=BB=E7=82=B9=20=E2=80=94=20=E6=B3=A8=E9=87=8A=20json=5Fse?= =?UTF-8?q?nsor=5Fcallback=20enter=20PRINT=20+=20=E5=88=A0=E5=86=97?= =?UTF-8?q?=E4=BD=99=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现场: LUP 帧后卡死 (5分钟后神秘复位 RST=0x10000000, marker丢失)。 卡死点在 lup_process_frame 内 json_sensor_callback 的 enter PRINT (printf %d 处理), LUP Rx 打印(%s)成功但 enter(%d%d%d)卡死。 实验: - json_sensor_callback enter PRINT #if 0 (坐实 printf 问题) - uart_srv 187-190 重复逐字节打印 #if 0 (LUP Rx 已缓冲打印, 冗余) 验证: 不卡死→printf %d 问题实锤; 仍卡死→json_sensor_callback 后续代码 --- vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c | 4 ++++ vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/usart_biz.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c index ee17cdb..381711c 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/tcp_json_srv.c @@ -874,8 +874,12 @@ static int format_loop_param_json(char *buf, uint16_t buf_size, const LUP_ParamG static void json_sensor_callback(const uint8_t *pkg, uint16_t len) { FAULT_MARKER(MK_EVT_CB_IN); + /* 2026-08-13 实验: enter PRINT 是 LUP 帧后卡死嫌疑点 (printf %d 处理死循环), + 注释验证 — 若卡死消失则坐实 printf 问题, 再深挖 _write/锁 */ +#if 0 PRINT("JSON: sensor_cb enter socket=%d auth=%d report=%d\n", g_json_socket_listen, g_json_auth_state, g_report_cfg.enable); +#endif // Check: socket active, authed, report enabled if (g_json_socket_listen == 0xFF) { PRINT("JSON: sensor_cb skip: no socket\n"); return; } diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/usart_biz.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/usart_biz.c index 8becf5b..aeed38e 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/usart_biz.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/usart_biz.c @@ -183,11 +183,14 @@ void uart_srv(void) } } - // 调试打印 + // 调试打印 (2026-08-13: LUP Rx 已在 lup_process_frame 缓冲打印, + // 此处重复逐字节打印冗余且高频 — 暂时关闭) +#if 0 for(i = 0; i < g_pkg_uart_2.offset; i++){ PRINT(" %02X", g_pkg_uart_2.pkg[i]); } PRINT("\n"); +#endif } else {