MCU Xpresso gcc toolchain null pointer issue

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

MCU Xpresso gcc toolchain null pointer issue

604 Views
anujtanksali
Contributor II

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

Labels (1)
Tags (1)
0 Kudos
1 Reply

503 Views
Takashi_Kashiwagi
Senior Contributor I

Hi Anuji-san.

In i.MXRT 1064, 0x00000000 - 0x0007FFFF is ITCM. So you can write to 0x00000000.

pastedImage_1.png  

Best Regards,

T.Kashiwagi

0 Kudos