This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What are the differences between IAR and GCC ?

Hi everyone !

We migrated a functional code from IAR to GCC compiler. But we got some trouble working it with GCC. The code compiles but it doesn't act properly with GCC(I use nRF UART for debugging, we didn't change any line of code).

Here is my Makefile: Makefile

Here is the linker script : application.ld

My questions are: What are the differences between these two compiler ? Does GCC make some optimisations that IAR doesn't do ? I had to put the -Os flag because of the size. Could this flag make optimisation that make the code disfunctional ?

Thank you so much !

Parents
  • I don't know the IAR compiler but you can find the GCC makfile in the SDK examples. You can use that to compare with yours. At least the following flags are required for the linker --specs=nano.specs -lgcc -lc -lm. Check also the ld script and startup code. Are you able to go into debug mode ? What environment IDE are you using ?

  • I'll help Hamza as we are worgkin together (and we are both stuck).

    1. Our code leverage many features: ADC/TWI/GPIO/etc. It runs an RTC and an external flash MEMORY.

    Our code was working flawlessly using IAR but our sponsorship ended and, due to their ridiculous licence fees (at least for us as programming this chip is not our core business), we had to migrate the code to Eclipse/GCC. Now doing most of the described tasks in different GIT/tutorials, we ended up compiling the code successfully. We now have hex for bootloader and application and no issue generating zip for OTA.

Reply
  • I'll help Hamza as we are worgkin together (and we are both stuck).

    1. Our code leverage many features: ADC/TWI/GPIO/etc. It runs an RTC and an external flash MEMORY.

    Our code was working flawlessly using IAR but our sponsorship ended and, due to their ridiculous licence fees (at least for us as programming this chip is not our core business), we had to migrate the code to Eclipse/GCC. Now doing most of the described tasks in different GIT/tutorials, we ended up compiling the code successfully. We now have hex for bootloader and application and no issue generating zip for OTA.

Children
No Data
Related