stm32f051c8的IAP跳转APP,串口输入输出没反应?

2019-07-21 08:20发布

IAP的例子是从官网下载的。AN4065里有详细说明,这部分不需要过多修改,直接下载到stm32f051最小系统里就是了。
使用windows自带的串口通信工具,超级终端,采用ymodem协议,顺利发送app生成的可执行bin文件。那么问题来了。app工程软延时正常,灯闪烁可见,却不见发送字节;

串口输入中断也是没有反应的。如果把IAP_Set();去掉,正常运行,闪灯、串口中断输入、输出都是正常的。IAP_Set();这个函数也参考了其他网站的资料。
[mw_shl_code=c,true]#define APPLICATION_ADDRESS ((uint32_t)0x08003000) /* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/ #if (defined ( __CC_ARM )) __IO uint32_t VectorTable[48] __attribute__((at(0x20000000))); #elif (defined (__ICCARM__)) #pragma location = 0x20000000 __no_init __IO uint32_t VectorTable[48]; #elif defined ( __GNUC__ ) __IO uint32_t VectorTable[48] __attribute__((section(".RAMVectorTable"))); #elif defined ( __TASKING__ ) __IO uint32_t VectorTable[48] __at(0x20000000); #endif void IAP_Set() { uint32_t i = 0; /* Copy the vector table from the Flash (mapped at the base of the application load address 0x08003000) to the base address of the SRAM at 0x20000000. */ for(i = 0; i < 48; i++) { *((uint32_t*)(0x20000000 + (i << 2)))=*(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2)); } /* Enable the SYSCFG peripheral clock*/ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); //RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE); /* Remap SRAM at 0x00000000 */ SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM); } int main(void) { LED_Init(); USART_Configuration(); //?è???????ò??±í???????? 0x3000 IAP_Set(); LED_Init(); USART_Configuration(); while(1) { LED_Open();//?ò??led?? delay(); UART_send_byte(0x31); LED_Close();//????led?? delay(); UART_send_byte(0x33); } } [/mw_shl_code]

有的说官网的RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);应该换成 RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);就能解决进不了中断的问题。
 
试了试,没啥效果。
keil5.14生产bin的配置有别于4.xx版本。(用keil5.14版本可以解决5.12,5.10版本代码转换不正确的问题。)


app配置如下图:


搞了2天也没弄出来,想着又该阑尾了,希望大家搞过M0的IAP,进入APP还能相应中断的高手来指导指导,哪里出了问题啊?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
6条回答
正点原子
1楼-- · 2019-07-21 14:13
帮顶。。。。
wenlong0601
2楼-- · 2019-07-21 18:50
哪位大神可以帮我看看吗?小弟不胜感激。
wenlong0601
3楼-- · 2019-07-22 00:39
 精彩回答 2  元偷偷看……
wenlong0601
4楼-- · 2019-07-22 00:43
看看。
BigDiong
5楼-- · 2019-07-22 04:15
wenlong0601 发表于 2016-2-25 10:09
看看。

我是串口中断能响应,定时器中断没有响应。这是为什么?把地址改回08000000,中断映射到ram,一切正常。但是一旦改到0x08003000,中断映射到这个地址就不行。你最后搞定了吗?
yujianbo
6楼-- · 2019-07-22 09:41
我也是用原子的底,现在50K的程序写好了,卡死在IAP。有 大神 解决的方法吗?

一周热门 更多>