Null pointer deference on MPC5674F

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Null pointer deference on MPC5674F

875件の閲覧回数
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 返信

845件の閲覧回数
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