ui设计简介,网站优化推广软件,培训培训网站建设,旅游网站建设风格为了方便在APP中跳转到Boot重新进行升级#xff0c;有两种办法#xff0c;7840同样可以使用。 1. 调用reset接口进行复位#xff0c;复位后会先进Boot#xff0c;再自动跳转到App。
NVIC_SystemReset();
2. 直接使用跳转指令#xff0c;参考Boot跳转到App代码#xff0…为了方便在APP中跳转到Boot重新进行升级有两种办法7840同样可以使用。 1. 调用reset接口进行复位复位后会先进Boot再自动跳转到App。
NVIC_SystemReset();
2. 直接使用跳转指令参考Boot跳转到App代码把跳转地址改一下即可然后在App中调用JumpTOBoot。
代码如下
#define IAP_BOOTLOAD_ADDRESS 0x8000000 /* define bootload start address */
typedef void (*pFunction)(void);
static pFunction s_jumpToApplication;void JumpTOBoot(void)
{uint32_t JumpAddress;if (((*(__IO uint32_t *)APP_ADDRESS) 0x2FFE0000) 0x20000000){__ASM(CPSID I); // 关全局中断JumpAddress *(__IO uint32_t *)(IAP_BOOTLOAD_ADDRESS 4); // Jump to user applications_jumpToApplication (pFunction)JumpAddress; // Initialize user applications Stack Pointer__set_MSP(*(__IO uint32_t *)IAP_BOOTLOAD_ADDRESS);s_jumpToApplication(); /* jump to app */}else{printf(top of stack pointer is unvalid! enter Boot update!\r\n);return;}while (1);
}