How to read stack pointer, Link register and program counter value for S32K146 (Arm Cortex-M4)

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

How to read stack pointer, Link register and program counter value for S32K146 (Arm Cortex-M4)

2,257 次查看
pratheek_b
Contributor II

How to read the below registers value?

1) Stack pointer(SP) - R13
2) Link Register(LR) - R14
3) Program Counter - R15
4) Exception and Reset Control Registers
5) Program Status Register

 

@S32k146, @ArmCortexM

0 项奖励
1 回复

2,245 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @pratheek_b,

Do you want to read it with the core in C?

If so. use inline assembler.

You can refer to this example:

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

fault_exceptions.c

 

BR, Daniel

0 项奖励