你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

求大神帮助?!

[复制链接]
瞳话heart 提问时间:2015-1-5 21:11 /


我的IAP顺序是这样的:

1.程序启动检查标志
2.更具标志进入IAP
3.擦除用到的页
4.编程数据进FLASH(我的一个bin文件)
5.清除标志位

上面几步都没有问题,顺利的编程进去,但是就是不能引导程序进入,跳转程序是这样写的

#define ApplicationAddress 0x08002000   //应用程序区

int main(void)
{
  /* Setup STM32 system (clock, PLL and Flash configuration) */
  SystemInit();
   
  /*Init Spi*/
  SPI_Flash_Init();
   
  /*USART Init*/
  Usart_init();

  RunRead(STATEADDRESS,0,100,(u8 *)State.InArray);//读SPI Flash         
  if((State.InState.UpdateApption0 + State.InState.UpdateApption1  
         + State.InState.UpdateApption2 + State.InState.UpdateApption3  
         + State.InState.UpdateApption4) > 3)//检查更新标志位,是否需要更新
        {
                UpDateApplication();
        }
  else//跳转到应用程序区
     {         
        /* Test if user code is programmed starting from address "ApplicationAddress" */
         if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)
             { /* Jump to user application */
               JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
                Jump_To_Application = (pFunction) JumpAddress;
                /* Initialize user application's Stack Pointer */
                 __set_MSP(*(__IO uint32_t*) ApplicationAddress);
                Jump_To_Application();
            }
  }            
   /* Infinite loop */
  while (1)
  {
  }
}

程序执行到这句:
/* Test if user code is programmed starting from address "ApplicationAddress" */
    if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)
判断结果为假,下面就得不到执行。。

屏蔽条件判断,直接这样:
      /* Jump to user application */
      JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
      Jump_To_Application = (pFunction) JumpAddress;
      /* Initialize user application's Stack Pointer */
      __set_MSP(*(__IO uint32_t*) ApplicationAddress);
      Jump_To_Application();
执行后。程序就进入了:
void HardFault_Handler(void) 中断

我用官方的IAP程序(AN2557),下载我的bin文件,是可以执行的,为何我的就不能执行呢???

同一个bin文件,烧写在同一个地址!

另再弱弱的问一声:jlink可以读出flash里的内容吗?我怎么找半天找不到在哪读啊?

收藏 评论0 发布时间:2015-1-5 21:11

举报

0个回答

所属标签

相似问题

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
微信公众号二维码 微信公众号
手机版二维码 手机版