Shop OBEX P1 Docs P2 Docs Learn Events
PropGCC Build on RaspberryPi — Parallax Forums

PropGCC Build on RaspberryPi

SRLMSRLM Posts: 5,045
edited 2013-06-16 15:21 in Propeller 1
Hi all,

I'm getting the following error when I build. Any idea what is wrong?
...
...
...
src/loader.c: In function ‘WriteFileToSDCard’:
src/loader.c:1091:9: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘size_t’ [-Wformat]
src/loader.c:1098:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘size_t’ [-Wformat]
../../build/loader/obj/linux/loader.o
../../build/loader/obj/linux/lmm-image.o
src/xmm-image.c: In function ‘BuildExternalImage’:
src/xmm-image.c:57:18: warning: variable ‘initSectionTable’ set but not used [-Wunused-but-set-variable]
../../build/loader/obj/linux/xmm-image.o
../../build/loader/obj/linux/pex-image.o
../../build/loader/obj/linux/loadelf.o
../../build/loader/obj/linux/packet.o
../../build/loader/obj/linux/PLoadLib.o
../../build/loader/obj/linux/p1image.o
../../build/loader/obj/linux/p2image.o
mkdir -p ../../build/loader/obj/propeller
propeller-elf-gcc ../../build/loader/obj/propeller/p2loader.o
cc ../../build/loader/obj/propeller/p2loader.bin
bin2c ../../build/loader/obj/linux/p2loader.c
../../build/loader/obj/linux/p2loader.o
propeller-elf-gcc ../../build/loader/obj/propeller/p2booter.o
cc ../../build/loader/obj/propeller/p2booter.bin
bin2c ../../build/loader/obj/linux/p2booter.c
../../build/loader/obj/linux/p2booter.o
propeller-elf-gcc ../../build/loader/obj/propeller/p2flasher.o
cc ../../build/loader/obj/propeller/p2flasher.bin
bin2c ../../build/loader/obj/linux/p2flasher.c
../../build/loader/obj/linux/p2flasher.o
../../build/loader/obj/linux/config.o
../../build/loader/obj/linux/expr.o
src/system.c: In function ‘xbAddProgramPath’:
src/system.c:133:5: warning: implicit declaration of function ‘readlink’ [-Wimplicit-function-declaration]
../../build/loader/obj/linux/system.o
../../build/loader/obj/linux/port.o
/opt/parallax/bin/bstc.linux: 1: /opt/parallax/bin/bstc.linux: Syntax error: "(" unexpected
make: *** [../../build/loader/obj/linux/serial_helper.binary] Error 2
rm ../../build/loader/obj/propeller/p2loader.bin ../../build/loader/obj/propeller/p2flasher.o ../../build/loader/obj/linux/p2flasher.c ../../build/loader/obj/propeller/p2flasher.bin ../../build/loader/obj/propeller/p2booter.o ../../build/loader/obj/linux/p2booter.c ../../build/loader/obj/propeller/p2booter.bin ../../build/loader/obj/propeller/p2loader.o ../../build/loader/obj/linux/p2loader.c
make: Leaving directory `/home/pi/propgcc/propgcc/loader'
loader make failed

real	738m43.857s
user	496m14.640s
sys	48m58.480s

Comments

  • jazzedjazzed Posts: 11,803
    edited 2013-06-14 17:57
    The program bstc.linux is compiled for x86 only. We need to replace bstc.linux with OpenSpin in the make.
    OpenSpin has what we need now. We need to specify -p to enable the preprocessor though.

    I think Heater was doing this by commenting bstc.linux commands and adding .dat files from another build.

    SRLM wrote: »
    Hi all,

    I'm getting the following error when I build. Any idea what is wrong?
    ....
  • Heater.Heater. Posts: 21,230
    edited 2013-06-14 18:21
    Strangely enough I have a propgcc build running on the Pi at this very moment.

    I did manage to build the loader on the Pi as Jazzed says.
    First do a build on your PC.
    Hack the loaders Make file on the Pi so that it does not complain about the lack of bst.
    Copy the dat and bin files over to the pi, you will have to find which directories they belong in as I've forgotten.

    By the time you get to that error you should have propgcc binaries in /opt/parallax so you don't need to run rebuild.sh again.
    You can build the loader just by doing:
    $ cd loader
    $ source setenv.sh
    $ make
  • Heater.Heater. Posts: 21,230
    edited 2013-06-15 03:13
    Amazing, my propgcc build on Raspberry Pi finally bombed out at the loader after 6 hours. I'm sure this used to take more like 12 before.
    Trick is I have the propgcc directory on my PC and mounted as an NFS share on the Pi. Much faster than using the SD card.

    I now have propellergcc_v1_0_0_2075 installed in /opt:)

    Now to try and remember how I built the loader.

    Don't forget when the rebuild.sh script bombs out it still has not built gdb, spinsim and gdbstub if you need them. I never bothered.
  • SRLMSRLM Posts: 5,045
    edited 2013-06-15 03:36
    Thanks for the help. I think I'll update the build directions with the new information.
  • Heater.Heater. Posts: 21,230
    edited 2013-06-15 08:06
    Phew! Managed to get the loader to build on the Pi again. Things seem to have changed a bit since 10 months ago.
    Getting the loader to build on the Pi is a nice little puzzle.

    It would be nice if the loader Makefile would create all the *.binary and *.dat files and leave them somewhere where you can find them. But no, it deletes at least flash_loader.binary before it's done.

    So what I did was:
    1) Modify the Makefile on the PC build so that it copies these files somewhere nice after creation with bstc. Basically go through the Make file and add a command to copy the output file on every use of $(BSTC). For example:
    $(DRVDIR)/sst_sqi_flash_cache.dat:      $(SPINDIR)/sqi_flash_cache.spin $(SPIN_SRCS)
            @$(BSTC) $(SPINFLAGS) -c -DSST -o $(basename $@) $<
            @$(ECHO) $@
            @$(CP) $@ ~
    

    2) Move all those dat and binary files to the Pi.

    3) On the Pi replace /opt/parallax/bin/bstc.linux with a script of the same name that does nothing.

    4) Now run make on the pi and copy any files it complains about missing to wherever it says they should be and run make again. Eventually it will complete.

    5) Run "make install"

    5) Copy all the *.dat files to /opt/parallax/propeller_load

    This could all be streamlined but as the guys are going to do away with bst soon I'm not bothering.

    Next up is to merge my old Raspi UART changes into the loader so that we can connect a Prop directly to the GPIO to program it. No USB/Serial adapter required.
  • jazzedjazzed Posts: 11,803
    edited 2013-06-15 18:30
    Heater did you happen to try the OpenSpin open source spin compiler?
    It should "just work" with the right parameters... I've been too busy to try it with the build.
    $ ./spin -h
    Propeller Spin/PASM Compiler (c)2012 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Jun 15 2013
    usage: spin
             [ -I <path> ]     add a directory to the include path
             [ -o <path> ]     output filename
             [ -c ]            output only DAT sections
             [ -d ]            dump out doc mode
             [ -q ]            quiet mode (suppress banner and non-error text)
             [ -v ]            verbose output
             [ -p ]            use preprocessor
             [ -D <define> ]   add a define (must have -p before any of these)
             <name.spin>       spin file to compile
    
  • dgatelydgately Posts: 1,630
    edited 2013-06-15 19:01
    openSpin compiles and works on Raspberry Pi. I think I just downloaded the source and ran "sudo make all". Then, moved the "spin" executable to "/opt/parallax/bin/" and updated the spin compiler pref in SimpleIDE...

    SpinToWin.jpg


    dgately
    1024 x 797 - 122K
  • Heater.Heater. Posts: 21,230
    edited 2013-06-15 22:20
    Jazzed,

    Yes, openSpin works just fine on the Pi.

    Is it OK to post builds of SimpleIDE for the Pi to the net now? There are Pi users who have expressed an interest.

    I have not tried rebuilding it on the Pi for an age, what's the current best branch?
  • jazzedjazzed Posts: 11,803
    edited 2013-06-16 09:22

    Heater I've looked at the Linux build briefly this morning.
    There is more to do before it will be easy to build and distribute.

    Heater, do you think RPi could be forced to use a RAM disk instead of SDCARD for file-system?
  • Heater.Heater. Posts: 21,230
    edited 2013-06-16 14:37
    Like any Linux system, yes of course.
    But why?
  • jazzedjazzed Posts: 11,803
    edited 2013-06-16 15:21
    Heater. wrote: »
    Like any Linux system, yes of course.
    But why?

    Because it's unbearably slow otherwise. Just thinking out loud mostly.
Sign In or Register to comment.