[ell-i-developers] Re: Ellduino Emulator: Fixing issues for Linux (Ubuntu 12.04 LTS)

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Mon, 17 Feb 2014 16:47:00 +0200

> g++ -c -std=c++11 -g -Os -Wall -ffunction-sections -fdata-sections 
> -fno-common -nostdlib -m32 -march=i386 -DF_CPU=48000000L -DARDUINO=1.5.4 
> -Dmain=emulated_main -I../emulator/inc -I../cores/arduelli 
> -I../system/stm32/inc -I../system/stm32/CMSIS/Include -I../variants/ellduino  
>   -c -o emulator_pre.o ../emulator/src/emulator_pre.c
> /tmp/cc4s2eZQ.s: Assembler messages:
> /tmp/cc4s2eZQ.s:5: Error: character following name is not '#'
> I am getting other binaries, but for emulator_pre.o, there is error mentioned 
> above. Does it needs changes in compiler/assembler flags ... 

emulator_pre has never worked on Linux, and the way it is currently done means 
that it won't work without changes.

The eventual changes may be small (changing the section name), but instead of 
me doing that I think it is better that you now study the details and document 
them.  The details are in system/stm32/inc/system_init.h, 
system/stm32/src/system_init.h, and variants/ellduino/ld/flash.ld  In essence, 
the system init records are placed into the .preripheral.* segment, with the 
_peripheral_start and _peripheral_end framing it.

As in Mac OS X the gnu linker is not used, I cannot use a .ld file in Mac.  
Hence, for the emulator only, instead of a .ld file I use the emulator_post and 
emulator_pre objects, which define the _peripheral_start and _peripheral_end.  
For Linux, you don't want them, but you want to create a linux.ld file, 
probably in emulator/ld/linux.ld.  For that, you have to create a new linker 
script, and either copy to it or include to it the default gcc 4.7 linker file 
for Linux.  That in turn requires that you first learn how the GNU ld scripts 
work and what happens here.  It is largely document in the comments, but only 
at a quite high level.

> Regarding the Wiki, I have noted these points in a file ... after getting 
> emulator fixed, I will make a WiKi page mentioning problems and its solutions.

My recommendation is to start the Wiki file early, as that allows also others 
to comment and contribute to it.  But YMMV.

> I remember, we agreed to meet on Feb 19th at 4pm, Wednesday regarding test 
> cases ... but we have already discussed that in 12th Feb meeting. Do we need 
> to meet for test cases, because emulator still needs to be fixed?

I think it is useful to have a meeting on Wednesday anyway.  If you cannot make 
it, no problem, I'm sure Ivan and I can use the slot in a productive way in any 


Other related posts: