Minimal p2asm/spin development on macOS
bartgrantham
Posts: 83
After 5 years away I'm now getting back into P2 stuff, and I couldn't resist the Memorial Day sale for the P2-ES board. I read through the Google doc (Rev v33 B/C) to see how the ISA ended up, it's very exciting! The board arrived today and I've already plugged it in and had the delight of doing 60 blink in TAQOZ.
I'm ready to go deeper but this forum and the links and the tooling is a maze of twisty passages, all alike.
What tools do and do not work today (2020-05-30), particularly on macOS? And in the interest of others stumbling across this thread later, it'd be good to have feedback on Window and Linux, too.
I'm hoping for simplicity here. I don't need a GUI, I'm fine with vim in a terminal.
For example, I tried compiling some of the spin2 examples in the propeller repo with the fastspin included in the flexgui repo, but I was getting syntax errors. I tried running PNut_v33L.exe under Wine, but Wine couldn't run it without showstopping bugs. Is there a command-line mode for PNut?
I also have a lot of questions about the current trajectory of P2 development, such as "what is the state of USB?" and "what is HyperRAM and what can we expect it will do for the P2 ecosystem?" Is there a currently-updated FAQ? Should I just start opening threads?
PS - I'm dismayed to see that the forum still has profound usability problems even after 5 years. It's going to be a complicating factor for the growth of this platform.
I'm ready to go deeper but this forum and the links and the tooling is a maze of twisty passages, all alike.
What tools do and do not work today (2020-05-30), particularly on macOS? And in the interest of others stumbling across this thread later, it'd be good to have feedback on Window and Linux, too.
I'm hoping for simplicity here. I don't need a GUI, I'm fine with vim in a terminal.
For example, I tried compiling some of the spin2 examples in the propeller repo with the fastspin included in the flexgui repo, but I was getting syntax errors. I tried running PNut_v33L.exe under Wine, but Wine couldn't run it without showstopping bugs. Is there a command-line mode for PNut?
I also have a lot of questions about the current trajectory of P2 development, such as "what is the state of USB?" and "what is HyperRAM and what can we expect it will do for the P2 ecosystem?" Is there a currently-updated FAQ? Should I just start opening threads?
PS - I'm dismayed to see that the forum still has profound usability problems even after 5 years. It's going to be a complicating factor for the growth of this platform.
Comments
I generally eschew GUIs, but has anyone contemplated Atom integration? The apio project (open-source FPGA development toolchain) and Julia both ship Atom packages that go a long way toward jumpstarting user productivity.
flexgui probably also works but you'll need to check with Eric.
As for skipping the GUI entirely, is fastspin what most people are using for compiling/assembly now?
https://github.com/totalspectrum
In my haste I hadn't even tried building that from source, but I just tried it and make worked without issue. I'll keep that repo updated and refresh my binary that way. Thank you!
I use SubEthaEdit for editing and have created a seemode that does Spin2 syntax highlighting. For SubEthaEdt you can create a script to build and load your projects to the P2. Your sources can be C, Spin, Spin2, or BASIC!
And, macOS builds of the spin2cpp project are built whenever Eric makes changes in GitHub and are available from a TeamCity server. Here's a link to the current build: https://ci.zemon.name/viewLog.html?buildId=6316&buildTypeId=Spin2Cpp_MacOS&tab=artifacts
loadp2 build: https://ci.zemon.name/viewLog.html?buildId=6331&buildTypeId=Loadp2_MacOs&tab=artifacts
Those links will change for next github source updates, but you should be able to get the built artifacts from the server: https://ci.zemon.name
Since flexgui uses "make install" for macOS, there is no current storage of the project's built result on the TeamCity build server.
dgately
I should clarify what I meant by "help me test things". What I really meant is "was simple enough that a newbie like me could understand it and test the IDE without getting too confused and stuck on details, and that also satisfied my need for instant gratification after pulling the fresh PCB about of the static bag."
I didn't think the flexgui samples were too complicated. Maybe the problem is they're too simple? The blinking LED examples are trivial but they do provide "instant gratification" of a sort. The mandelbrot example (mandelbrot.bas) is kind of interesting, although granted it's only "drawing" on the serial terminal. And the Lunar Lander game (lunar.bas) is interactive and mildly fun.
But I'll certainly grant that more examples would always be better. What kinds of things did you have in mind?
If you liked the immediacy of blink in TAQOZ, then just download the full version onto an microSD card , pop it into your eval board, connect an ANSI terminal at 115,200 baud, and you have a whole development platform at your fingertips. It even includes an interactive P2 assembler as well. You can load code from the SD card since it handles FAT32 and even check and format your card on the board. Connect an W5500 Ethernet module and run HTTP and FTP servers or telnet into it and program remotely.
Do you have a VGA monitor? Plug it in to P0..P4 or anywhere else that suits (you just change a config setting) and switch your console to the monitor if you want or draw and view graphics, watch videos, play music or play a game. If you have a PS/2 compatible keyboard, plug it into the USB adapter that you may have there. Decompile modules, trace code, dump memory or device contents etc.
It's all there, on the P2 itself, with the Mac as an editor and terminal (although P2 can stand-alone). How minimal is that?
btw, I'm using minicom and I even open a terminal pane in VS and run it from there, but at 921.600bd.
This is the startup report on my terminal.
I just tried a couple led blink tests, worked great. This is plenty to get me started, maybe I'll have some thoughts on how to connect the dots for newbies more. In the meantime, thank you!
My mistake was to not look in flexgui's samples directory. I was looking for code samples in https://github.com/parallaxinc/propeller and nothing jumped out as a trivial test. Which is a good thing because if I had tried to run all_cogs_blink.spin2 from the resources/FPGA Examples and AFAICT I don't think it would have worked. And for a "day one" experience it would've been pretty frustrating. I wouldn't have known if it was 1) I didn't get flexgui set up properly 2) inappropriate code for a test 3) a fundamental macOS incompatibility or 4) a boneheaded mistake.
Wow. I already suspected that digging into TAQOZ was probably going to pay off bid dividends, I had no idea all those words were built. That's amazing. Sheesh, I might spend a few weeks just _playing_ before trying to write anything!
I just used screen instead of minicom, but maybe I'll outgrow a basic terminal soon enough.