diff --git a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c index eb23113e1..c17c7cc7a 100644 --- a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c +++ b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c @@ -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 } diff --git a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/ota/Readme.md b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/ota/Readme.md index 5cd6ead82..06152c822 100644 --- a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/ota/Readme.md +++ b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/ota/Readme.md @@ -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 | - diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.c b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.c index 8175599ce..84f2f909e 100644 --- a/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.c +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.c @@ -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();