Finally, I worked out my boot loader and APP on MPC5748G. And everything is ok when debugging with PE multilink. I can upgrade my APP with upper-tool written by myself.
But there is still a problem:
After I upgrade APP, then it will do a software reset, and then jump to APP successfully. And then if I re-power my board, sometimes it can't jump to APP. The fail rate is about 50%-70%. My IDE is S32DS, and it doesn't have hardware reset feature like TI CCS which make me difficult to trouble shooting for this issue.
So I debug this issue by light LED in boot loader startup code and APP startup code, the result shows that sometimes, the code stunk at boot loader startup code, sometimes APP startup code.
The attached file are startup codes. I will appreciate that if anyone can help to review them.
The screenshot shows the flow chart when there are both boot loader code and APP code inside ECU.
Original Attachment has been moved to: startup_BLD.S.zip
Original Attachment has been moved to: startup_APP.S.zip
I can see that you read RAM memory right after the startup in bootloader:
This will work if the RAM is initialized (when SW reset was triggered by application). But it will not work after power-on. You have to check the RGM_FES register to check the source of reset. If it was software reset, you can read the RAM. If not, it will probably lead to ECC error:
I didn't study the files in detail, it's just the first thing I can see. Could you check this?