Hard Fault trap happens when Boot jump into Bsw

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Hard Fault trap happens when Boot jump into Bsw

跳至解决方案
609 次查看
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 项奖励
回复
1 解答
522 次查看
yinqiu
Contributor III
0 项奖励
回复
5 回复数
572 次查看
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 项奖励
回复
559 次查看
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 项奖励
回复
543 次查看
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 项奖励
回复
526 次查看
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 项奖励
回复
523 次查看
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 项奖励
回复