Hi,
I am developed CAN Bootloader for MPC57485G. And now, I want to start CPU1 and CPU2 and perform some other functions in CPU1 and CPU2 after jumping from bootloader to APP (single-core program, CPU0) , how this should be done?
Thanks.
Solved! Go to Solution.
You have two options:
- start CPU1/CPU2 right before jumping to APP0 on CPU0 and then jump to the APP0 on CPU0
- or you can only jump to APP0 on CPU0 and this APP0 can start CPU1/CPU2 as needed in its own code.
Regards,
Lukas
Hi Thomas,
here is an example how to start other cores:
/* Enable e200z4b and e200z2 cores in RUN0-RUN3, DRUN and SAFE modes */
MC_ME.CCTL[2].R = 0x00FC; /* e200z4b is active */
MC_ME.CCTL[3].R = 0x00FC; /* e200z2 is active */
/* Set start address for e200z4b and e200z2 cores */
MC_ME.CADDR[2].R = E200Z4B_BOOT_ADDRESS | 1; /* e200z4b boot address + RMC bit */
MC_ME.CADDR[3].R = E200Z2_BOOT_ADDRESS | 1; /* e200z2 boot address + RMC bit */
/* Mode change - re-enter the DRUN mode to start cores */
MC_ME.MCTL.R = 0x30005AF0; /* Mode & Key */
MC_ME.MCTL.R = 0x3000A50F; /* Mode & Key inverted */
while(MC_ME.GS.B.S_MTRANS == 1); /* Wait for mode entry complete */
while(MC_ME.GS.B.S_CURRENT_MODE != 0x3); /* Check DRUN mode entered */
Regards,
Lukas
Hi, Lukas
But how can I use CPU1 and CPU2 to execute other programs?
Regards,
Lukas
Hi Thomas,
when creating new project in S32DS, you can select which cores are used and you can adjust the memory layout if needed:
Then three projects are created, each with own startup files, own linker file etc...
So you can have three "independent" applications. But it's necessary to keep in mind that the resources are shared.
Regards,
Lukas
Hi, Lukas
I know this, but my question is how do I get CPU1 to run APP1 at the same time after I jump from bootloader to CPU0's APP0.
Thanks.
You have two options:
- start CPU1/CPU2 right before jumping to APP0 on CPU0 and then jump to the APP0 on CPU0
- or you can only jump to APP0 on CPU0 and this APP0 can start CPU1/CPU2 as needed in its own code.
Regards,
Lukas