[S32R274] Read core register from other cores

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

[S32R274] Read core register from other cores

418 次查看
kiminkim
NXP Employee
NXP Employee

Hello, all

I would like to access and read Core register(GPRs, LR, Program Counter, etc) from other cores.

For example, Core0 reads Link Register of Core1 or Core2.

Is this possible to read them from other cores?

Furthermore, I want to know the generic instruction how to read Program counter.

Please share any guide that can help.

Thank you

BR

Justin

0 项奖励
1 回复

372 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Justin,

core registers are not memory mapped, so it's not possible to read core registers from other cores. Common way to share data is to use shared memory (and semaphores if necessary to ensure data coherency).

There's no instruction which would allow to read the program counter directly. I'm not sure what is your use-case but if it is really needed, one workaround is to call empty function and then you can read link register. This register will contain return address - current value of program counter. Then you can use mflr instruction.

Regards,

Lukas

0 项奖励