Use older version of GCC as a compiler

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

Use older version of GCC as a compiler

Jump to solution
1,946 Views
p_a_u_darshana
Contributor III

Hello,

We are using the S32K MBD toolbox for our project, and we want to perform a Misra rule check for the generated C code.

But our Misra rule checking tool does not support the codes compiled by higher version GCC compilers such as GCC 6.x.

1. Is it okay to use GCC 4.9 instead of GCC 6.3?

2. What kind of negative impact can it provide if we use the GCC 4.9?

3. If I want to use GCC 4.9, is it correct to set the System variable as below?

GCC_S32K_TOOL = C:\NXP\S32DS_ARM_v2.2\S32DS\build_tools\gcc_v4.9\gcc-arm-none-eabi-4_9

 

Thank you

Tags (4)
0 Kudos
1 Solution
1,934 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @p_a_u_darshana 

Yes, you can use the GCC 4.9 version with our toolbox. I cannot provide a list with limitations because it has been only tested with the GCC 6.2, the one delivered with our toolbox.

If you need to customize the compiler flags, you can go to our Config Block and under Build Toolchain you can update the GCC flags.

mariuslucianand_0-1636042066149.png

To switch the compiler, you are right, you have to set an environmental variable "GCC_S32K_TOOL" with the value you have mentioned. If you add this variable in Windows' path, don't forget to restart MATLAB to make it aware of this change. To check the new compiler, you can type the following command in MATLAB's Command window: getenv('GCC_S32K_TOOL')

Hope this helps,

Marius
 

 

 

View solution in original post

2 Replies
1,935 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @p_a_u_darshana 

Yes, you can use the GCC 4.9 version with our toolbox. I cannot provide a list with limitations because it has been only tested with the GCC 6.2, the one delivered with our toolbox.

If you need to customize the compiler flags, you can go to our Config Block and under Build Toolchain you can update the GCC flags.

mariuslucianand_0-1636042066149.png

To switch the compiler, you are right, you have to set an environmental variable "GCC_S32K_TOOL" with the value you have mentioned. If you add this variable in Windows' path, don't forget to restart MATLAB to make it aware of this change. To check the new compiler, you can type the following command in MATLAB's Command window: getenv('GCC_S32K_TOOL')

Hope this helps,

Marius
 

 

 

1,839 Views
p_a_u_darshana
Contributor III

Hello Marius,

Thank you for the help.

I have switched the compiler by adding an environmental variable and was able to build the project with the older version of GCC. So this works for me.

But I have an additional question.

How can we customize the compiler flags in MCU block settings? Can we even switch the GCC version from here?

Thank you

0 Kudos