cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault when transfer control from BL to APP

Grogu
Associate III

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 discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions
Grogu
Associate III

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

View solution in original post

1 REPLY 1
Grogu
Associate III

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