[其他ST产品] 将控制从BL转移到APP时发生严重故障

[复制链接]
41|2
手机看帖
扫描二维码
随时随地手机跟帖
elephant00|  楼主 | 2022-1-7 10:54 | 显示全部楼层 |阅读模式
设备-STM32H7B3I-DK
项目-STM32H7B3I-DK\应用程序\2_Images_ExtFlash

将控制从BL转移到APP时发生严重故障

1)最后的代码跟踪
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]launch_application[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]:
  • [color=var(--lwc-codeSnippetColorRed,#C23934)]/******************************************************
  • [color=var(--lwc-codeSnippetColorRed,#C23934)]* return from exception to application launch function
  • [color=var(--lwc-codeSnippetColorRed,#C23934)]* R0: application vector address
  • [color=var(--lwc-codeSnippetColorRed,#C23934)]* R1: exit function address
  • [color=var(--lwc-codeSnippetColorRed,#C23934)]* push interrupt context R0 R1 R2 R3 R12 LR PC xPSR
  • [color=var(--lwc-codeSnippetColorRed,#C23934)]*******************************************************/
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        MOV R2[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)],[color=var(--lwc-codeSnippetColorBlack,#000000)] [color=var(--lwc-codeSnippetColorRed,#C23934)]#0x01000000 /* xPSR activate Thumb bit */
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R2[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        MOV R2[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)],[color=var(--lwc-codeSnippetColorBlack,#000000)] [color=var(--lwc-codeSnippetColorRed,#C23934)]#1
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        BIC R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)],[color=var(--lwc-codeSnippetColorBlack,#000000)] R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)],[color=var(--lwc-codeSnippetColorBlack,#000000)] R2      [color=var(--lwc-codeSnippetColorRed,#C23934)]/* clear least significant bit of exit function */
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}[color=var(--lwc-codeSnippetColorBlack,#000000)]           [color=var(--lwc-codeSnippetColorRed,#C23934)]/* return address = application entry point */
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        MOV R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)],[color=var(--lwc-codeSnippetColorBlack,#000000)] [color=var(--lwc-codeSnippetColorRed,#C23934)]#0          /* clear other context registers */
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R1[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        PUSH [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]{[color=var(--lwc-codeSnippetColorBlack,#000000)]R0[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)]}[color=var(--lwc-codeSnippetColorBlack,#000000)]           [color=var(--lwc-codeSnippetColorRed,#C23934)]/* R0 = application entry point */
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        MOV LR[color=var(--lwc-codeSnippetColorBrown,#8F6D4D)],[color=var(--lwc-codeSnippetColorBlack,#000000)] [color=var(--lwc-codeSnippetColorRed,#C23934)]#0xFFFFFFF9 /* set LR to return to thread mode with main stack */
  • [color=var(--lwc-codeSnippetColorBlack,#000000)]        BX LR               [color=var(--lwc-codeSnippetColorRed,#C23934)]/* return from interrupt */
  • [color=var(--lwc-codeSnippetColorBrown,#8F6D4D)].[color=var(--lwc-codeSnippetColorBlue,#005FB2)]end
LR值,SP
renditionDownload?rendition=THUMB720BY480&versionId=0683W00000ItZL9&operationContext=CHATTER&contentId=05T3W00000wTtn8&page=0.jpg
堆栈指针的内存:
8992261d7ab0dac6a5.png
2) LR : 0xFFFF.FFF9从处理程序模式返回,所以NVIC可以解除堆栈PC,R0-R3,R12,LR,xPSR

PC:0x8020400看起来应用程序启动是正确的

3)应用程序内存在0x8020400
renditionDownload?rendition=THUMB720BY480&versionId=0683W00000ItZNA&operationContext=CHATTER&contentId=05T3W00000wTtre&page=0.jpg

这看起来也很好。

任何帮助调试这个硬故障将不胜感激。


使用特权

评论回复
fangyuanshan| | 2022-1-7 14:45 | 显示全部楼层
一堆打印信息实在没耐心看。
尝试在bl关闭所有中断后再跳转到app试试能否解决问题。

使用特权

评论回复
香水城| | 2022-1-7 14:59 | 显示全部楼层
调整前建议将Cache先关闭掉。

使用特权

评论回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则