解决自动更新bootloader死机的问题

软件版本2.00
This commit is contained in:
ranchuan
2023-10-16 10:11:03 +08:00
parent 35f6597d97
commit 54bc5b44ac
5 changed files with 53 additions and 35 deletions

View File

@@ -212,4 +212,7 @@
app启动时如果boot魔数校验错误则自动升级bootloader
2023.10.15
添加单独注码命令,实现检测时注码
2023.10.16
解决自动更新bootloader死机的问题
软件版本2.00

View File

@@ -6,7 +6,7 @@
#define BUILD_DATE "2023-10-15 20:45:20"
#define BUILD_DATE "2023-10-16 09:54:53"
#define SOFT_VERSION "2.00"

View File

@@ -21,18 +21,18 @@
#include "compiler_info.h"
#include "elec_det.h"
static const uint8_t ALIGN(4) g_bootcode[]={
#include "bootcode.txt"
};
// 升级bootloader
static void boot_updata(void)
{
const uint8_t ALIGN(4) bootcode[]={
#include "bootcode.txt"
};
if(sizeof(bootcode)==0)
if(sizeof(g_bootcode)==0)
return;
if(bk_check_magic_num())
{
flash_updata_boot((uint8_t *)bootcode,sizeof(bootcode));
flash_updata_boot((uint8_t *)g_bootcode,sizeof(g_bootcode));
bk_reboot_app();
}
}
@@ -194,6 +194,11 @@ static int sysinfo(list_def *argv)
cmd_print("watch dog: %s",bk_wdog_fun()?"on":"off");
cmd_print("reboot times: %d",bk_reboot_times());
cmd_print("bootloader: %s",(bk_check_magic_num()==0)?"ok":"err");
#ifdef DEBUG
cmd_print("debug: %s","yes");
#else
cmd_print("debug: %s","no");
#endif
print_sys_param(par);
return 0;
}