MPC5743R boot与app之间互相跳转问题

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

MPC5743R boot与app之间互相跳转问题

Jump to solution
651 Views
gaoqy
Contributor I

MPC5743R boot与app之间互相跳转,带仿真器可以正常运行,脱掉仿真器就不运行,

0 Kudos
1 Solution
585 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Ok, in general, that should be correct.

But are you able to attach a debugger as I already mentioned? This is the key point to understand what happened. There may be thousands of reasons for such behavior and this could move us forward.

Regards,

Lukas

View solution in original post

0 Kudos
5 Replies
635 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @gaoqy 

first of all, do you disabled interrupt before the jump? I mean on all levels - by MSR[EE], by priorities in INTC, by local enable bits in peripherals. It's also good idea to put everything back to default state before the jump.

If you attach a debugger without reset in this situation, what can you see? Was any exception triggered?

If you use S32DS, you can take a look at:

https://community.nxp.com/t5/S32-Design-Studio/How-attach-to-running-program/m-p/1030375

Regards,

Lukas

0 Kudos
624 Views
gaoqy
Contributor I

Hi:

Thank you for your reply.I don't understand the meaning of interface configuration in the link.

I have a “boot” program and an “app” program,I use the PE simulator to download the boot program to the controller, then run the program, and then use another upper computer software to download the S19 file of the app program,After downloading, the program will jump out of the boot program, run the app program, and send a frame of CAN data, indicating that the application program is running normally.

At this time, I cut off the power supply, unplug the PE simulator, and then power up and run. I only received one frame of CAN data entering the boot program, and did not jump to the app program, because I did not receive the data sent by the app program.

The off interrupt command I use is “__asm__(" wrteei 0");”,It has been shut down before jumping to the app program.

My settings are as follows:

gaoqy_0-1678843483914.png

 

0 Kudos
600 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @gaoqy 

I have to stick to my previous response.

“__asm__(" wrteei 0");” is not enough. The interrupts needs to be de-initialized completely on all levels. I met a lot of similar issues caused by this, so this is my very strong recommendation. Deinitialization of other features is also recommended. If it works with PE attached, it may be just coincidence.

And next mentioned step - attach the debugger after power-on to see what happened exactly.

Regards,

Lukas

0 Kudos
593 Views
gaoqy
Contributor I

First of all, thank you for your patience

For testing, I only initialized CAN0 and CAN3. CAN0 is not interrupted and is only used to send data. CAN3 is interrupted to receive S19 files and send confirmation information.

Before jumping to the app program, I disabled the CAN0 and CAN3 modules and shut them down before jumping to the app program。

void Prepare_Before_Jump(void)
{
        flexcan_0_deinit_fnc();
        flexcan_3_deinit_fnc(); /*shutdown the MSCAN module*/
        __asm__(" wrteei 0 "); /*disable the CPU interrupt*/
       CleanRAM(); /*clean the bootloader used RAM for NVM driver*/
}

Execute Prepare_ Before_ Jump(); After that, execute the app_ entry();

0 Kudos
586 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Ok, in general, that should be correct.

But are you able to attach a debugger as I already mentioned? This is the key point to understand what happened. There may be thousands of reasons for such behavior and this could move us forward.

Regards,

Lukas

0 Kudos