你的浏览器版本过低,可能导致网站不能正常访问!为了你能正常使用网站功能,请使用这些浏览器。
eagle0754 发表于 2017-12-13 08:35 The stack pointer for stack 'CSTACK' (currently 0x20022CD8) is outside the stack range (0x200003B0 t ...
查看全部评分
任风吹吹 发表于 2017-12-13 10:24 楼主,你的option byte nDBANK的值多少?
wofei1314 发表于 2017-12-13 11:41 请参照我贴的代码,完成擦除Flash之后,写入数据,然后跳转的时候直接设置Boot位置....软复位即可跳转 ...
hpdell 发表于 2017-12-13 21:43 现在可以实现 app 无系统的程序跳转了,带系统的程序跳转貌似还是不行, 在 iap 程序跳转前,需要关闭
wofei1314 发表于 2017-12-14 10:42 这个和我贴的原理不一样啊,这种是原始方式的... F7的可以通过向Flash写入boot地址数据,重启之后直接从 ...
好的,多谢多谢啊
你好,我放在 app 地址 的值如下:
0x08020000 - 0x08080000 表示 app的起始地址
// 根据不同的 用户 app 的地址,仿真得到的结果值
JumpAddress = ((*(__IO uint32_t*) 0x08080000 ) & 0x2FFE0000 ); // = 0x20020000 仿真后得到的结果值
JumpAddress = ((*(__IO uint32_t*) 0x08060000 ) & 0x2FFE0000 ); // = 0x2FFE0000 仿真后得到的结果值
JumpAddress = ((*(__IO uint32_t*) 0x08040000 ) & 0x2FFE0000 ); // = 0x2D700000 仿真后得到的结果值
JumpAddress = ((*(__IO uint32_t*) 0x08020000 ) & 0x2FFE0000 ); // = 0x2F3E0000 仿真后得到的结果值
这个又说明什么情况啊 ??
评分
查看全部评分
我现在app 的运行地址是 0x08040000 这个,我现在 吧 iAp 程序大小减小到 < 256KB了
现在操作 擦除 扇区的 起始扇区号为 FLASH_SECTOR_5 ,结束
FLASH_SECTOR_11 - FLASH_SECTOR_5 + 1
好的,我参考一下,多些多谢啊
现在可以实现 app 无系统的程序跳转了,带系统的程序跳转貌似还是不行,
在 iap 程序跳转前,需要关闭
void Jump_To_APP(void)
{
//检测APP地址是否合法
printf("\r\n_______ *** *** Jump to the new program run please ... *** ***_______\r\n\r\n");
// 判断栈顶地址是否在0x2000 0000 - 0x2000 2000之间,这个判断也可以使用,完全木有任何问题的
if (((*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS ) & 0x2FFE0000 ) == 0x20000000)
{
// 通过判断栈顶地址值是否正确来判断是否已经下载用户应用程序。因为用户程序的启动文件开始会初始化栈空间,如果栈顶地址正确,说明用户程序已经下载
// __ASM("CPSID I");
// Jump to user application
JumpAddress = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);// 前4字节为中断向量表
Jump_To_Application = (pFunction) JumpAddress;// 指向用户程序复位函数所在的地址
// 关闭所有外设中断
HAL_NVIC_DisableIRQ(ETH_IRQn);
HAL_NVIC_DisableIRQ(USART1_IRQn); //关闭串口中断
HAL_NVIC_DisableIRQ(SD_IRQn);
HAL_NVIC_DisableIRQ(SD_DMAx_Rx_IRQn);
HAL_NVIC_DisableIRQ(SD_DMAx_Tx_IRQn);
PWM_Stop();
HAL_FLASH_Lock();
__disable_irq(); //关闭总中断
{
/*
Reset of all peripherals
这些外设关闭非常重要,否则不能够正常实现程序跳转功能,切记切记
*/
__APB1_FORCE_RESET();
__APB1_RELEASE_RESET();
__APB2_FORCE_RESET();
__APB2_RELEASE_RESET();
__AHB1_FORCE_RESET();
__AHB1_RELEASE_RESET();
__AHB2_FORCE_RESET();
__AHB2_RELEASE_RESET();
__AHB3_FORCE_RESET();
__AHB3_RELEASE_RESET();
HAL_RCC_DeInit();
}
__set_PSP(*(volatile uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
__set_CONTROL(0);
//设置APP程序堆栈指针
__set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS); // 设置用户程序的栈指针
__set_CONTROL(0);
SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; // 关闭滴答定时器中断
SysTick->VAL = 0;
SysTick->LOAD = 0;
Jump_To_Application(); // 执行用户程序
}
else
{
printf("jump uaer app run error ??\r\n");
for(;;)
{}
}
}
现在 app 程序带 系统的,跳转会失败,还需要关闭哪些 功能啊 ????????
这个和我贴的原理不一样啊,这种是原始方式的...
F7的可以通过向Flash写入boot地址数据,重启之后直接从新的Boot启动,无需关中断啥的...理论上和APP有没有系统无关
你好,你贴的这段代码我貌似没有看懂啊 ?