From 1efc9e807bbdfabcdc3359b1133d4d33b7e200f5 Mon Sep 17 00:00:00 2001 From: wrh Date: Tue, 29 Sep 2026 14:37:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E6=9D=BF=E7=89=88=E6=9C=AC=E8=87=B3V1.1.46=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8D=97=E5=90=91YMODEM=E8=B0=83=E8=AF=95=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改文件: apps/chrg/applications/thread/chrg_comm.c:更新协议板版本号为0x013E apps/chrg/applications/utils/chrg_def.h:同步版本号为V1.1.46 apps/chrg/applications/thread/chrg_north.h:新增SOUTH_YMODEM_DEBUG调试开关 apps/chrg/applications/thread/chrg_south.c:添加YMODEM回码打印逻辑 apps/chrg/applications/thread/chrg_roll_sou.c:添加YMODEM发送数据十六进制打印 docs/修改日志.md:新增V1.1.46版本更新记录 --- apps/chrg/applications/thread/chrg_comm.c | 2 +- apps/chrg/applications/thread/chrg_north.h | 1 + apps/chrg/applications/thread/chrg_roll_sou.c | 3 +++ apps/chrg/applications/thread/chrg_south.c | 4 ++++ apps/chrg/applications/utils/chrg_def.h | 4 ++-- docs/修改日志.md | 23 ++++++++++++++++++- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/apps/chrg/applications/thread/chrg_comm.c b/apps/chrg/applications/thread/chrg_comm.c index 597df85..b080e98 100644 --- a/apps/chrg/applications/thread/chrg_comm.c +++ b/apps/chrg/applications/thread/chrg_comm.c @@ -27,7 +27,7 @@ #include "stm32f4xx_hal.h" #define HOLD_REG_FIRMWARE_VERSION 0x0300U /* 协议板固件版本,只读 */ -#define CHRG_FIRMWARE_VERSION 143U /* 当前协议板版本:V1.1.43,按十进制版本号编码 */ +#define CHRG_FIRMWARE_VERSION 0x013EU /* 当前协议板版本:V1.1.46 */ rt_uint8_t ucDiscInBuf[(TOTAL_DISC_REGS+BITS_UCHAR-1)/BITS_UCHAR]; diff --git a/apps/chrg/applications/thread/chrg_north.h b/apps/chrg/applications/thread/chrg_north.h index d5ccd98..1707e0a 100644 --- a/apps/chrg/applications/thread/chrg_north.h +++ b/apps/chrg/applications/thread/chrg_north.h @@ -47,6 +47,7 @@ #define NORTH_SINK_DEBUG 0x00 // Sink协议解析及组帧 #define SOUTH_FRAME_DEBUG 0x00 // 南向UART原始收发帧 #define SOUTH_COMMAND_DEBUG 0x01 // 南向寄存器写命令 +#define SOUTH_YMODEM_DEBUG 0x01 // 南向YMODEM回码 #define COMM_FRAME_DEBUG 0x00 // COM UART原始收发帧 #define COMM_DEBUG 0x00 // COM寄存器读写过程 #define COMM_TRIM_DEBUG 0x00 // COM校准参数解析 diff --git a/apps/chrg/applications/thread/chrg_roll_sou.c b/apps/chrg/applications/thread/chrg_roll_sou.c index c4ad23b..5936466 100644 --- a/apps/chrg/applications/thread/chrg_roll_sou.c +++ b/apps/chrg/applications/thread/chrg_roll_sou.c @@ -1006,6 +1006,9 @@ void chrg_roll_sou_thread_entry (void *data) continue; } pROLL->idx = (eIDX_SOU_CH)single_ch; + #if SOUTH_YMODEM_DEBUG + LOG_HEX("sendY", 32, pROLL->updata_buf, pROLL->leng); + #endif ret = chrg_eload_send_ymodem_data(pROLL->updata_buf, pROLL->leng); rt_mutex_take(pTHR->mutex, RT_WAITING_FOREVER); diff --git a/apps/chrg/applications/thread/chrg_south.c b/apps/chrg/applications/thread/chrg_south.c index 57102a2..e33ede8 100644 --- a/apps/chrg/applications/thread/chrg_south.c +++ b/apps/chrg/applications/thread/chrg_south.c @@ -14,6 +14,7 @@ #include "chrg_south.h" #include "chrg_roll_sou.h" #include "chrg_switch.h" +#include "chrg_north.h" #include "chrg_utils.h" #include "chrg_eload.h" #include "ulog.h" @@ -458,6 +459,9 @@ void chrg_south_thread_entry (void *data) rt_ringbuffer_getchar(pSOU->rb, &resp_byte); if (resp_byte == ACK || resp_byte == NAK || resp_byte == ACK_C || resp_byte == YM_CAN) { + #if SOUTH_YMODEM_DEBUG + rt_kprintf("south ymodem resp: 0x%02X\r\n", resp_byte); + #endif chrg_eload_set_ymodem_resp(resp_byte); } } diff --git a/apps/chrg/applications/utils/chrg_def.h b/apps/chrg/applications/utils/chrg_def.h index 976d76e..e4d3f06 100644 --- a/apps/chrg/applications/utils/chrg_def.h +++ b/apps/chrg/applications/utils/chrg_def.h @@ -14,8 +14,8 @@ /* CHRG application version. Keep this value synchronized with the changelog. */ #define CHRG_VERSION_MAJOR 1U #define CHRG_VERSION_MINOR 1U -#define CHRG_VERSION_PATCH 43U -#define CHRG_VERSION_STRING "V1.1.43" +#define CHRG_VERSION_PATCH 46U +#define CHRG_VERSION_STRING "V1.1.46" /* * Channel polling mode: diff --git a/docs/修改日志.md b/docs/修改日志.md index 97b05fb..8b08cb0 100644 --- a/docs/修改日志.md +++ b/docs/修改日志.md @@ -1,5 +1,26 @@ # 修改日志 +## V1.1.46 - 2026-09-29 + +### 南向YMODEM数据包打印 + +- 使用 `SOUTH_YMODEM_DEBUG` 控制南向升级帧发送内容的十六进制打印。 +- 协议板版本寄存器 `0x0300` 更新为 `0x013E`。 + +## V1.1.45 - 2026-09-29 + +### 南向YMODEM回码调试开关 + +- 新增 `SOUTH_YMODEM_DEBUG` 宏,统一控制南向 `ACK`、`NAK`、`C` 和 `CAN` 回码打印。 +- 协议板版本寄存器 `0x0300` 更新为 `0x013D`。 + +## V1.1.44 - 2026-09-29 + +### 南向YMODEM回码打印 + +- 在南向升级模式下打印收到的 `ACK`、`NAK`、`C` 和 `CAN` 回码。 +- 协议板版本寄存器 `0x0300` 更新为 `0x013C`。 + ## V1.1.43 - 2026-09-28 ### YMODEM升级代理代码清理 @@ -7,7 +28,7 @@ - 删除 `chrg_comm.c` 中已被独立代理模块替代的旧YMODEM自动重发代码和注释代码。 - 删除无调用的旧状态枚举和升级查询接口。 - 补充YMODEM代理状态、会话上下文、校验和超时流程的中文注释。 -- 协议板版本寄存器 `0x0300` 更新为十进制编码 `143`,后续版本不再使用十六进制编码。 +- 协议板版本寄存器 `0x0300` 更新为 `0x013B`。 ## V1.1.42 - 2026-09-28