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.
已解决! 转到解答。
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.
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.
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.
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.