Modify ota readme
This commit is contained in:
parent
c5aa020398
commit
fb1cf06b6e
|
@ -78,7 +78,7 @@ void readRomConfiguration(void) {
|
||||||
if ((CFG->cfgFlag[0] != checkcode1) || (CFG->cfgFlag[1] != checkcode2)) {
|
if ((CFG->cfgFlag[0] != checkcode1) || (CFG->cfgFlag[1] != checkcode2)) {
|
||||||
CFG_ERASE(PAGE_WRITE_START_ADDR, FLASH_PAGE_SIZE);
|
CFG_ERASE(PAGE_WRITE_START_ADDR, FLASH_PAGE_SIZE);
|
||||||
CFG_WRITE(PAGE_WRITE_START_ADDR, (u8 *)&defaultConfiguration, MODULE_CFG_LEN);
|
CFG_WRITE(PAGE_WRITE_START_ADDR, (u8 *)&defaultConfiguration, MODULE_CFG_LEN);
|
||||||
KPrintf("%s NVIC_SystemReset\n", __func__);
|
KPrintf("%s NVIC_SystemReset\r\n\r\n", __func__);
|
||||||
NVIC_SystemReset(); // 复位ch32v208
|
NVIC_SystemReset(); // 复位ch32v208
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
# 编译
|
# 编译
|
||||||
路径 Ubiquitous/XiZi_IIoT 下,执行 make BOARD=ch32v208rbt6 menuconfig,打开config 选项:
|
生成支持OTA升级的固件,需要分别编译boot和app。其中,boot是升级需要的固件,app是正常系统固件。
|
||||||
|
|
||||||
|
编译boot之前,需要在路径 Ubiquitous/XiZi_IIoT 下,执行:
|
||||||
|
|
||||||
|
cp board/ch32v208rbt6/.defconfig_boot board/ch32v208rbt6/.defconfig
|
||||||
|
|
||||||
|
编译app之前,需要在路径 Ubiquitous/XiZi_IIoT 下,执行:
|
||||||
|
|
||||||
|
cp board/ch32v208rbt6/.defconfig_app board/ch32v208rbt6/.defconfig
|
||||||
|
|
||||||
|
可以执行 make BOARD=ch32v208rbt6 menuconfig,查看config 选项。
|
||||||
|
|
||||||
.config - XiZi_IIoT Project Configuration
|
.config - XiZi_IIoT Project Configuration
|
||||||
> Tool feature > OTA function > Enable support OTA function > Compile bootloader bin or application bin.
|
> Tool feature > OTA function > Enable support OTA function > Compile bootloader bin or application bin.
|
||||||
|
@ -83,4 +93,3 @@ CH32V208的FLASH大小是480KB,其中零等待运行区域大小是128KB。FLA
|
||||||
|0x08050000 ~ 0x08077000 | Boot_SLOW | 156KB |
|
|0x08050000 ~ 0x08077000 | Boot_SLOW | 156KB |
|
||||||
|0x08077000 ~ 0x08078000 | OTA_FLAG | 4KB |
|
|0x08077000 ~ 0x08078000 | OTA_FLAG | 4KB |
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -486,14 +486,15 @@ static void BootLoaderJumpApp(void)
|
||||||
|
|
||||||
if(p_ota_info->lastjumpflag == JUMP_FAILED_FLAG)
|
if(p_ota_info->lastjumpflag == JUMP_FAILED_FLAG)
|
||||||
{
|
{
|
||||||
mcuboot.print_string("\r\n------Jump to app partition failed,start version rollback!------\r\n");
|
|
||||||
if(XIUOS_FLAH_ADDRESS == DOWN_FLAH_ADDRESS)
|
if(XIUOS_FLAH_ADDRESS == DOWN_FLAH_ADDRESS)
|
||||||
{
|
{
|
||||||
|
mcuboot.print_string("\r\n------Jump to app partition failed, retry download!------\r\n");
|
||||||
p_ota_info->status = OTA_STATUS_BOOT_DOWNLOAD;
|
p_ota_info->status = OTA_STATUS_BOOT_DOWNLOAD;
|
||||||
UpdateOTAFlag(p_ota_info);
|
UpdateOTAFlag(p_ota_info);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
mcuboot.print_string("\r\n------Jump to app partition failed,start version rollback!------\r\n");
|
||||||
BackupVersion();
|
BackupVersion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1514,6 +1515,8 @@ void ota_entry(void)
|
||||||
extern int InitHwLte(void);
|
extern int InitHwLte(void);
|
||||||
InitHwLte();
|
InitHwLte();
|
||||||
#endif
|
#endif
|
||||||
|
app_clear_jumpflag();
|
||||||
|
|
||||||
mcuboot.print_string("ota_entry to XiUOSStartup\r\n");
|
mcuboot.print_string("ota_entry to XiUOSStartup\r\n");
|
||||||
extern int XiUOSStartup(void);
|
extern int XiUOSStartup(void);
|
||||||
XiUOSStartup();
|
XiUOSStartup();
|
||||||
|
|
Loading…
Reference in New Issue