Shop OBEX P1 Docs P2 Docs Learn Events
P2 and Fedora Linux — Parallax Forums

P2 and Fedora Linux

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

  • Wuerfel_21Wuerfel_21 Posts: 5,106
    edited 2022-10-28 20:26

    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...

    $ build/flexspin
    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2022 Total Spectrum Software Inc.
    Version 5.9.19-beta-W21-no-wait-fcache-v5.9.18-29-g72305cb2 Compiled on: Oct 25 2022
    
  • Front end? You mean an IDE?

  • Wuerfel_21Wuerfel_21 Posts: 5,106
    edited 2022-10-28 21:17

    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

  • cbmeekscbmeeks Posts: 634
    edited 2022-10-28 21:26

    SUCCESS!

    So I just used:

    flexspin -2 Test.spin2
    

    And then

    loadp2 Test.binary
    

    My code is:

    PUB MinimalTest()
        REPEAT
            PINWRITE(63..56, GETRND())
            WAITMS(100)
    

    And now I'm seeing the pretty blinkenlights. :-)

    It even automatically found the correct serial port which I struggled with on Arduino.

  • cbmeekscbmeeks Posts: 634
    edited 2022-10-28 21:22

    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.

  • evanhevanh Posts: 16,031

    A constant symbol of DEBUG_BAUD = 115200 sets the debugger baud. In C that's set with enum {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

  • evanhevanh Posts: 16,031
    edited 2022-10-29 02:56

    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

  • pik33pik33 Posts: 2,388
    edited 2022-10-29 19:00

    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?

    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)

Sign In or Register to comment.