[ell-i-developers] Re: arduino IDE sucks

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Mon, 28 Jul 2014 10:48:01 +0300

The key to understanding the Arduino IDE is to learn how the platform.txt and 
build.txt files work.

> the Arduino IDE based system 
> - doesn't find all stuff (4.8.3 20140228)
> /home/eero/swe/sulautetut/elli/Arduino/build/linux/work/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-g++
>  -c -std=gnu++0x -g -Os --param max-inline-insns-single=500 -Wall 
> -ffunction-sections -fdata-sections -fno-common -nostdlib -mcpu=cortex-m0 
> -mthumb -DF_CPU=48000000L -DARDUINO=156 -DELLI_STM32F051_ELLDUINO 
> -DARDUINO_ARCH_STM32 -fno-rtti -fno-exceptions -fno-threadsafe-statics 
> -D__STM32F051__ 
> -I/home/eero/swe/sulautetut/elli/Arduino/build/linux/work/hardware/ell-i/stm32/cores/arduelli
> -I/home/eero/swe/sulautetut/elli/Arduino/build/linux/work/hardware/ell-i/stm32/variants/ellduino
>  /tmp/build4447791685570882080.tmp/sketch_jul27a.cpp -o 
> /tmp/build4447791685570882080.tmp/sketch_jul27a.cpp.o 
>      [exec] 
> /home/eero/swe/sulautetut/elli/Arduino/build/linux/work/hardware/ell-i/stm32/cores/arduelli/arduelli_gpio.h:8:23:
>  fatal error: stm32f0xx.h: No such file or directory
>      [exec]  #include <stm32f0xx.h>

Including the system/stm32/inc directory to the -I directories is missing in 
platform.txt or board.txt.  

Fixing this the right way may or may not be trivial, as we want to support both 
stm32f0 and stm32f4.  

As a plug gag solution, you may change the definition of build.extra_flags in 

ellduino.build.extra_flags=-D__STM32F051__ -Isystem/stm32/inc

> make[2]: Entering directory `/home/eero/Ell-i/ng-elli/Runtime/stm32/build'
> arm-none-eabi-gcc -c -std=c99 -g -Os --param max-inline-insns-single=500 
> -Wall -ffunction-sections -fdata-sections -fno-common -nostdlib 
> -mcpu=cortex-m0 -mthumb -DF_CPU=48000000L -DARDUINO=1.5.4 
> -I../cores/arduelli -I../system/stm32/inc -I../system/stm32/CMSIS/Include 
> -I../variants/ellduino   -c -o startup_stm32f0xx.o 
> ../system/stm32/src/startup_stm32f0xx.c
> BUT the Arduino IDE based version is using compiler that was brought in with 
> the toolchain even if the compiler was defined as system compiler:
> /home/eero/Ell-i/ng-elli/Arduino/build/linux/work/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-g++

You have to change the compiler.path variable in platform.txt  At the moment it 
*does* point to the IDE compiler.

> So what on earth is going on here?

Arduino IDE doesn't care a bit what we define in our makefiles.  It only 
follows platform.txt and build.txt

> For now its quite evident that we are not going to support IDE based 
> environment but instead we should concentrate making good documentation of 
> how to use the Makefile based system! 

Disagree. We just have to understand both the makefile based system and the 
Arduino IDE, and document the makefile based system.  The Arduino IDE 
documentation we can leave for Arduino folks, or if we do document it, 
contribute to the Arduino project instead of keeping it at our documentation.

> And we should use the KISS principle, just as the guys in RIOT-OS are using:
> - Standard programming in C or C++
> - Standard tools such as gcc, gdb, valgrind
> - Minimized hardware dependent code
> - Zero learning curve for embedded programming

So far I agree, but for both C and C++ we also must restrict what we use.  Full 
standard C++ is far too heavy for embedded.

> - Partial POSIX compliance. Towards full POSIX compliance.

I am not sure about this.  Many POSIX APIs suck in embedded.  So, case-by-case.

> - Develop under Linux or Mac OS using the native port, deploy on embedded 
> device 

Mostly agree, but I think the emulator is also nice.  Also the RIoT folks have 
their "native" target...


Other related posts: