[S32R274] Read core register from other cores

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

[S32R274] Read core register from other cores

415 Views
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 Kudos
1 Reply

369 Views
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 Kudos