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 ?

  • We can't really share our code publicly but most features work. Outputs are OK, memory is working, rtc is fine and ADC seems to be OK but altogether, the things goes nuts in a certain memory reading function shooting tons of data not voluntarily recorded (we don't know if memory is full of crap data wrongly saved or if it's the reading/sending loop that fails). Debug is required, we will spend time on this tomorrow (if we manage to make it work). But could the Makefile argument be wrong?

    Will give chip details in previous post.

Reply
  • We can't really share our code publicly but most features work. Outputs are OK, memory is working, rtc is fine and ADC seems to be OK but altogether, the things goes nuts in a certain memory reading function shooting tons of data not voluntarily recorded (we don't know if memory is full of crap data wrongly saved or if it's the reading/sending loop that fails). Debug is required, we will spend time on this tomorrow (if we manage to make it work). But could the Makefile argument be wrong?

    Will give chip details in previous post.

Children
No Data
Related