Hello Everyone , I'm trying to initialize the core 1 in S32k324 by Core 0.
I attached my Code here.
I made CM7_1_Enable as 0 in core 0 , according to the start_up file of core 0, clock for core 1 is should not enable in there.
In core 0 main file I'm trying to enable the core clock for core 1 , but before that I'm checking the core1 clock status bit , it is already enabled.
Even I not initialized the CM7_1_Enable in path and symbol core 1 clock is enabled.
#s32
But if try to connect with and flash the core 1 image with debugger with run on reset option, its stuck at wait for clock, then once i enabled the core 1 clock with core 0 , core 1 start running.
1. Why the core clock is enabled even CM7_1_Enable is 0?
2. I need to verify the core 1 clock is enabled by core 0, how can i do that?
void core_one_startup(void)
{
if((IP_MC_ME->PRTN0_CORE1_STAT&0x0001) != 1)
{
printf("Core one not enabled yet");
}
else
{
printf("Core one is enabled"); // Core 1 is always on?
}
IP_MC_ME->PRTN0_CORE1_PCONF |= MC_ME_PRTN0_CORE1_PCONF_CCE_MASK;
IP_MC_ME->PRTN0_CORE1_ADDR = (uint32)AVB_CODE;
IP_MC_ME->PRTN0_CORE1_PUPD |= MC_ME_PRTN0_CORE1_PUPD_CCUPD_MASK;
IP_MC_ME->CTL_KEY = MC_ME_CTL_KEY_KEY( 0x5AF0);
IP_MC_ME->CTL_KEY = MC_ME_CTL_KEY_KEY(~0x5AF0);
while (IP_MC_ME->PRTN0_CORE1_PUPD == MC_ME_PRTN0_CORE1_PUPD_CCUPD_MASK);
/*wait for core1 status*/
while((IP_MC_ME->PRTN0_CORE1_STAT&0x0001) != 1);
}
/*!
\brief The main function for the project.
\details The startup initialization sequence is the following:
* - startup asm routine
* - main()
*/
int main(void)
{
core_one_startup();
return exit_code;
}
Hi @AntoZ,
1. CM7_1_ENABLE = 0 in the IVT/boot header doesn’t guarantee the clock is gated. That flag only controls whether CM7_1 is released at boot given a start address:
.section boot_header" header","ax
.long SBAF_BOOT_MARKER /* IVT marker */
.long (CM7_0_ENABLE << CM7_0_ENABLE_SHIFT) | (CM7_1_ENABLE << CM7_1_ENABLE_SHIFT) /* Boot configuration word */
.long 0 /* Reserved */
.long CM7_0_VTOR_ADDR /* CM7_0 Start address */
.long 0 /* Reserved */
.long CM7_1_VTOR_ADDR /* CM7_1 Start address */
.long 0 /* Reserved */
.long XRDC_CONFIG_ADDR /* XRDC configuration pointer */
.long LF_CONFIG_ADDR /* Lifecycle configuration pointer */
.long 0 /* Reserved */
If CM7_1_ENABLE = 1: CM7_1 is enabled during boot. Debugger can connect to CM7_1 at the beginning.
You should ensure that only the master core can initialize the clock for the MSCM module. So, check if CORE1 is defined in core1 project, and CORE0 in the core0 project.
2. Try comparing the bit instead of the whole register like so:
while (IP_MC_ME->PRTN0_CORE1_PUPD & MC_ME_PRTN0_CORE1_PUPD_CCUPD_MASK) { }
Also, make sure the session uses a destructive reset before the test just in case the debugger is not clearing the registers upon reset.
I imagine you are using the S32K324 Multi-Core Example Projects from community as reference, correct?
Best regards,
Julián
Thank For reply.
1. I Make it CM7_1_Enable =0 , becoz i don't want to execute the following part in start up code
Becoz i want core 0 application needs to enable the core 1.
and core 0 is defined in core 0 project and core 1 is defined in core 1 project
Does the code which i posted is it enough to enable the core 1 clock?
2. And we are using S32k328(Used S32K324 only for testing), in this mcu remote core is core 1 right like not in S32k358(which is core 0 and core 2).
We are using MC_ME.PRTN0_CORE1_PCONF[CCE] to enable the core 1 clock, is it same for s32k328?
Becoz in datasheet there is one more register mentioned for s32k328, I'm confused in here
3. Could u tell how can i make sure my debug section uses a destructive reset?
4. There is lot of project listed in S32k324 multicore Example folder which you posted, could u possible to tell me which project does have the details of enabling the remote core clocks?