Propeller 1 Spin on a Mac?
Ken Gracey
Posts: 7,392
in Propeller 1
Hello Spin programmers:
We have a customer who needs to edit/code Spin1 on a Mac, using the latest operating system upgrades.
What are the options for her?
Thanks,
Ken Gracey
We have a customer who needs to edit/code Spin1 on a Mac, using the latest operating system upgrades.
What are the options for her?
Thanks,
Ken Gracey
Comments
Other than that, I guess there's openspin or homespun? Either of these should work, but there's no GUI, which may be a dealbreaker to her. Would also need a separate loader, not sure what the MacOS situation is with those.
I am running Propeller IDE version 0.37.5. There is a nasty bug in .38 on mac.
Thanks for any help on this or tips on where else to look.
Other choices include HomeSpun and OpenSpin which compile Spin and PASM for the P1.
At the moment I'm working on copying the compiling and running scripts from FlexProp into a "new language" in the list of languages in CodeRunner. I seem to be getting there, but now the Mac OS doesn't want to let me run flexspin.mac, complaining mightily about it being able to damage my system, etc. It lets FlexProp run it, though ?? Looking at the OS security preferences window where I can give permissions to files and stuff I don't see a way to add this one. I'm now going to try a Python program to read the file byte by byte and write it to a new file created by me. I wonder if I'll be able to run that one. Any tips from someone more experienced would be appreciated. I ordered a P2 eval board from DigiKey in hopes that I'll be able to work with it to my satisfaction. It sure would be nice if Parallax could support their chips nicely cross-platform like the Arduino does. Seems like it would be a great marketing boost.
You can also set up a task such that you only have to hit a key combination and it will automatically save all unsaved files, spawn a terminal and run a command of choice.
Thanks, but IMHO my website looks terrible. I haven't done anything to it in years.
Stephen was trying to get a button in VSC to do the compile and possible download. Don;t think that's done yet tho.
I learned a lot by getting the FlexProp commands connected into the CodeRunner IDE I like so much, but there are still a couple things in my process that aren't what they should be, and the commands still pull up Wish in the background, so really copy/pasting into FlexProp and running from there is a decent workaround, all things considered.
I installed VSC and will look into running the P1/P2 from there with your tips. However, it appears huge and overly cluttered for running Python and C/C++, compared to the ultra clean interface and operation of CodeRunner on the Mac. I see there's a program called Code Runner in their listing of add-ons but that's not the Mac program I like. Plus I see that (typical Microsoft) they don't support the perfectly good Python already installed on the Mac, but want you to download another installation. I didn't look at what they do with C++ yet. Really I'm just interested in it for potential FlexProp automation. I'll gladly avoid Microsoft meddling whenever possible, but I'll use it when practical for me.
Thanks for the helpful information:-)
I know this was more detail than you needed, but it's a lonely world now, hiding in our rooms away from people:-) Nice to have contact with someone interested in a related topic. I suppose I'll be back in the P2 forums after that arrives in a couple days from DigiKey. I looked to be sure it was rev C. At least now I'm pretty sure I'll be able to talk to it. Thinking about a robot project, medium size, able to wander around the house and have capabilities added from time to time. Maybe a cog for control logic, a cog for mobility control, a cog or two for sensor interfacing, things like that. Also an excuse to machine things, 3D print things, and do some electronics.
If you're still reading this far, I can't find what these -r -t -k switches are. I've been reading through documentation files for FlexProp and other things I can identify but haven't come across thee yet. This is the command string that loads and runs the compiled program:
/Users/jefflastofka/flexprop/bin/mac_terminal.sh "/Users/jefflastofka/flexprop/bin/proploader.mac" -Dbaudrate=115200 -p /dev/cu.usbserial-2120 "/Users/jefflastofka/flexprop/samples/HelloWorldPropC.binary" -r -t -k
-k indicates that loadp2 should wait for user input before exiting (typically from -t or -T)
-r don't know what that is for
I also played around with VSC as Cluso99 was recommending and I now see how easy it is to have the UNIX terminal (Mac Terminal app) running in the window in VSC, so I can put a shell script in there and (probably) program it to do what I want. This is probably going to be my best overall approach to running the Propeller programming tools.
I've added so much to my knowledge of this level of tinkering just in the last two days of poking around and then asking a few questions here. I'd feel bad about hijacking the thread except I'm sure the original intent of it was satisfied long ago anyway:-)
Then, go into the settings, find the "Task: Save Before Run" setting and make sure it is set to prompt or always.
Then, go into the keyboard shortcut editor and set "Tasks: Run Task" the combination of your choice.
Now, pressing that combination will bring up a menu that will let you select your task (it defaults to the last used command, so you can just press enter after the first time) and if you select the task, it will switch to new terminal and run your command inside.
However - I really appreciate the tip and I learned a lot. And it works:-) I think I'll like it.
I used the Mac keyboard preferences to add a keyboard shortcut to the Run Task... item in the Terminal menu, which is a missing capability in at least the Mac version of VSCode.
I need that the first time to get the default accepted. After that I use the Rerun Last Task that VSCode does allow a keybinding for, and it works instantly with no follow up clicks or keys.
I also found ${fileBasenameNoExtension} to put in my json file to bring in the working file name.
AND - I discovered I can just click the delete (trash) icon to kill the resulting terminal output window after I view my results, which is quicker than the usual keystroke replies to end things there.
So, thanks for your help and patience with my (probably) too much conversation about this:-)
It can only build & run spin2 files, but could easily be modified for P1 spin (I'm sure some enterprising individuals could mod it for flexcc as well). The following is set up for flexprop's libraries as well as a set of libraries that I culled from the propeller github (mostly, JonnyMac's drivers). There are comments to help defining your paths:
Probably will work on Linux as well...
You may need to run the flexprop GUI at least once to set up the port(s) where your P2s show up!
Build:
Run (will build & run the file):
dgately
I wonder if the Windows and Linux VSCodes are missing the ability to key bind to the Task Run command or if it's just the Mac version. Fortunately it's easy to add it from system keyboard preferences, and I only need to run it once at the beginning of the project so I might be silly for bothering to add it anyway (I was in a learning mode and trying to customize everything...) After that, Rerun Last Task every time. At least that's how this is playing out for me. Perhaps others do it differently.