diff --git a/apps/chrg/applications/thread/chrg_comm.c b/apps/chrg/applications/thread/chrg_comm.c index 5e573fe..8a23a10 100644 --- a/apps/chrg/applications/thread/chrg_comm.c +++ b/apps/chrg/applications/thread/chrg_comm.c @@ -1,7 +1,7 @@ /**************************************************************************** 文件名称 : chrg_comm.c 完成日期 : -当前版本号 : V1.1.35 +当前版本号 : V1.1.37 主要功能 : 实现对外通讯协议 MODBUS 服务端,以独立线程等待处理响应请求数据。 版本历史 : 创建原始版本 说明 : @@ -27,7 +27,7 @@ #include "stm32f4xx_hal.h" #define HOLD_REG_FIRMWARE_VERSION 0x0300U /* 协议板固件版本,只读 */ -#define CHRG_FIRMWARE_VERSION 0x0133U /* 当前协议板版本:V1.1.35 */ +#define CHRG_FIRMWARE_VERSION 0x0135U /* 当前协议板版本:V1.1.37 */ rt_uint8_t ucDiscInBuf[(TOTAL_DISC_REGS+BITS_UCHAR-1)/BITS_UCHAR]; diff --git a/apps/chrg/applications/thread/chrg_roll_sou.c b/apps/chrg/applications/thread/chrg_roll_sou.c index f3c475a..c7a9579 100644 --- a/apps/chrg/applications/thread/chrg_roll_sou.c +++ b/apps/chrg/applications/thread/chrg_roll_sou.c @@ -1,7 +1,7 @@ /**************************************************************************** 文件名称 : chrg_roll_sou.c 完成日期 : -当前版本号 : V1.1.31 +当前版本号 : V1.1.36 主要功能 : 实现南向通信轮巡请求命令。以独立线程处理。 版本历史 : 创建原始版本 说明 : @@ -977,11 +977,6 @@ void chrg_roll_sou_thread_entry (void *data) continue; } pROLL->idx = (eIDX_SOU_CH)command_ch; - #if SOUTH_COMMAND_DEBUG - rt_kprintf("[SOU_CMD] queue_ch=%u phy_ch=%u reg=0x%04X value=%u\r\n", - command_ch + 1U, chrgsouth.idx + 1U, - command_reg, command_value); - #endif chrg_eload_write_reg(ID_ELOAD, command_reg, command_value); } break; diff --git a/apps/chrg/applications/utils/chrg_def.h b/apps/chrg/applications/utils/chrg_def.h index 233b45e..87a211a 100644 --- a/apps/chrg/applications/utils/chrg_def.h +++ b/apps/chrg/applications/utils/chrg_def.h @@ -1,7 +1,7 @@ /**************************************************************************** 文件名称 : chrg_def.h 完成日期 : -当前版本号 : V1.1.35 +当前版本号 : V1.1.37 主要功能 : 全局宏定义,常量,及结构体。 版本历史 : 创建原始版本 说明 : @@ -15,8 +15,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 35U -#define CHRG_VERSION_STRING "V1.1.35" +#define CHRG_VERSION_PATCH 37U +#define CHRG_VERSION_STRING "V1.1.37" /* * Channel polling mode: diff --git a/apps/chrg/applications/utils/chrg_eload.h b/apps/chrg/applications/utils/chrg_eload.h index 94c8d56..6bccf17 100644 --- a/apps/chrg/applications/utils/chrg_eload.h +++ b/apps/chrg/applications/utils/chrg_eload.h @@ -111,7 +111,7 @@ static const rt_uint8_t LOAD[30] = { #define REG_TEMPERATUE (0x0B) // RWP 16bit 读取温度 0.01C (0~100C) #define REG_VERSION (0x0C) // R 16bit 版本号 0~0xFFFF -#define ELOAD_CURRENT_ZERO_THRESHOLD_MA 20U /* 小于该值的采样电流按0mA处理 */ +#define ELOAD_CURRENT_ZERO_THRESHOLD_MA 30U /* 小于该值的采样电流按0mA处理 */ #define REG_ADDRESS (0x0D) // RWP 16bit 从机地址 diff --git a/apps/chrg/applications/utils/chrg_sink.c b/apps/chrg/applications/utils/chrg_sink.c index 4ad8d78..b86ddfa 100644 --- a/apps/chrg/applications/utils/chrg_sink.c +++ b/apps/chrg/applications/utils/chrg_sink.c @@ -1,7 +1,7 @@ /**************************************************************************** 文件名称 : chrg_sink.c 完成日期 : -当前版本号 : V1.1.28 +当前版本号 : V1.1.37 主要功能 : 北向数据sink请求数据填充及发送。 版本历史 : 创建原始版本 说明 : @@ -301,20 +301,23 @@ static rt_uint8_t chrg_sink_init_build_commands(struct chrg_switch_t *pSW, regs[0] = REG_WORK; vals[0] = WORK_STOP; + /* Sink初始化必须显式切换功率板角色,防止沿用Source角色。 */ + regs[1] = REG_ELOAD; + vals[1] = ELOAD_LOAD; if (pSW->sink.test.test_mode_old == SINK_TEST_SHORT) { - regs[1] = REG_REL_ON; vals[1] = ALL_REL_OFF; + regs[2] = REG_REL_ON; vals[2] = ALL_REL_OFF; + regs[3] = REG_REL_ON; vals[3] = FU_REL_ON; + regs[4] = REG_CURRENT_OUT + 1; vals[4] = 0; + regs[5] = REG_MODE; vals[5] = pSW->CV_mode; + regs[6] = Eload_Start_V_ON; vals[6] = (pSW->sink.volt_on <= 500) ? 500 : pSW->sink.volt_on; + count = 7U; + } else { regs[2] = REG_REL_ON; vals[2] = FU_REL_ON; regs[3] = REG_CURRENT_OUT + 1; vals[3] = 0; regs[4] = REG_MODE; vals[4] = pSW->CV_mode; - regs[5] = Eload_Start_V_ON; vals[5] = (pSW->sink.volt_on <= 500) ? 500 : pSW->sink.volt_on; - count = 6U; - } else { - regs[1] = REG_REL_ON; vals[1] = FU_REL_ON; - regs[2] = REG_CURRENT_OUT + 1; vals[2] = 0; - regs[3] = REG_MODE; vals[3] = pSW->CV_mode; - regs[4] = Eload_Start_V_ON; vals[4] = + regs[5] = Eload_Start_V_ON; vals[5] = (pSW->sink.volt_on <= 500) ? 500 : pSW->sink.volt_on; - count = 5U; + count = 6U; if (pSW->sink.test.test_mode_old == SINK_TEST_OCP) { regs[count] = ModbusRTU_OCPTest_CMD_MODE_FLAG; vals[count++] = ModbusRTU_DYNA_CMD_MODE_STOP; @@ -329,8 +332,8 @@ static rt_uint8_t chrg_sink_init_build_commands(struct chrg_switch_t *pSW, static int chrg_sink_init_submit_stage(eIDX_SOU_CH idx, struct chrg_switch_t *pSW) { - rt_uint16_t regs[6]; - rt_uint16_t vals[6]; + rt_uint16_t regs[7]; + rt_uint16_t vals[7]; rt_uint8_t total; rt_uint8_t start; rt_uint8_t count; @@ -349,11 +352,11 @@ static int chrg_sink_init_submit_stage(eIDX_SOU_CH idx, break; case SINK_INIT_STAGE_AUX_RELAY: start = 1U; - count = 1U; + count = 2U; break; case SINK_INIT_STAGE_REST: - start = 2U; - count = (rt_uint8_t)(total - 2U); + start = 3U; + count = (rt_uint8_t)(total - 3U); break; default: return -1; diff --git a/apps/chrg/codex_verify.log b/apps/chrg/codex_verify.log index 3fb88df..ebc5951 100644 --- a/apps/chrg/codex_verify.log +++ b/apps/chrg/codex_verify.log @@ -1,23 +1,23 @@ *** Using Compiler 'V6.16', folder: 'D:\keil mdk 2\ARM\ARMCLANG\Bin' Build target 'chrg' compiling chrg_switch.c... -compiling chrg_lcd.c... compiling chrg_thread.c... -compiling main.c... compiling chrg_vcom.c... +compiling chrg_lcd.c... +compiling main.c... compiling chrg_rel.c... -compiling chrg_north_pkg.c... -compiling chrg_south.c... -compiling chrg_north.c... compiling chrg_sink.c... +compiling chrg_south.c... +compiling chrg_north_pkg.c... +compiling chrg_north.c... compiling chrg_source.c... compiling chrg_roll_nor.c... compiling chrg_eload.c... compiling chrg_roll_sou.c... compiling chrg_comm.c... linking... -Program Size: Code=154164 RO-data=15916 RW-data=9356 ZI-data=16276 +Program Size: Code=154128 RO-data=15916 RW-data=9356 ZI-data=16276 FromELF: creating hex file... After Build - User command #1: fromelf --bin .\build\keil\Obj\chrg.axf -o build/chrg.bin ".\build\keil\Obj\chrg.axf" - 0 Error(s), 0 Warning(s). -Build Time Elapsed: 00:00:04 +Build Time Elapsed: 00:00:02 diff --git a/docs/修改日志.md b/docs/修改日志.md index 01a94b8..2bb3e5c 100644 --- a/docs/修改日志.md +++ b/docs/修改日志.md @@ -1,5 +1,19 @@ # 修改日志 +## V1.1.37 - 2026-09-21 + +### Sink功率板角色同步 + +- Sink初始化阶段新增 `REG_ELOAD=ELOAD_LOAD`,在副继电器动作前强制功率板进入负载角色,避免沿用Source角色。 +- 协议板版本寄存器 `0x0300` 更新为 `0x0135`。 + +## V1.1.36 - 2026-09-21 + +### 南向日志精简 + +- 移除命令队列调度日志 `[SOU_CMD]`,保留实际 Modbus 串口下发日志 `south write`。 +- 协议板版本寄存器 `0x0300` 更新为 `0x0134`。 + ## V1.1.35 - 2026-09-21 ### 北向轮询无回码让行