fusion/app/app_ota/makeimage.h

40 lines
1.3 KiB
C
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _FIRMWARE_PACK_H_
#define _FIRMWARE_PACK_H_
/*
* 功能:
* 因为固件都在V831这边所以由V831来做升级的总管控制升级流程
* 1 从MT7682接收固件包, 写到V831的flash上面
* 2 接收完毕CRC正确设置升级标志位各个芯片要支持单独升级/单独设置升级标志/版本号
* 3 触发V831的升级升级完成版本号与升级版本一致清除V831的升级标志
* 4 触发MT7682升级升级完获取版本号版本号与升级版本一致清除MT7682升级标志
* 5 类似方式触发BYD/华大升级
*/
/*
* 每一个模块升级完都要单独更新升级标志
*/
enum FIRMWARE_ID {
MAIN=0,
SOUND,
WIFI, //必须放在最后面, 因为写到flash以后, 就触发重启升级机制
MCU2,
CHIP_MAX
};
#define IMG_MAGIC 0x20A3BF9D
struct chipFWInfo {
unsigned int magic;
unsigned short chipID; //FIRMWARE_ID
unsigned short version; //待升级的版本号
unsigned int offset; //在固件包当中的偏移地址
unsigned int length; //固件大小
unsigned int crc; //crc32
};
struct FWPackHeader{
struct chipFWInfo FWInfo[CHIP_MAX];
unsigned char reserved[128 - sizeof(struct chipFWInfo) * CHIP_MAX];
};
#endif