I am facing same problem (Segmentation fault (core dumped)) with test cases as well e.g. ~/Runtime/stm32/tests/ ... On Mon, Mar 3, 2014 at 11:21 PM, Asif Sardar < engr.asif.sardar@xxxxxxxxxxxxxx> wrote: > Great! > > I have also successfully made emulator with the above instructions and > using 32 bit elf_i386.xc linker script ... > > However, running ./sketch, I got > > Segmentation fault (core dumped) -> I might be using older git clone with > broken code. To update my local repository, would simple git pull from > command line would work? > > However, the major problem is removed now ... > > > > > On Mon, Mar 3, 2014 at 4:26 PM, Pekka Nikander <pekka.nikander@xxxxxx>wrote: > >> Success! >> >> Now, next I'll need a clean pull request... >> >> --P >> >> On 2014-03-03, at 15:39 , Eero Hakala <eero.k.hakala@xxxxxxxxx> wrote: >> >> > hahhaa, the problem was aktually in sketch.cpp... when I changed it to: >> > >> > #include <Arduino.h> >> > >> > void setup() {} >> > void loop() {} >> > >> > So it didn't like those \n:s after all.... Now when running sketch I >> get the output as: >> > >> > RCC:CR:200ff83|=1 >> > RCC:CFGR:8&=f8ffb80c >> > RCC:CR:200ff83&=fef6ffff >> > RCC:CR:200ff83&=fffbffff >> > RCC:CFGR:8&=ffc0ffff >> > RCC:CFGR2:0&=fffffff0 >> > RCC:CFGR3:0&=fffffeac >> > RCC:CR2:ff80&=fffffffe >> > RCC:CIR:=0 >> > FLASH:ACR:=11 >> > RCC:CFGR:8|=0 >> > RCC:CFGR:8|=0 >> > RCC:CFGR:8&=ffc0ffff >> > RCC:CFGR:8|=280000 >> > RCC:CR:200ff83|=1000000 >> > RCC:CR:300ff83&2000000 >> > RCC:CFGR:280008&=fffffffc >> > RCC:CFGR:280008|=2 >> > RCC:CFGR:28000a&c >> > InitRecord: 804a888 type: 0 count: 1 >> > RCC:AHBENR:14=400014 >> > InitRecord: 804a89c type: 0 count: 1 >> > RCC:AHBENR:400014=500014 >> > ... >> > >> > >> > >> > -eero- >> > >> > >> > On Mon, Mar 3, 2014 at 2:58 PM, Pekka Nikander <pekka.nikander@xxxxxx> >> wrote: >> > Great! >> > >> > cd build >> > rm sketch.cpp >> > make sketch.cpp >> > make PLATFORM=emulator >> > >> > Results? >> > >> > --Pekka >> > >> > On 2014-03-03, at 14:44 , Eero Hakala <eero.k.hakala@xxxxxxxxx> wrote: >> > >> > > Hi, I took the 32bit linker script, added same stuff as Asif and >> saved it into scripts-directory. >> > > >> > > Then I changed the flags in emulator.mk like Pekka instructed: >> > > >> > > # LDFLAGS := -m32 -demangle >> > > LDFLAGS := -m32 -demangle -march=i386 -Xlinker -T -Xlinker >> ../scripts/elf_i386.xc >> > > >> > > And got rid of previous errors, but it hang up in main: >> > > g++ -m32 -march=i386 -m32 -demangle -march=i386 -Xlinker -T -Xlinker >> ../scripts/elf_i386.xc -o sketch main.o sketch.o ellduino.o "-L." >> "-L../variants/ellduino" "-lstm32f0" -lstdc++ >> > > main.o: In function `emulated_main': >> > > >> /home/eero/sw-engineering/sulautetut/ng-ell-i/Runtime/stm32/build/../cores/arduelli/main.cpp:36: >> undefined reference to `setup()' >> > > >> /home/eero/sw-engineering/sulautetut/ng-ell-i/Runtime/stm32/build/../cores/arduelli/main.cpp:38: >> undefined reference to `loop()' >> > > collect2: error: ld returned 1 exit status >> > > >> > > -eero- >> > > >> > > >> > > >> > > On Sun, Mar 2, 2014 at 9:56 PM, Pekka Nikander <pekka.nikander@xxxxxx> >> wrote: >> > > > You were right... the default linker script that GNU 'ld' uses >> resides inside /usr/lib/ldscripts named as elf_x86_64.xc. It is also >> attached to this email with lines 61-64 added about start and end >> peripherals ... >> > > >> > > I think that is the 64-bit linker script. I *guess* the 32-bit one >> might be elf_i386.xc >> > > >> > > > Please see the changed elf_x86_64.xc file attached to this e-mail. >> > > >> > > That looks perfectly good to me. >> > > >> > > My guess is that once you find the right i386 linker script, and get >> it working from the command line with the -m32 -march=i386 -Xlinker -T >> -Xlinker <your-file> arguments, you'll be done with this. >> > > >> > > --Pekka >> > > >> > > >> > > >> > >> > >> > >> >> >> > > > -- > > > > *With Best Regards,Asif Sardar.+358 43 8265795 <%2B358%2043%208265795>* > -- *With Best Regards,Asif Sardar.+358 43 8265795*