Dual core function or setting based on S32K358

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

Dual core function or setting based on S32K358

2,239 Views
BillWen
Contributor II

Hi :

I am interesting in dual core function based on s32k358, is there any related documents or example that I can check?

The following MCU setting is my project now, I think I use core2 only, I want to know if I want some tasks run at core1 and some run at core2, what should I do?

BillWen_0-1743387184273.png

The other question is Can I run a project with lock-step and dual-core functions in the same time?

 

Thanks

BR, BillWen

 

0 Kudos
Reply
14 Replies

2,163 Views
BillWen
Contributor II

Hi Petervlna:
Thanks for your reply.
I still can not understand about how to set the MCAL MCU for dual-core. But I know it would be one project two folder if I want to use dual core, I want to know about the following part how to set, is this related to dual core?

BillWen_0-1744251552704.png

 

Thanks

BR, BillWen

 

0 Kudos
Reply

2,153 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Ok, so you want static assignment of MCAL driver tasks to the cores?

For such you will need OS with such capability.

Best regards,

Peter

0 Kudos
Reply

2,141 Views
BillWen
Contributor II
Hi Peter:
Our purpose is whole BMS run on core0 and lockstep core1, and some monitor run on core2.
For example, I want ADC Group 1 controlled by core2, and ADC2 and ADC 3 controlled by core0, something like this.
If I want to use core0 and core2, my project name should be the following rule?
HVBMS_RD_IntProj_774_772_K358_S32DS_0_0
&
HVBMS_RD_IntProj_774_772_K358_S32DS_0_2

Thanks
BR, BillWen
0 Kudos
Reply

2,065 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I was looking into this and the only way is to have 2 separate projects. One for each core.

So you will have 2 linkers and 2 output files which you will load into micro.

one project for autosar and the other for complex drivers.

I want ADC Group 1 controlled by core2, and ADC2 and ADC 3 controlled by core0, something like this.
If I want to use core0 and core2, my project name should be the following rule?

I see only rule here is resource sharing. So if you assign the ADC1 to core 2 then make sure you do not have resource conflict with core0.

best regards,

Peter

0 Kudos
Reply

2,051 Views
BillWen
Contributor II
Hi petervlna:

Thanks for your reply.
I already can flash the image into core0 and core2 independently. I used s32k358 bringup project to modify and add a new linker file for core2.
My next step is flash core0 and core2 in the same time and run together.
Do you have any experience on this? Should I open all of the multicore support configuration?

Btw, I already start to study S32K32X Multicore Quick Start Guide and Multi-Core support in RTD for S32K3 documents.
Thanks
BR, BillWen
0 Kudos
Reply

2,028 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Not personally as I work with Lauterbach and I am writing multicore scripts for such purpose.

But in S32DS is such possibility:

You can place multiple efls in the launch group

petervlna_2-1744785978159.png

 

petervlna_1-1744785948436.png

Best regards,

Peter

0 Kudos
Reply

2,005 Views
BillWen
Contributor II
Hi Petervlna:
Thanks for your reply.
I have another question.
I’m using S32K358 and trying to boot only CM7_2 (Core2) without enabling CM7_0 (Core0).
However, when I disable CM7_0 and flash the application to CM7_2, the chip seems to lock up and I get “Secure Debug Access Denied”.
After I use j-link to erase, then I can access it again.

So I want to confirm:
Is it possible to run Core2 standalone, without enabling Core0?
Or is CM7_0 always required to be active first before Core2 can start properly?

Thanks
BR, BillWen
0 Kudos
Reply

1,945 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Ok, and do you have a boot core at the start address of Core2?

Is it possible to run Core2 standalone, without enabling Core0?

Yes

Or is CM7_0 always required to be active first before Core2 can start properly?

No, it is not required. But if you do not have boot code at the Core2 boot address, it will crash.

Best regards,

Peter

 

0 Kudos
Reply

1,892 Views
BillWen
Contributor II

Hi Petervina:

Thanks for your help, the following is the figure that I implement 358 tpl bringup project into Dual-core mode.

BillWen_0-1745563929762.png

Left side fun on core0 and right side run on core2.

 

Thanks

BR, BillWen

0 Kudos
Reply

1,890 Views
BillWen
Contributor II
Hi Petervlna
Another question, I already can debug core0 and core2 in the same time, but after I power off then power on , only core 0 run but not core2, do you have any experience about this problem?

Thanks
BR, BillWen
0 Kudos
Reply

1,834 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Hmm, are you performing start of cores from application?

Check the clocks and if the cores are active in ME module.

Best regards,

Peter

0 Kudos
Reply

1,832 Views
BillWen
Contributor II
Hi Peter:

Yes, I want to start from core0 and use the following code to enable core2,

IP_MC_ME->PRTN0_CORE4_ADDR = (uint32)0x00800000;
IP_MC_ME->PRTN0_CORE4_PCONF = MC_ME_PRTN0_CORE4_PCONF_CCE_MASK;
IP_MC_ME->PRTN0_CORE4_PUPD = MC_ME_PRTN0_CORE4_PUPD_CCUPD_MASK;
IP_MC_ME->CTL_KEY = 0x5AF0U;
IP_MC_ME->CTL_KEY = 0xA50FU;
while (IP_MC_ME->PRTN0_CORE4_PUPD == 1) { };
while ((IP_MC_ME->PRTN0_CORE4_STAT & MC_ME_PRTN0_CORE4_STAT_CCS_MASK) == 0) { };

Check the clocks and if the cores are active in ME module.
I'm not sure about this, can you tell me more detailed ?

Thanks
BR, BillWen
0 Kudos
Reply

1,779 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Yes, I want to start from core0 and use the following code to enable core2,

I am not familiar with code/driver you are using and since there are only macros I cant judge.

Simple follow the RM for core enable:

petervlna_1-1745916880329.pngpetervlna_2-1745916915009.png

 

Check the clocks and if the cores are active in ME module.
I'm not sure about this, can you tell me more detailed ?

46.7.23 Partition 0 Core 2 Status Register (PRTN0_CORE2_STAT)

petervlna_0-1745916712613.png

 

0 Kudos
Reply

2,224 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I am interesting in dual core function based on s32k358, is there any related documents or example that I can check?

I would start from the reading of reference manual and the RTD example projects.

For example MCU module:

petervlna_1-1743405950665.png

The following MCU setting is my project now, I think I use core2 only, I want to know if I want some tasks run at core1 and some run at core2, what should I do?

Well, this is application dependent.

Basically you can write simple scheduler which will execute function on selected core.

Or you can use OS, which will assign the task and resources to the core.

It really depends on how optimized you like to have the code.

The other question is Can I run a project with lock-step and dual-core functions in the same time?

Yes, as you can see there are 3 cores. Two are lockstep and 1 separated.

petervlna_0-1743405502538.png

Best regards,

Peter

 

0 Kudos
Reply