SPIN on Linux?
prof_braino
Posts: 4,313
EDIT - Got it to work - Here's my notes (and review comments) for setting up SimpleIDE on Ubuntu 12.04. The focus is limited to loading a simple spin file, in particular devkernel.spin for propforth. It shows the tools is set up, and can load an image to prop EEPROM. This is geared toward first time users, as in kids and their parents.
http://code.google.com/p/propforth/wiki/LinuxPropforth
Please review, copy, or just read
* * *
I am in the process of switching to linux, in particular Ubuntu 12.04. At present, I'm running the Spin Tool on a windows virtual machine. I'm looking to skip the virtual machine work directly from linux on x86 PC and RaspberryPi. I'd also like to work from android devices, like samsung Captive phone and Nexus tablet, which I understand to be based on linux and might be treated in some ways similar to the PC linux. I think that are several partial solutions, which is the "right way" to go?
The primary requirement is to load the executable to the prop.
The other primary requierments is that it is straight-forward as possible to get it to run.
A secondary requirement is to be able to compile a single spin program into an executable. (The spin program has parameters that are set as constants at compile time, such as the I/O pin assignment for serial).
All other functions, such as GUI, multiple source files, compiling C, etc are nice to have but not show stoppers.
* BST - Brad's Spin tool is the recommended method, is this still the primary solution? Recent threads indicate this might be in some way broken, is this the case? Is bstc the tool folks actually use?
* homespun - http://propeller.wikispaces.com/Homespun+Spin+Compiler - is this the "better" choisce these days?
* simpleIDE - is this only used as the interface to the C compiler?
* stick with virtual window machine?
The prefered option would be something that we just load and use. The least favorite options are those that require loading and compiling source, configuring extra comipilers, or adding non standard support to the OS.
http://code.google.com/p/propforth/wiki/LinuxPropforth
Please review, copy, or just read
* * *
I am in the process of switching to linux, in particular Ubuntu 12.04. At present, I'm running the Spin Tool on a windows virtual machine. I'm looking to skip the virtual machine work directly from linux on x86 PC and RaspberryPi. I'd also like to work from android devices, like samsung Captive phone and Nexus tablet, which I understand to be based on linux and might be treated in some ways similar to the PC linux. I think that are several partial solutions, which is the "right way" to go?
The primary requirement is to load the executable to the prop.
The other primary requierments is that it is straight-forward as possible to get it to run.
A secondary requirement is to be able to compile a single spin program into an executable. (The spin program has parameters that are set as constants at compile time, such as the I/O pin assignment for serial).
All other functions, such as GUI, multiple source files, compiling C, etc are nice to have but not show stoppers.
* BST - Brad's Spin tool is the recommended method, is this still the primary solution? Recent threads indicate this might be in some way broken, is this the case? Is bstc the tool folks actually use?
* homespun - http://propeller.wikispaces.com/Homespun+Spin+Compiler - is this the "better" choisce these days?
* simpleIDE - is this only used as the interface to the C compiler?
* stick with virtual window machine?
The prefered option would be something that we just load and use. The least favorite options are those that require loading and compiling source, configuring extra comipilers, or adding non standard support to the OS.
Comments
Had trouble installing BST under Ubuntu until I found http://gpio.kaltpost.de/?page_id=1378 which was extremely helpful. In my installation, i could not make the BST serial terminal work with the simple interface, but it runs perfectly well with the USB interface. IMHO, just being able to use #define makes BST worthwhile (and it has some other nice features, such as pointing out unused variables, compiler output listings, etc.). I do 99% of my programming in PASM -- after some SPIN in cog#0 starts the PASM cogs, it is overwritten by more PASM...
I could not make SimpleIDE run under Ubuntu 10.04 if I remember correctly (because of a different Python version (?) -- I am not certain).
Cannot comment on "homespun".
Python error with SimpleIDE? Must have been another problem.
Roy's SPIN compiler (dubbed SpinRoy by someone) can be built to run on any OS platform. It has preprocessor stuff.
If it weren't for the trouble getting the IDEs to work (I am not really into the nitty-gritty of setting up software under Linux: gave up after failing to get Catalina and SimpleIDE to run as expected), I would also consider gcc provided it were to output clean cog memory model code. I am not too thrilled about gcc inline assembly (tend to use *.S files instead when writing AVR code [90% c, 10% assembler]).
Kind regards,
Fred
What's dirty about it?
This is the type of user I have in mind for this question.
What requires the least amount setting up under linux to load spin to a prop? On PC? On Raspberry Pi?
If it takes more than a couple weeks to get it working, it probably won't work out. Is a windows virtual machine still the most straight forward method? The install takes two days to download all the updates and Smile, but at least it works.
I uses it and I likes it!!
It goes from Win to Mac to Linux (multiple flavors) and works for me. I don't do lots of original development in Spin but I do a lot of tweaking/cutting/pasting/compiling an loading and it does all of that for me. Once you get used to the IDE, it's nice too because you can go from Spin to C/C++ without thinking about the IDE changing.
I think it still uses BSTC as the underlying compiler but I imagine will change over to SpinRoy (use it three times and it sticks) some day.
I'm guessing (hoping/betting) SimpleIDE stays a multi-platform/multi-language tool for the Propeller programmer. Between it, the latest an greatest SpinRoy and the PropGCC package, it should take you most anywhere.
I believe Heater has it running the Raspberry Pi but I haven't tried that yet (ok, it's on my list!).
David Betz's Prop loader is becoming (has become) a very versatile tool for loading the P1 and P emulators. It's part of the PropGCC package. It supports configuration files for the various hardware boards which is very useful (and can be used to pass load time parameters into a C/C++ program at load time, if I remember correctly - very cool!)
I'm currently back to running a lot on a Win7 environment due to some projects I'm working on but long term, I've become a Mac/Linux user with Win reluctantly running in a virtual box if ABSOLUTELY needed.
I think you are WELL aware of my proudly acknowledged attention deficit issues...if anything takes me two weeks, I'm at least a week into a different project by then.
My memory may be failing me but I recall SimpleIDE taking about 5 minutes plus download time to get it installed and running example programs on a Fedora 17 distribution. I have done it on Ubuntu and don't recall it being painful.
*BST - Despite my recent thread BST is alive and well on Linux. Brad's latest prerelease vesion does not run on my 64-bit Debian but previous versions do. Especially the "release" versions. Don't forget there is also BSTC and BSTL the
command line compiler and loader if you want to go that way. All highly recommended.
* HomeSpun. Works fine. You just need to install the mono run time for .NET.
$apt-get install mono
or whatever they do on Ubuntu now a days. I even have HomeSpun running on the Raspberry Pi under Raspian.
* SimpleIDE. Excellent choice. Also works for Spin. If there is no released binaries that do that on Linux just shout and I'll make one for you. I also have SimpleIDE running under the Raspberry Pi, although it cannot compile Spin there yet as it uses BST for which there is no ARM version. Hope that gets fixed soon now that we have SpinRoy.
* stick with virtual window machine? Dear God no.
You have to get your feet wet with compiling stuff for Linux someday. It's an initiation right:) Luckilly propgcc and/or SimpleIDE have been very easy to build from sources.
I like that. My boss does not, but I do:)
That's the best part, Steve comes to your home and personally installs it!! Make sure there is someone else on the list behind you though because it's really hard to get him to leave!!
Kidding aside, I need to look around for instructions (or hope someone else can point you to them), it's been a while since I've done it. I don't want to lead you astray with old info after leading you here!
The Debian distributions work on Ubuntu and Mint. Choose 32 bit or 64 bit to fit your system.
Version 0-8-5 is the latest for public use: https://code.google.com/p/propside/downloads/list?can=2&q=0-8-5&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount
If you're resourceful enough, you can find the latest one we are testing (bugs and all).
Here is the bash script that I use to automate the process.
To use, you just
I have managed to compile some simple Qt(C++) apps to run on Android. Seems the Qt guys have now taken on Android as a primary platform so it must be even easier now. So the Spin compiler and loader should not be a big problem. No idea about Simple IDE. Still, where does the serial port come from. Can't do it on my phone.
My Samsung supports USB OTG and I can see No reason why a FTDI chip cant e used ..
UPDATE http://slickdevlabs.com/slick-usb-2-serial-library/
this and my FTDI based USB-19-H Keyspan adapter is working great ....
UPDATE the parallax " USB to 232 " Rev B is also recognized and I can bang bits .
also Here is a wild Idea ....... the modern tablets have Tons of CPU power for there needs ...... I have on my samsing S3 phone a X86 Emulation program . I can boot in to Puppy and DSL linux . its a slow boot but it does work . sooooo with a few more tweaks Ill bet it may be possable to shoehorn a a version of BST or what not on it ......
What threw me was the "CMM preview test package" tag, it looked like a testing beta version. I definitely do NOT want the one your working on, If you haven't got it working, I certainly won't.
Will the default LMM work with stock memory, or do we have to change things to get it to work?
Version 0-8-5 is what people have been using for 6+ months.
Ya, I know what you mean about the WIP (work in progress) version. I just mentioned it because we had an unplanned pre-release before without having a chance to say the thing is done. Wanted to head it off at the pass.
There are many improvements coming in the next version which is a bit over-due.
Yes, it should work. HUB is the generic board type for C. The SPIN board type should always be NONE.
The user guide which is out of date doesn't talk about SPIN much if anything.
To work with a SPIN top file, just open the top file and click the COG button to set a project.
Make sure the compiler is set to SPIN before building with the hammer.
Load RAM and RUN with the blue "play" arrow.
If you really need me to look over your shoulder as Rick suggested, it can be done with Google.
Best of luck,
--Steve
I followed the instructions in the User Guide (I think).
* downloaded the 0-8-5 archive
* created a directory PropSoftware
* move the archive here and extracted the archive
* ran sudo ./setup.sh braino
* ran ldd ./simpleide (this said "not found")
* ran ./simpleide (closed two of the three windows that popped up, the splash and the properties. Why did properties window open, do I need to set something?)
* created project TEST20130404. Type SPIN.
Where am I to put the devkernel.spin file I want to run? I can't find the project directory I think I created, and there doesn't look like there's a directory specifically for source.
Am I close?
Congratulations. You are very close.
The TEST20130404 project should have created a TEST20130404.spin file in project manager.
Parallax wants me to refine SPIN behavior after the upcoming release. Sorry for any trouble.
Your devkernel.spin file can live anywhere.
1) Use the Yellow file folder button (or with the Menu -> File -> Open command) to find and open your devkernel.spin file.
2) Once you do that, click the blue COG in the toolbar next to the wrench. That will create a project called devkernel.
3) Once you have the project you can compile/load, etc....
The properties pops up to let you know it's there just incase something needs to be adjusted.
I'm pretty sure the startup sequence is mentioned in the manual.
Hmm, ldd not found? Ok. I need to make Linux packages for these installer things in the near future.
Found my SPIN source...
Made a project....
Figured out "Set Project" after I got tricked...
The Hammer Icon gets me Bulding....Done.
The green down arrow gets "Error opening serial port /dev/ttyUSB0", as do the other two arrow buttons.
Do I need to add SimpleIDE or BST to the USB group or such?
Do I need to log out or reboot?
so close!!!
Assuming you really have /dev/ttyUSB0 ....
You need to add "dialout" to your groups. I.E ....
It needed my username added to the dialout group.
This wasn't in the instructions, was it? Is this peculiar to Ubuntu 12.04?
No those permissions issues are all over Linux. And a GOOD THING to. You'll soon the hang of it. Some instructions in the install procedure would obviously not go amiss though.
Encouraged by the discussion above, I once again attempted to install SimpleIDE 0.7.2 under Ubuntu 10.4. The installation works, but when i attempt to run SimpleIDE, I get this message: "Cannot mix incompatible Qt libraries". I know, SimpleIDE expects a Qt version >=4.8 which is not compatible with Ubuntu 10.04 if I am not mistaken. That is quite painful. I will stick to BST because I want to spend my time writing Propeller code instead of struggling with IDE installation issues. But maybe somebody can tell me if there is an easy workaround?
I think you should try the latest SimpleIDE release as indicated above, https://code.google.com/p/propside/downloads/list?can=2&q=0-8-5&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount
There should be no issue with incompatible libs as SimpleIDE comes with it's own Qt libs.
Don't forget propgcc and SimpleIDE are still quite new stuff and it can be expected to have wrinkles. One day we might hope to see packages for Ubuntu, Debian, RedHat etc that streamline installation. But that's a lot of work to maintain I would imagine.
As for "struggling with IDE installation issues" I wasted half a day figuring out why BST does not run on my machine until I hit upon a version that does.