How do you do handshaking when turning off cores?

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

How do you do handshaking when turning off cores?

NXP Employee
NXP Employee

Hi Martin Kovar,

I am using the MPC5748G.  I want to program the z4a core to turn off z4b for DRUN mode.  So I cleared MC_ME_CCTL[DRUN] and then transition modes from DRUN to DRUN.  It can get stuck within mode transition if z4b is not ready to be turned off. The reference manual says the z4a would have to perform some sort of handshaking to make sure that the core to be turned off is ready to be turned off.  How would this handshaking be performed?  How would z4a communicate to z4b? What conditions must be met by z4b for it to be ready?  Thanks.

Labels (1)
1 Reply

NXP Employee
NXP Employee

Hi David,

I tried the use case with default S32DS multicore project and it works correct. In default project, all three cores are started during startup using hw_init function. Then I used following code in Z4a core:

MC_ME.CCTL[2].R = 0x00F5; //disable core for drun mode

MC_ME.MCTL.R = 0x30005AF0;         //DRUN Mode & Key

MC_ME.MCTL.R = 0x3000A50F;         //DRUN Mode & Key

while(MC_ME.GS.B.S_MTRANS);         //Waiting for end of transaction

while(MC_ME.GS.B.S_CURRENT_MODE != 0x3); // ME_GS Check DRUN mode has successfully been entered

After mode transition is complete, you can also check MC_ME_CS register. Bit S_CORE2 should be 0.

About handshaking, it is application dependent. For example if you do not want to disable z4b core before some event, so you can use semaphore or another synchronization element. This is the meaning of software handshaking.

Could you please send me some simple project, which shows your issue?