Shop OBEX P1 Docs P2 Docs Learn Events
SimpleIDE for Raspberry Pi Raspian - Page 3 — Parallax Forums

SimpleIDE for Raspberry Pi Raspian

135

Comments

  • Heater.Heater. Posts: 21,230
    edited 2012-08-08 08:50
    Just uploaded SimpleIDE v0.8.4. See first post in thread.

    I built all this under QEMU on my Debian PC. Took 10 hours to build GCC and a few more to get everything else in order.

    It does not include my modifications to the loader with raspi on board UART support. I will post that on it's own at some point.
  • Heater.Heater. Posts: 21,230
    edited 2012-08-09 05:11
    I have hacked up the propeller loader from the propgcc sources to use the Raspberry Pi on board UART with a GPIO pin as a reset signal to the Propeller.
    If any one is brave enough they could try it out. That would be great as I have not got my Prop and Pi together yet.

    Edit: Before you start follow the instructions in my next post re: disabling the Linux console on the on board UART.

    1) For the hardware connections, from the raspi GPIO header:

    WARNING:
    I may have got Tx and Rx backwards below. I'd put 100 ohm resitors in series just for safety sake.
    Connect raspi Ground to your Propeller ground.
    Connect raspi GPIO14 (TXD) to the Propellers Rx programming pin (Pin 31).
    Connect raspi GPIO15 (RXD) to the Propellers Tx programming pin (Pin 32).
    Connect raspi GPIO17 to the propellers RESn pin (Pin 11).
    WARNING: I may have got Tx and Rx backwards above. I'd put 100 ohm resitors in series just for safety sake.

    You can read about the Raspi GPIO header here: http://elinux.org/RPi_Low-level_peripherals

    2) Make a backup of your current propeller-load program
    $ sudo cp /opt/parallax/bin/propeller-load /opt/parallax/bin/propeller-load.bak
    
    3) Put the attached propeller-load-rpi it's place
    $ sudo cp propeller-load-rpi  /opt/parallax/bin/propeller-load 
    
    4) Run SimpleIDE

    5) Select serial port /dev/tty/AMA0

    6) Try to program the hello world demo to the Prop.

    You should see something like the following in the Build Status window:
    Project Directory: /home/pi/SimpleIDE-0-8-4/demos/hello/
    
    propeller-elf-gcc -o a.out -Os -mlmm -I . -fno-exceptions -Dprintf=__simple_printf hello.c
    propeller-elf-objdump -h a.out
    Done. Build Succeeded!
    
    propeller-load -I /opt/parallax/propeller-load/ -b ASC -p /dev/ttyAMA0 a.out -r
    can't open /dev/mem  
    

    7) OK we need to let the loader run as root to access the GPIO:
    $ sudo chown root /opt/parallax/bin/propeller-load 
    $ sudo chmod +s  /opt/parallax/bin/propeller-load
    

    Now, at this point I get the following in the Build Status:
    error: no propeller chip on port '/dev/ttyAMA0'
    
    The port has been opened but I have no Prop there.
    Hopefully you can get a successful load:)
  • Heater.Heater. Posts: 21,230
    edited 2012-08-09 05:25
    In my haste I forgot to mention we have to stop the Raspi kernel from issuing errors over the onboard UART and we have to not use it as a console port for the OS. So the following steps are required:

    Edit your Raspi /boot/cmdline.txt

    From:
    [COLOR=#000000][FONT=arial]
    dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait[/FONT][/COLOR]
    

    to:
    [COLOR=#000000][FONT=arial]
    dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait[/FONT][/COLOR]
    

    deleting the two parameters involving the serial port /dev/ttyAM0

    You also have to edit /etc/innitab to remove the login (getty)
    comment out:
    [COLOR=#000000][FONT=arial]
    2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100[/FONT][/COLOR]
    
    Just add a # at the beginning of the line.

    then reboot.

    These instructions are from here: http://baldwisdom.com/preparing-for-a-la-mode-raspberry-pi-and-arduino/
  • RsadeikaRsadeika Posts: 3,837
    edited 2012-08-09 13:08
    Well, I just ordered a Raspberry PI from Element 14, says 31 day lead time. By the time I get my RaspPI, all the problems should be worked out for running SimpleIDE. Since I have a DNA-RTC board, a "shield" for it that would allow a connect sounds interesting, I wonder if that is possible, at a reasonable cost of course?

    Ray
  • jazzedjazzed Posts: 11,803
    edited 2012-08-09 13:51
    Looks like lots of great progress Heater! I should have a board for testing by next weekend.
  • ColeyColey Posts: 1,110
    edited 2012-08-10 02:04
    Hi Heater,

    I tried this last night without any success.
    When I try to load the Propeller from SimpleIDE I just get the error message that there is no Prop attached.

    error: no propeller chip on port '/dev/ttyAMA0'

    I suspect that the proploader routine isn't resetting the Prop to init the boot process.
    To test this theory I programmed the RAM on my Prop from Propeller Tool with a simple flashing LED on P0.
    I then connected my Prop up to the Pi and tried to load a program to it, nothing happened, it should at least reset the Prop right??

    I have RESn connected to GPIO17 on the Pi.

    Regards,

    Coley
  • Heater.Heater. Posts: 21,230
    edited 2012-08-10 02:21
    Coley,

    Sorry, I realized this morning that in moving the GPIO tweaking code from a simple test program into the loader I messed it up.
    I have just updated the attachment in post #63 above with a "fixed" version if you have time to try again.
    I'm a short of the time and means to make a test myself at this location.

    My code assumes that BOE is tied low so that RESn pulls itself high with nothing driving it.
    Normally GPIO17 is input and reset should float high.
    To reset the Prop I make GPIO17 low and make it an output briefly.
  • ColeyColey Posts: 1,110
    edited 2012-08-10 06:14
    No problem, I will give it a try when I get home.
    Heater. wrote: »
    Coley,

    Sorry, I realized this morning that in moving the GPIO tweaking code from a simple test program into the loader I messed it up.
    I have just updated the attachment in post #63 above with a "fixed" version if you have time to try again.
    I'm a short of the time and means to make a test myself at this location.

    My code assumes that BOE is tied low so that RESn pulls itself high with nothing driving it.
    Normally GPIO17 is input and reset should float high.
    To reset the Prop I make GPIO17 low and make it an output briefly.
  • ColeyColey Posts: 1,110
    edited 2012-08-10 10:53
    It's alive!!!!

    Nice one Heater...

    P1000168.jpg
    1024 x 768 - 192K
  • Heater.Heater. Posts: 21,230
    edited 2012-08-10 11:28
    Yay, fantastic. You are the first to see it. Still no chance to test here.
    OK what next?
  • Heater.Heater. Posts: 21,230
    edited 2012-08-10 11:32
    Oh yes. Did I specify the Tx and Rx connections correctly?
  • jazzedjazzed Posts: 11,803
    edited 2012-08-10 17:00
    Coley wrote: »
    It's alive!!!!

    Nice one Heater...

    P1000168.jpg

    Congrats Coley and Heater!

    Thanks,
    --Steve
  • ColeyColey Posts: 1,110
    edited 2012-08-11 04:24
    Heater. wrote: »
    Oh yes. Did I specify the Tx and Rx connections correctly?

    Yes, worked first time with the new loader....
    Heater. wrote: »
    Yay, fantastic. You are the first to see it. Still no chance to test here.
    OK what next?

    Well, I have a few plans (work related) for what is now a nice Ethernet enabled Prop. Not forgetting that it's also a self contained development system too.

    Currently I'm using one of TonyD's protoboard shields for the Pi/Prop combo,
    http://zuzebox.wordpress.com/2012/06/25/raspberry-pi-protoboard-sm-v0-10/


    rpi_and-rpi_protoboard.jpg



    I know there has been talk of a dedicated Prop add-on board which is a great idea, just needs a community effort to decide what should go on there.
    Steve (jazzed) has said he will do a board (if no-one else does) but I can lay out a design if there is enough interest.
    jazzed wrote: »
    Congrats Coley and Heater!

    Thanks,
    --Steve

    Hey, we couldn't have done it without you......

    I must say, SimpleIDE is great and runs very well on the Pi, a lot better than most other apps! :-)

    Thanks,

    Coley
    1024 x 768 - 151K
  • Heater.Heater. Posts: 21,230
    edited 2012-08-11 05:03
    This is great.
    Yep, self contained Prop development in a tiny box, a dream come true after many years pondering it. Could not happen with out the Raspberry Pi and the propgcc team.
    My idea for "Propeller Pi" is to keep it simple. Just a Prop and an RTC and breaknout as many I/Os as possible with convenient connectors. The Pi really need an RTC.
    Must have a LED or two, all boards should have LEDs.
    Perhaps some other little peripheral if there is space.

    TonyD was kind enough to send me the same Pi proto board so we are on the same page.
    It is such a nice looking board I can't bear to solder anything to it. I thinknit is the ideal form factor, sits low down with only that one little cut out.
  • RsadeikaRsadeika Posts: 3,837
    edited 2012-08-11 07:35
    I got some good news in this mornings email, my Raspberry PI is in the mail, and I am expecting delivery probably Tues or Wed at the latest. So, I will be able to join the Propeller PI club pretty soon.

    What is your hardware setup, are you using the HDMI port hooked to a TV set, or SSH, and using a GUI PuTTY to run SimpleIDE? Is the Raspberry PI capable of having a USB cable plugged into a Propeller Platform, like DNA board, or a Quickstart board? Or does it need some other configuration?

    It looks like the hardest part of the transformation to a Propeller PI is getting the SimpleIDE loaded and running, I think? I could be wrong about this though.

    Ray
  • Heater.Heater. Posts: 21,230
    edited 2012-08-11 15:32
    If you have an HDMI monitor/tv that works fine.
    I have been using SSH from a Linux PC. With the -X option to export the X Windows display of Simple IDE to my PC.
    How you do that from a Windows PC I have no idea.
    I suggest all Windows users switch to Linux anyway, just to make life simpler.
  • Heater.Heater. Posts: 21,230
    edited 2012-08-11 15:38
    Once you have Raspian running on your Pi getting SimpleIDE working is no harder than any other platform. Just down load and install the package.
    If your Propeller board needs a USB programming connection that will work as well.
  • jazzedjazzed Posts: 11,803
    edited 2012-08-11 16:07
    Heater. wrote: »
    How you do that from a Windows PC I have no idea.

    If possible, use UltraVNC on Windows once the Pi-side VNC server is running.
    This assumes that you have the Pi connected on the network of course.
  • Heater.Heater. Posts: 21,230
    edited 2012-08-11 16:34
    Ah yes, VNC might be a good solution. Exporting the X display is a bit slow. Exporting the whole desktop via VNC might be slower. I have to try it, might be surprised.
    Anyawy I suggest moving off of legacy operating systems.
  • Heater.Heater. Posts: 21,230
    edited 2012-08-13 04:43
    I just fixed the -P option for propeller-loader on Raspian. This option gets the loader to list available serial ports and previously it only showed any connected USB serial ports.
    Could some kind sole give this a quick test.
  • RsadeikaRsadeika Posts: 3,837
    edited 2012-08-13 05:06
    Now that I am looking at the details of the Raspberry PI, how is everybody powering the thing? The RPI site mentions either using the USB connector, or the GPIO. Maybe I should start thinking about using my DNA-RTC board as the power source, and then later as an interface to the RPI? Has anybody gotten as far as testing how the RPI and the Propeller will be coexisting? Or is the intent of the RPI just another way of programming the Propeller?

    Ray
  • Heater.Heater. Posts: 21,230
    edited 2012-08-13 05:28
    Ray,

    Power comes to my raspi via a micro USB adapter. Just a standard micro USB telephone charger. Or I can run it from a USB connection to my PC. You can power it from the 5v pin on the GPIO header instead if you like.

    So far there have been a few Propellers connected successfully to the raspi via USB serial adapter or more recently directly to the UART on its GPIO header. With the package and loader posted in this thread you can program your propeller via USB adapter or the GPIO UART. You can develop for the Propeller on the raspi in C/C++ with propgcc or in Spin. Both of these are supported by the SimpleIDE which runs very nicely on the raspi.

    There is a bunch of people thinking about a Propeller board for the Pi. Something with the same form factor and mating to the GPIO header. For me it would only have to:
    1) Carry a Propeller along with its regulator, XTAL etc.
    2) Make the connection to the rasp UART.
    3) Break out as many I/Os as possible.
    4) Carry an RTC as the raspi does not have one.

    This makes a very nice stand alone programmable real-time system.

    Perhaps I would also like to see it have a VGA connector so that the Prop would make a VT100 terminal for the Raspi. Or perhaps that's a separate project.

    There is discussion of all of this here:

    http://forums.parallax.com/showthread.php?141465-PropBerry-Propeller-amp-Raspberry-Pi-combo
  • Heater.Heater. Posts: 21,230
    edited 2012-08-17 06:29
    Once again I have to ask for some kind soul out there to test some changes to the Simple IDE Propeller loader for Raspberry Pi UART0. I just don'y have my Props and Pis in the same place and little time to hitch them up.

    Actually this is a big change in the GPIO handling. I have changed it from using memory mapped GPIO registers to using the access to GPIO provided by the Linux /sys/class/gpio virtual files. This is a lot slower than hitting the registers directly as you have to read and write file handles to access the GPIO.

    The problem that I was worried about is that this propeller-load decides to use the GPIO when the on board UART device is selected (/dev/ttyAMA0) BUT what happens if someone manages to compile and run this on a system with a ttyAMA0 device that is not a Rasberry Pi and does not have those GPIOs? Then we are memory mapping some random memory space into user memory and trampling on it as root!!!

    Having to go through /sys/class/gpio at least ensures that this will all fail if there is no GPIO.

    Anyway pleas try attached loader, just copying it over the previous one with the suid permissions set should work.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-08-17 12:58
    Heater. wrote: »
    ... the Simple IDE Propeller loader ...
    I don't want to be too picky but propeller-load is not a loader for SimpleIDE. It is a command line loader that goes with Propeller GCC that just happens to be used by SimpleIDE just like propeller-elf-gcc is. :-)
  • jazzedjazzed Posts: 11,803
    edited 2012-08-17 13:49
    David Betz wrote: »
    I don't want to be too picky but propeller-load is not a loader for SimpleIDE. It is a command line loader that goes with Propeller GCC that just happens to be used by SimpleIDE just like propeller-elf-gcc is. :-)

    Your "preferences" are showing :)

    I booted my RPi today, and am looking forward to using it. Seems to be a very nice replacement for my big HDTV computer so far. I'm sure my wife would love to see that old computer box out of our bedroom. Before that happens though, I'll have to do some other work like SimpleIDE testing and am looking for a good USB wifi solution for VNC, etc.... I may end up with half a dozen of these RPi units.
  • Heater.Heater. Posts: 21,230
    edited 2012-08-17 16:07
    David,
    Ah yes sorry.

    Jazzed,
    My girl feels the same.
    What will MicroSoft do when all the worlds computers are cheaper than any OS they have for sale?
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-08-17 20:47
    Heater. wrote: »
    What will MicroSoft do when all the worlds computers are cheaper than any OS they have for sale?

    Give us Windows 8 and Metro, of course! Ok, not Metro or at least don't call it Metro.....
    I'm sure it's what we need!
  • photomankcphotomankc Posts: 943
    edited 2012-08-17 21:34
    Heater. wrote: »
    David,
    Ah yes sorry.

    Jazzed,
    My girl feels the same.
    What will MicroSoft do when all the worlds computers are cheaper than any OS they have for sale?

    Can you say "yearly subscription"?
  • Heater.Heater. Posts: 21,230
    edited 2012-08-18 03:40
    Photomankc,

    I already have a subscription thanks. To Debian:)

    David,

    You make me wonder why propeller-load is in propgcc anyway?

    Surely GCC does not carry around such loaders for other machines and a loader is not part of the language system at all.
    Propeller-load would make a nice stand alone project.
  • RsadeikaRsadeika Posts: 3,837
    edited 2012-08-18 05:55
    I got my RPi board on Wed, and I have been playing around with it for the last couple of days, very interesting. I am using a 2GB SD card, for the plain raspian install, it seems like it is large enough for that plain install. But to install, lets say printer access, then you have to go with a larger card. So, what would be the minimal size card that you would need to make effective use of SimpleIDE?

    I went to the RPi wiki, what they already have an Arduino expansion board available? There is already a lot of expansion boards that are available, or in development, the RPi has not been out that long. Come the end of the year I bet they will have Win 8 on there, will that help with the popularity of RPi?

    So, my biggest concern at the moment is, what size of SD card should be used before I start to play around with programming a Propeller with the SimpleIDE program. Yes, I would like to have network printer access so I could print out some Spin/PropGCC programs.

    Ray
Sign In or Register to comment.