Switching to GCC

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> baadamff ‎07-07-2017 02:46 AM - edited ‎07-07-2017 02:48 AM

Since BLE SDK 2.4.0 GCC is officially supported.

 

If an existing project was using IAR but you want switch to GCC you have the following options.

A - Restart the project from scratch but this time select GCC as a toolchain.

B - Change the toolchain to GCC in the project configuration of the existing IAR project.

 

This article is showing the steps for the option B below.

 

1. Go to Project->Build Configurations->Manage..

manage.png

 

2. Create a new build configuration by New..

new.png

 

3. Select GNU ARM v4.9.3 – default option. Then press OK.

GNU ARM.png

 

4. Set the newly created GNU ARM configuration active. You can delete the IAR ARM configuration if you are sure that you don’t want to switch back for IAR in the future.

set acvtive.png

 

5. Go to File-> Properties for opening the project properties window. Go to C/C++ build -> Settings then select Memory Layout on the Tool Settings tab. Make sure the project configuration is GNU ARM. Now browse for the linker script of your device.

linker.png

 

6. Open the .isc file on your workspace with text editor.

isc.png

 

7. Replace the iar with gcc in the line which starts with architecture. Save the .isc with CTRL + S.

isc2.png

 

8. Close the .isc and reopen with double click. Press Generate.

 

9. Optional step: If your project using additional header or library files then the built in SDK examples you may add their paths to project on the project configuration window. See point 5.

 

10. Now build your project. (CTRL + B). The project should build with GCC without errors.