Null pointer deference on MPC5674F

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

Null pointer deference on MPC5674F

946 次查看
RenatoCorrea
Contributor I

Hi everyone. I'm working on a project using the MPC5674f and can't seem to find a way to generate an exception when a null pointer is deferenced. Is this a possibility? I would be grateful if someone could point me in the right direction

0 项奖励
回复
1 回复

916 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @RenatoCorrea 

No, MPC5674F does not provide such functionality. One workaround I can see - NULL pointer is defined as zero. So, an option is to configure MPU to restrict data access or instruction fetch from address 0. In case of access violation (i.e. your code is trying to read/write data or fetch instruction from address 0), machine check exception would be triggered.

Regards,

Lukas