AnsweredAssumed Answered

MCU Xpresso gcc toolchain null pointer issue

Question asked by Anuj Tanksali on Sep 26, 2019
Latest reply on Oct 2, 2019 by Takashi Kashiwagi

Hello,

 

I am using device iMXRT1064 EVK board and using MCU Xpresso 10.3 version and Toolchain used is NXP MCU Tools which uses arm-none-eabi-gcc as command.

I have a small piece of code which is shown below.

 

Int i = 10 ; 

int *p = NULL ;

*p =i;

 

When i debug this program on my 1064 EVK board it does not crash. A value is assigned to a null pointer so pointer does not have a valid address yet. So ideally the program should not run. What could be the issue?

 

 

When i run the same code on a different board using device K22FN1M0 and KDS IDE Ver 3.0 and Toolchain is GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc) the program crashes after *p =i is called. 

 

The GCC version which i get from the command line when arm-none-eabi-gcc --version is called from command line. 

arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]

This should be common for both KDS and MCUXpresso i think. Please let me know if otherwise.

 

Are there any compiler options in MCU Xpresso which can resolve this strange issue.

 

Regards,

 

Anuj

Outcomes