Skip to content

Commit

Permalink
serial: 在 FLASH_END 超时时抛出异常
Browse files Browse the repository at this point in the history
当前 FLASH_END 已被用作 burner 内部的 queue drain 操作。若不理会该指令的超时继续执行
后续的 FLASH_MD5 等操作,可能引起由于数据未完全落盘导致的误判。

Signed-off-by: xychen <xychen@listenai.com>
  • Loading branch information
xychen committed Mar 13, 2024
1 parent eca4edd commit 221b224
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libcskburn_serial/src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,17 @@ cskburn_serial_write(cskburn_serial_device_t *dev, cskburn_serial_target_t targe
}

if (target == TARGET_FLASH) {
cmd_flash_finish(dev);
if ((ret = cmd_flash_finish(dev)) != 0) {
return ret;
}
} else if (target == TARGET_NAND) {
cmd_nand_finish(dev);
if ((ret = cmd_nand_finish(dev)) != 0) {
return ret;
}
} else if (target == TARGET_RAM) {
cmd_mem_finish(dev, jump ? OPTION_JUMP : OPTION_RUN, jump);
if ((ret = cmd_mem_finish(dev, jump ? OPTION_JUMP : OPTION_RUN, jump)) != 0) {
return ret;
}
}

uint64_t t2 = time_monotonic();
Expand Down

0 comments on commit 221b224

Please sign in to comment.