[ell-i-developers] Re: some problemas

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Sun, 25 May 2014 17:26:19 +0300

> so it'll find gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 and 
> gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2.sha
> And normally both files can be downloaded - now the ...sha file is missing so 
> I try to create one, with no succes up to now. 

$ openssl sha1 ~/Downloads/gcc-arm-none-eabi-4_8-2013q4-20131218-mac.tar.bz2 

Then I would expect 

echo "57c33bef0f7b098929e6d95f3be164e5929915d5" > 


> 4. I still had problem that there was different name in archive that was 
> expected, so I changed 
>     that to the expected one: 
>     this was in archive: gcc-arm-none-eabi-4_8-2014q1 
>     this was the expected one: g++_arm_none_eabi

This one I didn't understand.

> 5. After all this I got the makefile based development runtime environment up 
> and running (as you see
>     its using compiler that resides deep in ELL-i's Arduino fork): 

Great!  This is what I usually use.

> 6. but I still have problems with IDE based environment:

This I have not tested for over 6 months, so I wouldn't expect it to work out 
of the box.  But let's see...

> Arduino: ${version} (Linux), Board: "ELL-i Ell-duino"
> /home/eero/Ell-i/ng-ell-i/Arduino/build/linux/work/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-g++
>  -c -std=c++11 -g -Os --param max-inline-insns-single=500 -Wall 
> -ffunction-sections -fdata-sections -fno-common -nostdlib -mcpu=cortex-m0 
> -mthumb -DF_CPU=48000000L -DARDUINO=153 -DELLI_STM32F051_ELLDUINO 
> -DARDUINO_ARCH_STM32 -fno-rtti -fno-exceptions -fno-threadsafe-statics 
> -D__STM32F051__ 
> -I/home/eero/Ell-i/ng-ell-i/Arduino/build/linux/work/hardware/ell-i/stm32/cores/arduelli
> -I/home/eero/Ell-i/ng-ell-i/Arduino/build/linux/work/hardware/ell-i/stm32/variants/ellduino
>  /tmp/build9141334830626261003.tmp/sketch_may24a.cpp -o 
> /tmp/build9141334830626261003.tmp/sketch_may24a.cpp.o 
> In file included from 
> /home/eero/Ell-i/ng-ell-i/Arduino/build/linux/work/hardware/ell-i/stm32/variants/ellduino/ellduino_gpio.h:26:0,
>                  from 
> /home/eero/Ell-i/ng-ell-i/Arduino/build/linux/work/hardware/ell-i/stm32/cores/arduelli/Arduino.h:27,
>                  from sketch_may24a.ino:1:
> /home/eero/Ell-i/ng-ell-i/Arduino/build/linux/work/hardware/ell-i/stm32/cores/arduelli/arduelli_gpio.h:29:26:
>  fatal error: system_init.h: No such file or directory
>  # include <system_init.h>

 is missing.

> - where and how should the to be included stuff be defined?
> make/arduino.txt
> boards.txt
> platform.txt

Normally the include-file folders is defined by the IDE dynamically, using its 
built-in rules.  In boards.txt, the variables build.variant and build.core 
affect this. 

In theory, we are *not* supposed to include anything from system/*, so 
including system_init from arduelli_gpio.h is against the Arduino spirit.  But 
I think that's fine, we just need to include the folder into the include path.

While it may be arguable which is the "right" way to include the folder into 
the include path, I think the best way is to add it to the compiler.cflags in 
platform.txt.  If you inspect platform.txt, you see that compiler.cflags is 
composed of compiler.cflags.{1,2,3}, which are then composed of 
compiler.cflags.debug, compiler.cflags.optimise, etc.

There is no compiler.cflags.includes, so that should be added, and then add 
that to compiler.cflags.3.  More generally, see 
app/src/processing/app/Base.java and app/src/processing/app/debug/Compiler.java 
for the variables defined in the IDE.

diff --git a/stm32/platform.txt b/stm32/platform.txt
index 906af65..b9af4da 100644
--- a/stm32/platform.txt
+++ b/stm32/platform.txt
@@ -50,10 +50,11 @@ compiler.cflags.sections=   -ffunction-sections 
-fdata-sections -fno-common
 compiler.cflags.libraries=  -nostdlib
 compiler.cflags.target=     -mcpu={build.mcu} -mthumb
 compiler.cflags.defines=    -DF_CPU={build.f_cpu} 
-DARDUINO={runtime.ide.version} -DELLI_{build.board} -DARDUINO_ARCH_{build.arch}
+compiler.cflags.includes=   -I${build.system.path}/stm32/inc
 compiler.cflags.1=          {compiler.cflags.debug} {compiler.cflags.optimise} 
{compiler.cflags.inline} {compiler.cflags.warnings}
 compiler.cflags.2=          {compiler.cflags.sections} 
{compiler.cflags.libraries} {compiler.cflags.target}
-compiler.cflags.3=          {compiler.cflags.defines}
+compiler.cflags.3=          {compiler.cflags.defines} 
 compiler.cflags=            {compiler.cflags.1} {compiler.cflags.2} 
 compiler.cxxflags=          -fno-rtti -fno-exceptions -fno-threadsafe-statics

I didn't test that, so it may or may not work.  But with the information above 
perhaps you can figure out how to modify that if needed?

> 7. make PLATFORM=emulator works but when running it I get a segmentation 
> fault!

That's more-or-less normal that you get a segmentation fault in the end.  
That's due to C++ destructors which are try to free C++ objects that cannot.  
That could be fixed by defining custom destructors but I haven't bothered so 
far, as we don't support dynamic allocation either.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Other related posts: