论坛元老
 
- 积分
- 6662
- 金钱
- 6662
- 注册时间
- 2016-5-29
- 在线时间
- 910 小时
|

楼主 |
发表于 2020-10-30 11:30:08
|
显示全部楼层
本帖最后由 操作系统 于 2020-10-30 11:34 编辑
实现 STM32的系统中断,默认是开启的..
GOTOAPP 只是一个程序跳转, 并且 不会触发复位这个事件.
系统并不会复位 总中断那个寄存器.
栈的复位也是程序手工操作的.不是系统自动复位的.
算是有点明白,同时也要谢谢三叶草的回复,支持.
代码最终修改成 这样子:
void gotoApp(void)
{
if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)
{
EA0;//关闭中断使能
dma_channel_disable(DMA_CH2);
usart_disable(USART0);
JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
Jump_To_Application = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) ApplicationAddress);
Jump_To_Application();
}
}
APP 程序里面初始化完成时,强制打开 总中断 使能
就可以正常工作了.
|
|