Shop OBEX P1 Docs P2 Docs Learn Events
Raspberry Pi For Propeller Development? — Parallax Forums

Raspberry Pi For Propeller Development?

TylerSkylerTylerSkyler Posts: 72
edited 2012-08-07 05:02 in Propeller 1
Hello, I have finally have gotten my rpi and I'm looking to (hopefully) use it so I can program and prototype with the propeller while I travel(Im working on a case and battery powered screen) and I would like to know if there is a way to compile and download propeller programs to the propeller on the Arm linux (I'm using Raspian "Wheezy")that the rpi uses? Maybe someone can point me in the direction of something that will work, but not expecting a full blown IDE like the ardunio has already :smile:.

Thanks,

Tyler
«1

Comments

  • brianm734brianm734 Posts: 29
    edited 2012-07-21 13:42
    Hello,
    It seems to me if you could get a version of WINE (http://www.winehq.org/) , VirtualBOX (https://www.virtualbox.org/), or similar compiled for ARM that would run in Raspbian (or whatever Linux flavor you like on your Pi), then you could run Propeller tool on your Pi. I use WINE with Ubuntu to run some Windows apps and it works great. I'm not sure if the Pi has enough memory to handle running an emulator and an application at the same time though. If you could get Propeller Tool for Raspbian that would be even better.

    Here is a thread on running Propeller Tool in Linux:

    http://forums.parallax.com/showthread.php?140791-Got-Propeller-Tool-working-under-Linux&highlight=Propeller+Tool+Linux

    Thanks.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-07-21 14:19
    Neither of the named options will run on anything but x86. You could probably run Windows 9x under Qemu, but that would be extremely slow.

    A better option would probably be PZST. If that doesn't work, you may be able to run bst under Qemu-user.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-07-21 15:22
    Whenever I get my RPi, my intent is to try building propGCC and the new Open Source SPIN compiler with the Pi as the target and go from there. That would at least give you command line compiling and you could edit with vi (or whatever text editor you prefer). Porting SimpleIDE could be more of a challenge since it is built upon QT, you would need QT libraries for RPi. I think a command line environment would be a pretty good start.

    I wouldn't hold my breath waiting for the PropTool, BST, PZST, SimpleIDE or any full IDE to run on RPi...it might even be IMPOSSIBLE (there, I've said it!! :lol:)
  • brianm734brianm734 Posts: 29
    edited 2012-07-21 15:32
    "Porting SimpleIDE could be more of a challenge since it is built upon QT, you would need QT libraries for RPi. I think a command line environment would be a pretty good start."

    If you use QtonPi for your OS on your Pi, it should take care of the QT libraries, correct?
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-07-21 15:56
    Sounds good. I don't have my Pi yet so I haven't really started looking at what's become available in Pi world.
  • TylerSkylerTylerSkyler Posts: 72
    edited 2012-07-21 16:37
    Thanks for the replies!! I understand that a full propeller side will he hard if not impossible, but a command line tool would he awesome I'll look into what may he possible .


    Thanks,

    Tyler
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-21 16:57
    Just gave it a quick try and guess what .... it works!

    Downloaded the open source SPIN compiler to my RasPi, unzipped it, typed make and there it was ... the spin compiler.
    Test:
    Copied my snake archive to the RasPi and compiled it with spin .... just a second later I had the snake.binary
    copied that back to the PC and used the propeller tool to load it into Propeller RAM ... WOW ... it works.

    So, now we only need to have a uploader running on the RasPi.

    As an editor I'd simply use FTE - did not have a closer look, but hopefully the syntax highlighting in FTE is configurable.
  • TylerSkylerTylerSkyler Posts: 72
    edited 2012-07-21 17:35
    Super cool the goal is in sight ;)
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-07-21 18:12
    Can you compile the loader from propgcc on the RPi? It should load a binary, I believe.
  • John BoardJohn Board Posts: 371
    edited 2012-07-22 00:26
  • pik33pik33 Posts: 2,397
    edited 2012-07-22 00:39
    We haven't source code for BST to recompile it. BST binary files will not work on ARM.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-07-22 06:20
    MagIO2 wrote: »
    Just gave it a quick try and guess what .... it works!

    Downloaded the open source SPIN compiler to my RasPi, unzipped it, typed make and there it was ... the spin compiler.
    Test:
    Copied my snake archive to the RasPi and compiled it with spin .... just a second later I had the snake.binary
    copied that back to the PC and used the propeller tool to load it into Propeller RAM ... WOW ... it works.

    So, now we only need to have a uploader running on the RasPi.

    As an editor I'd simply use FTE - did not have a closer look, but hopefully the syntax highlighting in FTE is configurable.
    It should be pretty easy to compile propeller-load, the Propellerg GCC loader, on the RasPi. In fact, I suspect compiling Propeller GCC itself wouldn't be too hard. I'd try porting the loader but I haven't been able to buy a RasPi board yet. I was on the waiting list but even after an email came saying that mine was ready for purchase the link from the email message gives me a message saying they are temporarily unable to accept orders. Ugh.
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 08:42
    sudo apt-get install Mercurial
    is needed to get the tools to get the sources of the propeller gcc from google.

    hg clone https://code.google.com/p/propgcc/
    is needed to download all sources.

    No success so far with compiling the loader ... download with hg took ages on the RasPi ;o)

    But I also tried to connect the Prop to the RasPi and it worked.
    I installed a terminal software with
    sudo apt-get install gtkterm

    and connection to the propeller worked fine and at least the quickstart board seems to run stable without additional power supply.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-07-22 08:47
    MagIO2 wrote: »
    sudo apt-get install Mercurial
    is needed to get the sources of the propeller gcc from google.

    hg clone https://code.google.com/p/propgcc/
    is needed to download all sources.

    No success so far with compiling the loader ... download with hg took ages on the RasPi ;o)

    But I also tried to connect the Prop to the RasPi and it worked.
    I installed a terminal software with
    sudo apt-get install gtkterm

    and connection to the propeller worked fine and at least the quickstart board seems to run stable without additional power supply.
    Ugh. I had forgotten that the loader needs several Spin files compiled with bstc which isn't available for the ARM as far as I know. We should modify the build process to use Roy's Spin compiler which should work on the ARM.
  • brianm734brianm734 Posts: 29
    edited 2012-07-22 09:25
    David Betz wrote: »
    I'd try porting the loader but I haven't been able to buy a RasPi board yet.



    If you're in the US you can buy them from Newark Electronics. They have them in stock.

    http://www.newark.com/raspberry-pi/raspbrry-pcba/raspberry-pi-model-b-board-only/dp/83T1943?ref=lookahead
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 10:11
    Believe it or not ... I am a professional for more than 20 years, but never touched a makefile so far.

    I tried commenting out all lines with BSTC, but somehow the make knows that there are modules missing and stops build. My guess is, that all those spin-files need to be compiled for the GCC usecase. If we only want to upload *.binary or *.eeprom files all those modules won't be used, right?

    The rest of the build seems to be working fine, as I have the *.o files in the obj directory. Some ideas?

    The Spin compiler I already compiled stops working because the *.spin-files include #ifdef statements.
    Fixed that and I now have the *.binary files.
    Unfortunately the *.dat files can't be generated by the spin compiler due to missing implementation of the -c flag.

    Hmm ... maybe I should try with empty *.dat files ;o)

    .....
  • Heater.Heater. Posts: 21,230
    edited 2012-07-22 10:20
    I would try creating the required .dat files by building the loader in your PC and then copying them to the right place on the Pi. Then run make again.
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 10:52
    That's not enough either! The empty *.DAT trick helped, but then also the propeller-elf-gcc is needed to continue. So, I'd have to build the whole propeller gcc stuff before. Guess that makes things even more complicated.

    Maybe it's better to have a look at the loader-code and extract the things needed to do a simple *.binary/eeprom upload.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-07-22 11:29
    MagIO2 wrote: »
    That's not enough either! The empty *.DAT trick helped, but then also the propeller-elf-gcc is needed to continue. So, I'd have to build the whole propeller gcc stuff before. Guess that makes things even more complicated.

    Maybe it's better to have a look at the loader-code and extract the things needed to do a simple *.binary/eeprom upload.
    The code needed to load .binary files is in PLoadLib.c and PLoadLib.h. I think there is a main program that is commented out at the end of PLoadLib.c that you can enable to provide a simple loader.
  • jazzedjazzed Posts: 11,803
    edited 2012-07-22 11:29
    MagIO2 wrote: »
    Maybe it's better to have a look at the loader-code and extract the things needed to do a simple *.binary/eeprom upload.

    Indeed.

    Try this in propgcc/loader/src:
    $ gcc -o pload -DLINUX -DMAIN PLoadLib.c osint_linux.c
    
    $ ./pload
    usage: pload <port> <filename> [-pN]
    
    $ ./pload /dev/ttyUSB0 toggle2.binary -p0
    Propeller Version 1 on /dev/ttyUSB0
    Shutdown type 0 sent
    Load failed (normal message - nothing loaded)
    
    $ ./pload /dev/ttyUSB0 toggle2.binary -p1
    Propeller Version 1 on /dev/ttyUSB0
    Downloading 48 bytes of 'toggle2.binary'
    Loading toggle2.binary to hub memory
    48 bytes sent                  
    Verifying RAM ... OK
    
    $ ./pload /dev/ttyUSB0 toggle2.binary -p2
    Propeller Version 1 on /dev/ttyUSB0
    Downloading 48 bytes of 'toggle2.binary'
    Loading toggle2.binary to EEPROM via hub memory
    48 bytes sent                  
    Verifying RAM ... OK
    Programming EEPROM ... OK
    Verifying EEPROM ... OK
    
    
    
    


    -pN usage: -p0 ID, -p1 program RAM, -p2 program EEPROM (no reset), -p3 program EEPROM and reset
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 11:29
    New strategy: Build the whole stuff on a PC (GCC+Loader). Then I should have the whole set of files needed. I think the missing files are propeller-files anyway, so it does not make a difference on which machine these files have been created.

    But while waiting for the HG clone on my netbook I had a look on the loader.pdf. How can the loader upload a *.binary? All examples I found work with *elf-files.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-07-22 11:30
    MagIO2 wrote: »
    New strategy: Build the whole stuff on a PC (GCC+Loader). Then I should have the whole set of files needed. I think the missing files are propeller-files anyway, so it does not make a difference on which machine these files have been created.

    But while waiting for the HG clone on my netbook I had a look on the loader.pdf. How can the loader upload a *.binary? All examples I found work with *elf-files.
    You can just use the command "propeller-load foo.binary" to load a .binary file. The loader checks to see if it finds the .elf header and if it is missing it assumes the file is a .binary file.
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 11:46
    !!!!!! Success !!!!!!!!

    Thanks jazzed! That's the trick!
    pi@raspberrypi:~/Progg/C/propgcc/loader/src$ ./pload /dev/ttyUSB0 ~/Progg/SPIN/Snake.binary -p1
    Ignored 119 bytes.
    Propeller Version 1 on /dev/ttyUSB0
    Downloading 2480 bytes of '/home/pi/Progg/SPIN/Snake.binary'
    Ignored 67 bytes.
    Loading /home/pi/Progg/SPIN/Snake.binary to hub memory
    2480 bytes sent
    Verifying RAM ... OK
    

    So, everything we need to prog the prop is available on the RasPi! This is going to be fun to combine those two beauties and make something cool.
  • jazzedjazzed Posts: 11,803
    edited 2012-07-22 11:58
    MagIO2 wrote: »
    !!!!!! Success !!!!!!!!

    Great.
    MagIO2 wrote: »
    pi@raspberrypi:~/Progg/C/propgcc/loader/src$ ./pload /dev/ttyUSB0 ~/Progg/SPIN/Snake.binary -p1
    [COLOR=#ff0000]Ignored 119 bytes.[/COLOR]
    ....
    

    Quickstart board?
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 11:59
    Yes, what does it mean?
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-07-22 12:05
    Anybody interested in making "Prop Development on the Raspberry Pi for Dummies" ?
    Initially just compile on the PC and use the RPi to load the binary to the Prop as MagIo2 has done.

    Email says that my Raspberry Pi has been shipped, so I can be the test dummy, and write up all the notes. :)

    I imagine I'll be starting at, "So I got my Raspberry Pi, now what?"
  • TylerSkylerTylerSkyler Posts: 72
    edited 2012-07-22 12:15
    Anybody interested in making "Prop Development on the Raspberry Pi for Dummies" ?
    Initially just compile on the PC and use the RPi to load the binary to the Prop as MagIo2 has done.

    Email says that my Raspberry Pi has been shipped, so I can be the test dummy, and write up all the notes. :)

    I imagine I'll be starting at, "So I got my Raspberry Pi, now what?"

    Sounds Great! I'll try out the methods discussed in this forum today (hopefully) and post my results.

    Thanks for the Help,

    Tyler
  • MagIO2MagIO2 Posts: 2,243
    edited 2012-07-22 12:42
    To shorten the road to success ... here are the binaries ... I simply copied those to /usr/local/bin

    With spin you do the compile of a *.spin-file (actually this is like compile top in the propeller tool).
    Example:
    spin Snake.spin
    output: Snake.binary

    With pload you upload the *.binary to the propeller. As explained by jazzed, -p1 loads into RAM, -p2 loads into EEPROM
    pload /dev/ttyUSB0 Snake.binary -p1


    Have fun!
  • jazzedjazzed Posts: 11,803
    edited 2012-07-22 13:23
    MagIO2 wrote: »
    Yes, what does it mean?

    It just means that your Quickstart generated extra bytes during the setup portion of the load process before the propeller boot code set P30 to output.

    The message can be ignored.
  • TylerSkylerTylerSkyler Posts: 72
    edited 2012-07-22 14:16
    MagIO2 wrote: »
    To shorten the road to success ... here are the binaries ... I simply copied those to /usr/local/bin

    With spin you do the compile of a *.spin-file (actually this is like compile top in the propeller tool).
    Example:
    spin Snake.spin
    output: Snake.binary

    With pload you upload the *.binary to the propeller. As explained by jazzed, -p1 loads into RAM, -p2 loads into EEPROM
    pload /dev/ttyUSB0 Snake.binary -p1


    Have fun!

    Thanks! I like medit as an editor for code and it supports plugins written in Python and C, so I think mabye writing a plugin that takes the currently open file and calls the compile and load execs would be very cool. I'll look into programming a plugin no guarantees though :)

    Thanks,

    Tyler
Sign In or Register to comment.