Hard Fault trap happens when Boot jump into Bsw

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hard Fault trap happens when Boot jump into Bsw

Jump to solution
616 Views
yinqiu
Contributor III

dear:

I meet a problem about hardfault.

after bootload erase and write bsw into PFLASH and boot reset after get UDS 11 01 command.

boot will check the integrity of bsw ,if bsw integrity check by boot is OK, boot will jump into the _start address of startup_cm7.s file of bsw. then hardfault trap happens.

is there any posibility for example the MCU in the runmode?

thanks.

0 Kudos
Reply
1 Solution
529 Views
yinqiu
Contributor III
0 Kudos
Reply
5 Replies
579 Views
yinqiu
Contributor III

dear :

I want to add some information: I have two indendent software in the PFLASH, one is boot and another is bsw. both boot and bsw have _start function which is the start point of each software.

If software stop at the startpoint of  main function and I change the PC as the _start value of BSW, then software will run in bsw and I can see the CAN frame send out(software in boot will not send out CAN frame if boot does not get UDS frame). 

if boot finish the bsw integrity check ,boot will jump into bsw and I take use of _start of bsw which I mean boot take use the value of _start of bsw as the function point and run the

*(function point ) after the *(function point ) excuted , trap happend. I suspect the MCU_Init has some side effect ,so before excuting *(function point ), Boot trriger the MCU_PerformReset function, after the reset ,boot will excute *(function point ),but the trap till happens.

 

0 Kudos
Reply
566 Views
yinqiu
Contributor III

hello ,

do you know the register about xpsr, if the software stop at the _start of bsw and I change the value of xpsr as 0x81000000, and the bsw can runs otherwise the bsw will trap at _start.

0 Kudos
Reply
550 Views
yinqiu
Contributor III

after MCU reset , the value of xpr is 0x8100 0000 and before the jump into _start of bsw ,the value od xpsr is 0xA100 0000. after excuting jump fucntion and PC stop at _start function of bsw, the value of xpsr is 0xA000 0000.

if xpsr is either 0x8100 0000 or 0xA100 0000, the _start function can run well.

if xpsr is 0xA000 0000,_start will trigger hardfault trap.

0 Kudos
Reply
533 Views
yinqiu
Contributor III

已解决: How to jump to APP code from BOOT. - NXP Community

I try to jump into the vector address +4 rather than _start address, but still fail into fault hard trap.

0 Kudos
Reply
530 Views
yinqiu
Contributor III

I finish this task:

refer to :

S32K144 boot jump to app fail - NXP Community

and

已解决: How to jump to APP code from BOOT. - NXP Community

take use of reset and the jump addres is vector+4.

0 Kudos
Reply