update_manager.h 663 B

1234567891011121314151617181920
  1. #ifndef UPDATE_MANAGER_H
  2. #define UPDATE_MANAGER_H
  3. #include <stdint.h>
  4. #include "boot_layout.h"
  5. /* 校验 NOR 暂存区镜像(通过则返回 hdr)。调用方先完成 YMODEM 接收 */
  6. boot_err_t update_verify(fw_image_header_t *hdr);
  7. /* 备份 -> 烧录 -> 校验 -> 置 PENDING_CONFIRM。
  8. * 失败且存在完好备份时自动回滚, 返回原始失败码; 无备份时仅置错误状态 */
  9. boot_err_t update_run(const fw_image_header_t *hdr);
  10. /* 回滚: 验备份 -> 擦 APP 区 -> 备份回写 -> 校验 -> IDLE */
  11. boot_err_t rollback_run(void);
  12. /* 错误码字符串(日志用) */
  13. const char *boot_err_str(boot_err_t e);
  14. #endif /* UPDATE_MANAGER_H */