fix(vd960DBN): init/clear 懒擦修复不断重启 — 34s 全量擦除超 IWDG 4s
现场: 烧录快照固件后 CH32V208 不断重启 + 串口乱码
根因: snap_init 首擦 751 扇区 ~34s (头在擦完才写→复位后仍全新→死循环);
snap_clear 34s / offlog_clear 2.8s 同类; 均超 IWDG 4s
修复(懒擦): init/clear 只擦写指针起点扇区 ~45ms, 其余由环形写切扇区
逻辑自动擦; clear 为逻辑清除 (count=0 旧数据不可读)
附带: usart_biz.c 非 0x7F 帧 %s 打印改 hex (Loop 数据当字符串=乱码源)
snapshot.h 线程模型注释修正 (lup_process_frame 实际在主循环 uart_srv)
测试: test_snapshot 9例(新增 lazy_erase) + offlog/ble_offlog 回归全过
This commit is contained in:
@@ -1006,7 +1006,7 @@ void manage_dbn_ble_default(uint8_t *pkg, uint8_t len)
|
||||
(unsigned long)_start_seq, (unsigned long)_req_count, (unsigned)_j);
|
||||
} break;
|
||||
case CMD_DBN_OFFLOG_CLEAR: {
|
||||
/* clear offlog (audit trail). blocking ~2.8s (63 sectors erase), main-loop ctx ok */
|
||||
/* clear offlog (audit trail). blocking ~45ms (logical clear + current sector), main-loop ctx ok */
|
||||
uint8_t _i = 0;
|
||||
offlog_clear();
|
||||
tmp_ble_buf[_i++] = 0x00; /* ok */
|
||||
@@ -1097,7 +1097,7 @@ void manage_dbn_ble_default(uint8_t *pkg, uint8_t len)
|
||||
(unsigned long)_start_seq, (unsigned long)_req_count, (unsigned)_j);
|
||||
} break;
|
||||
case CMD_DBN_SNAP_CLEAR: {
|
||||
/* clear snapshot (audit trail). blocking (sectors erase), main-loop ctx ok */
|
||||
/* clear snapshot (audit trail). blocking ~45ms (logical clear + current sector) */
|
||||
uint8_t _i = 0;
|
||||
snap_clear();
|
||||
tmp_ble_buf[_i++] = 0x00; /* ok */
|
||||
|
||||
Reference in New Issue
Block a user