What are the differences between ARMCC(Online Compiler) and GCC ARM?

27 Dec 2016

I am trying to use NUCLEO F302R8 with ESP8266. I am unable to compile the ESP8266 Interface library provided by ESP8266 team on my Mac using GCC ARM compiler. The GCC ARM compiler is the same one that was provided together with the mbed-cli installation. Nevertheless, I am able to compile my code alongside the library on the online compiler.

What are the differences between ARMCC and GCC ARM for developers like me? And how can I ensure that the code compiled by ARMCC can also be compiled by GCC ARM? Where should I look into?

30 Dec 2016

Hello, the differences would most probably lie in the libraries provided by each of these Toolchains. ARMCC is the C-Compiler which is provided by ARM for compiling Code for their Cores. GCC is the Compiler which origins in the GNU Project. GNU is a Free Software Operation System.

GNU has some Exensions which are not supplied by the ARMCC, you can counter this problem by giving the compiler the 'gnu' option.

It would help to see a Example of the Error which you are getting.

Kind Regards.

31 Dec 2016

Hi David,

Thanks for your explanation.

The project that I am working on involves ESP8266. Because of our company's workflow requires me to work offline most of the time, using online IDE and compiler is not an option. So I am trying to compile the sample code, MQTT on ESP8266, by using GCC ARM. Below is the error:

Compiling the example without changing the library

Building project ESP8266_MQTT_HelloWorld (NUCLEO_L073RZ, GCC_ARM)
Scan: .
Scan: mbed
Scan: env
Compile: ESP8266.cpp
[ERROR] In file included from ./mbed/cbbeb26dbd92/mbed.h:21:0,
                 from ./ESP8266Interface/ESP8266/ESP8266.cpp:19:
./mbed/cbbeb26dbd92/platform.h:21:20: fatal error: device.h: No such file or directory
 #include "device.h"
                    ^
compilation terminated.

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /Mbed/ESP8266_MQTT_HelloWorld/.temp/tools/make.py -t GCC_ARM -m NUCLEO_L073RZ --source . --build ./.build/NUCLEO_L073RZ/GCC_ARM" in "/Mbed/ESP8266_MQTT_HelloWorld"

I checked, because of lack of support for my board(NUCLEO L073RZ) in the library version that is being used by the ESP8266 team so I imported the latest mbed os 5 library from Github and these errors appeared:

Compiling the example by using mbed's latest library

Compile: ESP8266Interface.cpp
[Error] Endpoint.h@69,15: declaration of 'ESP8266* Endpoint::ESP8266' [-fpermissive]
[Error] ESP8266.h@41,7: changes meaning of 'ESP8266' from 'class ESP8266' [-fpermissive]
[ERROR] In file included from ./ESP8266Interface/ESP8266Interface.h:24:0,
                 from ./ESP8266Interface/ESP8266Interface.cpp:1:
./ESP8266Interface/Socket/Endpoint.h:69:15: error: declaration of 'ESP8266* Endpoint::ESP8266' [-fpermissive]
     ESP8266 * ESP8266;
               ^
In file included from ./ESP8266Interface/ESP8266Interface.h:23:0,
                 from ./ESP8266Interface/ESP8266Interface.cpp:1:
./ESP8266Interface/ESP8266/ESP8266.h:41:7: error: changes meaning of 'ESP8266' from 'class ESP8266' [-fpermissive]
 class ESP8266
       ^

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /Mbed/ESP8266_MQTT_HelloWorld/.temp/tools/make.py -t GCC_ARM -m NUCLEO_L073RZ --source . --build ./.build/NUCLEO_L073RZ/GCC_ARM" in "/Mbed/ESP8266_MQTT_HelloWorld"

As ESP8266 is very famous, I am keen to try to use it. Appreciate anyone's help in this matter. Thank you.

04 Jan 2017

Hello, What i found is that the library you are using doesn|t seem to be standart conform. The declaration of the Variable ESP8266, this uses the same name as the class declaration overwrites the meaning of the class declaration with the Variable. Seems like gcc doesn't ignore this error like your other compiler would. You can either fix this in the library, give the variable or the class another name e.g. class ESP8266_t, or you could try to give the -fpermissive flag to your compiler which downgrades some errors to warnings. The latter approach is not advisable though, but your only option if you don't want to alter the library code.

06 Jan 2017

David Ramunno wrote:

Hello, What i found is that the library you are using doesn|t seem to be standart conform. The declaration of the Variable ESP8266, this uses the same name as the class declaration overwrites the meaning of the class declaration with the Variable. Seems like gcc doesn't ignore this error like your other compiler would. You can either fix this in the library, give the variable or the class another name e.g. class ESP8266_t, or you could try to give the -fpermissive flag to your compiler which downgrades some errors to warnings. The latter approach is not advisable though, but your only option if you don't want to alter the library code.

Thank you David. This ESP8266 Interface library is written when the Socket portion of the code is not part of mbed-os, i'd think so they wrote their own socket code. Since I am not using their version of mbed but rather the latest one which has Socket, then there is a problem. :)

Now that I tried renaming all the class written in the interface library so that it does not override existing Socket code in mbed-os but apparently the library cannot be compiled with GCC ARM compiler.

Error to compile changed class name

[Error] c++0x_warning.h@32,2: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
[ERROR] In file included from /usr/local/Cellar/arm-none-eabi-gcc/20150921/arm-none-eabi/include/c++/4.9.3/cstdint:35:0,
                 from ./ESP8266Interface/Socket/UDPSocket.h:25,
                 from ./ESP8266Interface/ESP8266Interface.h:71,
                 from ./ESP8266Interface/ESP8266Interface.cpp:1:
/usr/local/Cellar/arm-none-eabi-gcc/20150921/arm-none-eabi/include/c++/4.9.3/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /Mbed/ESP8266_MQTT_HelloWorld/.temp/tools/make.py -t GCC_ARM -m NUCLEO_F030R8 --source . --build ./.build/NUCLEO_F030R8/GCC_ARM" in "/Users/afeezaziz/Projects/Mbed/ESP8266_MQTT_HelloWorld"

I'd think that the best way to address this is to add the flags to enable that compilation. Is this the best way or is there any other better way?

09 Jan 2017

After much experiments and using ARMCC compiler via online compiler provided by mbed, we have decided to better stick with ARMCC. Nevertheless, our workflow requires most of the work to be done online. I have tried DS-5 on Ubuntu, is there a way to use ARMCC using mbed-cli on Ubuntu?