S32K324 seperate core code

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

S32K324 seperate core code

Jump to solution
563 Views
FelixR
Contributor III

Hey there,

I am investigating how to enable and use the dual-core functionality on the S32K324. There are two questions I can't get my head around:

  1. How do I unlock the two cores to act independently of each other? As far as I understand, they start in the lockstep configuration by default, and the DCMROF19[LOCKSTEP_EN] bit tells me if they are in lockstep or decoupled. But that bit is read-only, so where is the point in the configuration where I can decouple?
  2. How do the cores know which code flash area to read code from? They need to execute separate functions, so they need different main routines that reside in different code flash areas. Do I have to jump with one core to the specified code area I want to execute code from, or does each core have a specific code start address?

thanks in advance

0 Kudos
Reply
1 Solution
542 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @FelixR 

If you have S32K324, it’s already in decoupled mode. This device is considered as dual core.

If you have S32K344 then it is in lock step mode by default and it can be configured to work in decoupled mode, so it will become S32K324 in fact. The configuration can be changed by programming of corresponding DCF record in UTEST flash. But as I said, this is not necessary in case of S32K324.

When you create new project for S32K324 in S32 Design Studio, two projects are created. One for each core. Each project has own linker file, own startup files etc.

It is possible to define which cores will start automatically after reset in Boot Configuration Word in IVT (see “32.5.1 Boot configuration word” in the S32K3 reference manual). Addresses of entry point are defined in IVT. Each core has specific address. A core which is not started in this way can be started by software like this:
MC_ME->PRTN0_CORE1_ADDR = (uint32_t)(vtor); //vtor is an address of vector table
MC_ME->PRTN0_CORE1_PCONF = MC_ME_PRTN0_CORE1_PCONF_CCE_MASK;
MC_ME->PRTN0_CORE1_PUPD = MC_ME_PRTN0_CORE1_PUPD_CCUPD_MASK;
MC_ME->CTL_KEY = MC_ME_CTL_KEY_KEY( 0x5AF0);
MC_ME->CTL_KEY = MC_ME_CTL_KEY_KEY(~0x5AF0);

Regards,

Lukas

View solution in original post

0 Kudos
Reply
2 Replies
543 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @FelixR 

If you have S32K324, it’s already in decoupled mode. This device is considered as dual core.

If you have S32K344 then it is in lock step mode by default and it can be configured to work in decoupled mode, so it will become S32K324 in fact. The configuration can be changed by programming of corresponding DCF record in UTEST flash. But as I said, this is not necessary in case of S32K324.

When you create new project for S32K324 in S32 Design Studio, two projects are created. One for each core. Each project has own linker file, own startup files etc.

It is possible to define which cores will start automatically after reset in Boot Configuration Word in IVT (see “32.5.1 Boot configuration word” in the S32K3 reference manual). Addresses of entry point are defined in IVT. Each core has specific address. A core which is not started in this way can be started by software like this:
MC_ME->PRTN0_CORE1_ADDR = (uint32_t)(vtor); //vtor is an address of vector table
MC_ME->PRTN0_CORE1_PCONF = MC_ME_PRTN0_CORE1_PCONF_CCE_MASK;
MC_ME->PRTN0_CORE1_PUPD = MC_ME_PRTN0_CORE1_PUPD_CCUPD_MASK;
MC_ME->CTL_KEY = MC_ME_CTL_KEY_KEY( 0x5AF0);
MC_ME->CTL_KEY = MC_ME_CTL_KEY_KEY(~0x5AF0);

Regards,

Lukas

0 Kudos
Reply
520 Views
FelixR
Contributor III

Hey @lukaszadrapa 

Thanks! That really helped me!

0 Kudos
Reply