Shop OBEX P1 Docs P2 Docs Learn Events
Developing for Propeller on Linux — Parallax Forums

Developing for Propeller on Linux

dmlandrumdmlandrum Posts: 13
edited 2012-05-17 15:18 in Propeller 1
Hello, all. Now that I have my bench computer up and running, I'm eager to get to some projects. Because it's an old computer (Celeron 2GHz w/ 768MB RAM - not fantastic, but it's all I've got), I'm running Lubuntu on it, a supposedly light version of Ubuntu. On that front, I have to say: so far, so good. It doesn't constantly peg my CPU at all like Canonical or Mint did. Right now, I'm getting various engineering packages installed, such as Kicad (EDIT: this is now working as well - latest version, too :)) and the Arduino environment (works).

I'm looking at the page for BST at the moment, as it seems the best option for developing on the Propeller for Linux, but I was wondering if I have other options I can try out. I have nothing against doing all my development in C and/or assembly. I should also point out that I have one of the old RS232 Propsticks as my platform. This machine has an RS232 port (another reason to use an old computer), so physically connecting them isn't an issue. I just need to make sure I can actually get the bit files to the Prop.

Thank you all for the help!

Comments

  • pedwardpedward Posts: 1,642
    edited 2012-05-16 18:04
    I've used BST for developing SPIN/PASM code on Linux, and it works fine. The down side is that it isn't really maintained per se.

    Right now I've been tinkering with the SimpleIDE C environment on Linux, and I must say it's quite neat. The PropGCC group has done a fantastic job of getting a multi-model compiler up and running, and Jazzed has done a great job on the SimpleIDE.

    You can download SIDE and the PropGCC packages and be writing/running C code in minutes.

    One of the things the PropGCC group is trying to remedy is the fragmented and scattered landscape that SPIN lives in, without a cohesive library and environment to develop in.

    PropGCC already has SD filesystem support built into the libc, simple serial, full duplex serial, and STDIO for files and serial devices. It even has simple printf that sends data to the serial port, like you'd expect.

    I've been helping out a little here and there and still getting my hands dirty, but it's an impressive feat thus far.

    You should be able to port a lot of Arduino code over easily because it's C, you don't have to rewrite it completely.
  • pinedustpinedust Posts: 19
    edited 2012-05-16 18:08
    BST works great on my Ubuntu box for spin/assembly. I use both Catalina/CodeBlocks and PropGCC/SimpleIDE for C development.
    I haven't touched a M$ machine in years, and I am too poor to afford a mac.
  • dmlandrumdmlandrum Posts: 13
    edited 2012-05-16 18:54
    Thanks for the help, all. So far, BST is looking like the most mature solution. I have a project I want to get started on pretty quickly. I'll worry about it tomorrow, though. I've done enough messing around for tonight.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2012-05-16 18:57
    I'm not sure if you know about the object exchange. Here's the URL.

    http://obex.parallax.com/

    Good luck! with your project.

    Bob
  • SRLMSRLM Posts: 5,045
    edited 2012-05-16 22:47
    I'm a bit passionate about this: I develop exclusively on Ubuntu. I've been Windows free for almost 24 months now.

    I program in Spin/PASM. I've looked at PropGCC, Catalina, and PropBasic but for a few reasons (one here), I decided that none are suitable.

    Anyway, to compile and download I use BSTC with Gedit. I have a Gedit syntax highlighter file (insert URL HERE) that will (mostly) accurately highlight Spin files. I prefer Gedit over BST because BST is missing some of the more important editor features that I like.

    To do PASM debugging I use the BMA Debugger: http://forums.parallax.com/showthread.php?115068-BMA-Multi-COG-PASM-Debugger-V1.9-Now-Available&p=829927&viewfull=1#post829927

    I also use a custom download script to make the debugging cycle faster. It uses BSTC and picocom (terminal), along with another custom script that I wrote to parse .list files:
    #!/bin/bash
    
    #(c)2012 Anzhelka Project
    
    #This script will compile, download, and open a terminal
    #If any errors are encountered then it will stop at the appropriate point.
    
    #Meant to be run from the /spin directory
    #  $> tool/compile src/[filename].spin
    
    baud="230400"
    
    if [ $# -eq 0 ] ; then
    	echo "Usage: $0 [Top Level Spin File Path][--list [block number | objectname]]"
    	exit 1
    fi
    
    #Extract the filename without extension:
    filename=$(basename $1)
    extension=${filename##*.}
    filename=${filename%.*}
    
    echo
    echo
    
    #Set the tab stops, useful for when displaying the listing
    tabs 5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93
    
    ./tool/bstc.linux -f -p0 -l -w1 -L test -L lib -L lib/bma $1 > bstoutput.txt
    cat bstoutput.txt
    
    grep -q "Error" bstoutput.txt
    if [ $? -eq 0 ]; then
    	echo Found Error!
    else
    	echo ----------------------------------------------------------
    	echo No compiler errors...
    
    	grep -q "No Propeller detected on" bstoutput.txt
    	if [ $? -eq 0 ]; then
    		echo Could not find Propeller chip...
    	else
       		echo
    		echo
    		echo To exit picocom, type C-A then C-X
    		echo
    		rm bstoutput.txt
    		
    		if [ "$2" = "--list" ] ; then #Quotes around the $2 to make a binary operator (http://linuxcommand.org/wss0100.php)
    			if [ $# -gt 2 ]; then
    			gnome-terminal --geometry=142x60 -x ./tool/listgrep.py $filename.list $3
    			else
    				gnome-terminal --geometry=142x60 -x ./tool/listgrep.py $filename.list
    			fi
    		else
    			echo ""
    			#echo "Currently, the argument in position 2 must be --list."
    		fi
    		port=$(ls /dev/*USB*)
    		#echo $port
    		picocom -b $baud $port
    	fi
    fi
    rm bstoutput.txt
    
  • jazzedjazzed Posts: 11,803
    edited 2012-05-16 23:25
    SRLM wrote: »
    but for a few reasons (one here), I decided that none are suitable.

    Hi Cody. Thanks for your analysis. Just a few notes on some missed perceptions:

    1. Propeller-GCC was never intended to produce commented PASM or LMM/ASM code.

    2. You got hub access in your COG code because you did not create COG C source suitable for running entirely in a COG - requirements for COG C source are described here http://code.google.com/p/propgcc/wiki/COGModeExperiences

    3. In GCC the linker checks for program overflows, not the compiler. There is no such thing as a .fit directive.

    My own take? Chip designed Propeller and SPIN/PASM to do certain things well. Many of us are used to that and enjoy it.
    However many more newcomers are not at all used to SPIN/PASM and prefer different and more familiar tools.

    Thanks,
    --Steve


  • Mark_TMark_T Posts: 1,981
    edited 2012-05-17 02:46
    pedward wrote: »
    I've used BST for developing SPIN/PASM code on Linux, and it works fine. The down side is that it isn't really maintained per se.

    Ah that's a shame - every so often I find BST hangs (but fortunately if you close the window it prompts to save unsaved files so you don't lose anything) - it would be nice if that bug could go away some time - (and cut/copy/paste made to work in the serial window).

    It works nicely otherwise and is straightforward to use.
  • Heater.Heater. Posts: 21,230
    edited 2012-05-17 03:12
    That's odd. I have been using BST on Debian ever since it was created and I don't recall it ever hanging or crashing out.
    Sadly it's author has gone really quiet for a long while now.
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-05-17 07:06
    dmlandrum wrote: »
    .... it seems the best option for developing on the Propeller for Linux, but I was wondering if I have other options I can try out.

    If you are not restricted to SPIN and C, propforth works great on the slowest computer your can find. All you need is a terminal emulator (up to 230400 baud so far). In addition to interactive high level language, it allows direct interactive execution of assembler snippettes from the command line or forth routines.

    As for "best", it depends on what your goal is. Propforth is often ideal for getting a lot done quickly, and having fun. This can be useful in the tool chain.
  • jazzedjazzed Posts: 11,803
    edited 2012-05-17 09:44
    For those of us who love Open-Source-Software and the SPIN/PASM natural Propeller languages, there is Roy's Spin Compiler
    We really need to start beating up that compiler (testing that is) since it will play a very prominent role this year and more.
  • dmlandrumdmlandrum Posts: 13
    edited 2012-05-17 11:26
    My primary goal is to build a six-voice polyphonic synthesizer wherein the waveforms are generated within cogs, one cog per voice, with one cog for MIDI in and gate out and one cog for controlling the display and taking in input from rotary encoders. So, this is a DSP application, which I realize is not the most ideal application for the Prop, but I do have one, and I think it will work fine, especially since Johannes was able to emulate an entire SID chip inside a single cog.

    My goal here is to output as many oscillators from one voice as possible before heading outside the chip, so I won't be emulating a filter or anything like that. Each voice will get it's own output pin and then each go to its own analog filter stage (hence the gates from the MIDI cog) with filter envelopes done in the analog domain, before the voices are mixed together. I'm still debating what to do about output amps, or VCAs, and their envelopes. I'm thinking about doing that inside the Prop, except that would reduce the number of oscillators I could have running per cog. I'll have to play around with that.

    Not an easy project, I'm sure, but I do want to point out that I'm only a beginner to the Prop, not to electronics and DSP in general, though I wouldn't call myself advanced, either. Solidly intermediate, I think.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-05-17 11:38
    dmlandrum wrote: »
    a sex-voice polyphonic synthesizer

    If that's NOT a typo, you may want to get some funding going on KickStarter , too! :smile:
  • dmlandrumdmlandrum Posts: 13
    edited 2012-05-17 11:43
    mindrobots wrote: »
    If that's NOT a typo, you may want to get some funding going on KickStarter , too! :smile:

    Err, umm, yeah... It was a typo, but it does give me some interesting ideas for a synth. :D Okay, not really...

    I just fixed it.
  • dmlandrumdmlandrum Posts: 13
    edited 2012-05-17 15:18
    Just for the record, I am now calling this project the PolySpinth. Go me! :D
Sign In or Register to comment.