Skip to main content
Grogu
Associate III
January 6, 2022
Solved

HardFault when transfer control from BL to APP

  • January 6, 2022
  • 1 reply
  • 833 views

Hi,

Device - STM32H7B3I-DK

Project - STM32H7B3I-DK\Applications\2_Images_ExtFlash

HardFault when transfer control from BL to APP

1) Last trace of code

launch_application:
/******************************************************
* return from exception to application launch function
* R0: application vector address
* R1: exit function address
* push interrupt context R0 R1 R2 R3 R12 LR PC xPSR
*******************************************************/
 MOV R2, #0x01000000 /* xPSR activate Thumb bit */
 PUSH {R2}
 MOV R2, #1
 BIC R1, R1, R2 /* clear least significant bit of exit function */
 PUSH {R1} /* return address = application entry point */
 MOV R1, #0 /* clear other context registers */
 PUSH {R1}
 PUSH {R1}
 PUSH {R1}
 PUSH {R1}
 PUSH {R1}
 PUSH {R0} /* R0 = application entry point */
 MOV LR, #0xFFFFFFF9 /* set LR to return to thread mode with main stack */
 BX LR /* return from interrupt */
.end

Value of LR,SP

0693W00000HqonPQAR.png 

Memory of stack pointer : 0693W00000HqonyQAB.png 

2) LR : 0xFFFF.FFF9 return from Handler mode so NVIC does unstacks PC, R0-R3, R12, LR, xPSR

PC : 0x8020400 looks correct for APP launch

3) Application memory at 0x8020400

0693W00000HqopGQAR.pngWhich also looks about right.

Any help debugging this HardFault would be appreciated.

Thanks in Advance.

This topic has been closed for replies.
Best answer by Grogu

My bad the bootloader is actually making a jump to the application. UART configuration of application(Sample application) is corrupted somehow when it transfers control and its not printing the data.

Closing the ticket

1 reply

Grogu
GroguAuthorBest answer
Associate III
January 7, 2022

My bad the bootloader is actually making a jump to the application. UART configuration of application(Sample application) is corrupted somehow when it transfers control and its not printing the data.

Closing the ticket