S32K3 Find the Currently Executing core ID

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

S32K3 Find the Currently Executing core ID

Jump to solution
2,128 Views
jonnyWHIS
Contributor III

Hi there,

I have a function that i'd like to behave slightly differently depending on which S32K3 core invokes it. At the moment i have a function returning the value of what i thought was the correct register.

In the S32K3xx RM, under MCM Register Descriptions (Chapter 6.4.1) it mentions a Processor Identifier (PID) register. However if i read the value of this register, it returns 0 regardless of which core the read is performed on.

I'm assuming that this is not the correct register, but i cannot find a more relevant one in the manual. Could you advise :

- if it is possible to find the currently executing core ID, and if so

- what register/driver function is required to do this

 

I have both cores running no problem, but maybe there's something more i need to do in the .mex file?

Any help would be appreciated.

0 Kudos
Reply
1 Solution
2,104 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @jonnyWHIS 

The name of the PID register is wrong, I will ask to update it. It should be called Process Identifier, not Processor Identifier. The description of the bits is then correct. It says:
"Process Identifier
Identifies the CPU process."

It can't be used to identify which core is running a code.

For this purpose, you can use register CPXNUM in MCM at address 0x40260004.

It's used in startup files, for example. You can find code like this in startup code:

/* If this is the primary core, initialize data and bss */
ldr r0, =0x40260004
ldr r1,[r0]

ldr r0, =MAIN_CORE
cmp r1,r0
beq _INIT_DATA_BSS

Regards,
Lukas

View solution in original post

0 Kudos
Reply
2 Replies
2,105 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @jonnyWHIS 

The name of the PID register is wrong, I will ask to update it. It should be called Process Identifier, not Processor Identifier. The description of the bits is then correct. It says:
"Process Identifier
Identifies the CPU process."

It can't be used to identify which core is running a code.

For this purpose, you can use register CPXNUM in MCM at address 0x40260004.

It's used in startup files, for example. You can find code like this in startup code:

/* If this is the primary core, initialize data and bss */
ldr r0, =0x40260004
ldr r1,[r0]

ldr r0, =MAIN_CORE
cmp r1,r0
beq _INIT_DATA_BSS

Regards,
Lukas

0 Kudos
Reply
2,076 Views
jonnyWHIS
Contributor III

Hi Lukas, brill thank you, using that CPXNUM register has worked for me.

0 Kudos
Reply