P2 and Fedora Linux
cbmeeks
Posts: 634
in Propeller 2
So I haven't even put power to the P2 Eval board yet and already hit a snag...lol
I'm using Fedora and when I follow the tutorials here (https://www.parallax.com/visual-studio/), I see that Linux support assumes we are using Ubuntu.
It says I need to install Flexprop via the source code. However, it seems that I get nothing but errors. Before I try to dig deeper into these errors, is there an easier/simpler way?
All I really want to do is (preferably) use Visual Studio Code and be able to assemble P2 code and upload. If I need to run a command line tool to compile/upload, that is fine.
I just don't want to waste hours of time trying to get software to work when there might be a simpler solution.
Thanks
Comments
If you just need the command line compiler, compile just the misleadingly-named spin2cpp repo: https://github.com/totalspectrum/spin2cpp
The only things you need to have installed are git, make and bison (and of course gcc and glibc-dev or whatever random packages your distro needs to compile C code)
Then you should be able to move the binaries to your place of choice and set up your VS Code tasks (though I never do that and just use the built-in terminal)
Actually, I think I've used that before but I was thinking it wasn't all that great for P2. I will give that a shot.
Thanks!
It's come a long way. At this point it's better than the Parallax in-house tools in many regards, though there's a few warts to be aware of. Though none of that applies to using it as a pure assembler.
Disclaimer: I have contributed quite a lot to it.
Oh, and that's just the compiler. The loader is a separate tool: https://github.com/totalspectrum/loadp2 Never compiled that one on Linux, but should also just work.
I just checked and I do have it on my computer and now I remember compiling it back in March or so.
I'm using version:
Spin to C++ converter version 5.9.10-beta-v5.9.9-57-gd1707a50
I see recent changes so I will rebuild and update.
Thanks
Oh, that's kinda ancient (and may be in the range where the debugging was broken and no one noticed)
Wow, that was easy. Now running version:
Spin to C++ converter version 5.9.19-beta-v5.9.18-42-g73bee9ef
You probably want to use the
flexspin
frontend though...Front end? You mean an IDE?
No. For reasons(tm), there's 3 different binaries in the build folder that take mildly different parameters: spin2cpp, flexspin and flexcc
They mostly do the same thing, flexspin is just the least hassle to use for actual compilation (as opposed to the C++ conversion spin2cpp does by default):
flexspin -2 whatever.spin
SUCCESS!
So I just used:
And then
My code is:
And now I'm seeing the pretty blinkenlights. :-)
It even automatically found the correct serial port which I struggled with on Arduino.
Ha, looks like you were typing that at the same time I was.
Thanks again for your help. At least I'm up and running now.
Now, one more followup question if you don't mind.
Can I just use any old serial monitor to communicate both ways with this or is there something special I need to run? For example, if I want to send/rec serial data to it while the P2 is running what should I use?
you can give loadp2 a -t switch to get a terminal (or capital -T if you want spicy PST control codes), but in theory anything works. Default baudrate is 115200. If you want to use the -gbrk compiler flag for asm debugging, you need to change it to 2000000, because that's what that defaults its output to.
A constant symbol of
DEBUG_BAUD = 115200
sets the debugger baud. In C that's set withenum {DEBUG_BAUD = 115200}
When i started with my RMII-Interface-Driver(ethernet), it was on flexprop.
The reason was that the parallax software would not find my serial port under wine (when i was using linux)
@cgracey
there is something peculiar going on in the Propeller Tool Serial Driver that makes it NOT WORK IN WINE on linux. i bet it is something miniscule that can be fixed easily
The newest beta of Proptool fixes it - https://github.com/parallaxinc/Propeller-Tool/releases/tag/v2.8.0_beta
Pnut's comms has always worked under Wine so I'm guessing some of that code has been moved into Proptool now.
Further reading - https://forums.parallax.com/discussion/comment/1543879/#Comment_1543879
You have to install all dependencies for your Linux distribution, as they are listed in the readme. Fedora is rpm based, so you have to find and install proper rpm packages instead of deb ones. After this all should compile without errors. I have even a Flexprop built on my Raspbery Pis (3 and 4) (but the RPi OS is Debian based so no problems at all)