Modify ota readme

This commit is contained in:
songyanguang 2025-06-20 11:00:07 +08:00
parent c5aa020398
commit fb1cf06b6e
3 changed files with 16 additions and 4 deletions

View File

@ -78,7 +78,7 @@ void readRomConfiguration(void) {
if ((CFG->cfgFlag[0] != checkcode1) || (CFG->cfgFlag[1] != checkcode2)) {
CFG_ERASE(PAGE_WRITE_START_ADDR, FLASH_PAGE_SIZE);
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
}

View File

@ -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
> 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 |
|0x08077000 ~ 0x08078000 | OTA_FLAG | 4KB |

View File

@ -486,14 +486,15 @@ static void BootLoaderJumpApp(void)
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)
{
mcuboot.print_string("\r\n------Jump to app partition failed, retry download!------\r\n");
p_ota_info->status = OTA_STATUS_BOOT_DOWNLOAD;
UpdateOTAFlag(p_ota_info);
}
else
{
mcuboot.print_string("\r\n------Jump to app partition failed,start version rollback!------\r\n");
BackupVersion();
}
}
@ -1514,6 +1515,8 @@ void ota_entry(void)
extern int InitHwLte(void);
InitHwLte();
#endif
app_clear_jumpflag();
mcuboot.print_string("ota_entry to XiUOSStartup\r\n");
extern int XiUOSStartup(void);
XiUOSStartup();