Core ID MPC 5668G

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Core ID MPC 5668G

跳至解决方案
1,456 次查看
tim_09
Contributor II


Hi,

 

for my application I need the core IDs of the z6 and z0 core to distinguish between those two. How do I get this IDs in my application?

 

Best regards,

Tim

标签 (1)
0 项奖励
1 解答
1,231 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

this is copied from reference manual for MPC5668G, page 412:

pastedImage_0.png

Page 357:

pastedImage_1.png

Regads,

Lukas

在原帖中查看解决方案

0 项奖励
6 回复数
1,232 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

this is copied from reference manual for MPC5668G, page 412:

pastedImage_0.png

Page 357:

pastedImage_1.png

Regads,

Lukas

0 项奖励
1,231 次查看
tim_09
Contributor II

Hi Lukas,

I've got another question regarding the CoreID. Do you have an example for the processor_number() function which is used in the example above? I don't actually know how to get the ID in my c code.

Regards,

Tim

0 项奖励
1,231 次查看
alexvinchev
Contributor V

In case of GHS compiler you could just use __MFSPR(286)

0 项奖励
1,231 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Tim,

you can use something like this:

unsigned int asm Read_Processor_ID(void)

{   

    mfspr r3,286     /* r3 is used for return value (given by EABI standard for power architecture), so just load the PIR register (SPR 286) to r3 */

}

Then just call the function:

unsigned int CoreID;

CoreID = Read_Processor_ID();

Lukas

0 项奖励
1,231 次查看
tim_09
Contributor II

Hi Lukas,

thank you very much for this example.

Regards,

Tim

0 项奖励
1,231 次查看
tim_09
Contributor II

Hi Lukas,

thanks. That's what I was looking.

Regards,

Tim

0 项奖励