Shop OBEX P1 Docs P2 Docs Learn Events
Minimal p2asm/spin development on macOS — Parallax Forums

Minimal p2asm/spin development on macOS

bartgranthambartgrantham Posts: 83
edited 2020-05-30 11:35 in Propeller 2
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.

Comments

  • I should point out that flexgui works for me, AFAICT. I can't find any example code that would help me really test things, but it doesn't crash.

    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.
  • Cluso99Cluso99 Posts: 18,069
    Try VS Code for editing. By all accounts it works on MAC.

    flexgui probably also works but you'll need to check with Eric.
  • Yeah, I mentioned flexgui works for me. :)

    As for skipping the GUI entirely, is fastspin what most people are using for compiling/assembly now?
  • 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.
    If you have Xcode installed on your Mac you can just clone the sources for spin2cpp from Eric's repository and build it. It produces an executable called fastspin that is all you need as a compiler and assembler. Eric also has loadp2 that can be used to load the P2. You can get everything from his GitHub repository.

    https://github.com/totalspectrum
  • Yeah, I mentioned flexgui works for me. :)

    As for skipping the GUI entirely, is fastspin what most people are using for compiling/assembly now?
    Probably on the Mac. PNut only runs under Windows.

  • David Betz wrote: »
    If you have Xcode installed on your Mac you can just clone the sources for spin2cpp from Eric's repository and build it.

    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 should point out that flexgui works for me, AFAICT. I can't find any example code that would help me really test things, but it doesn't crash.
    There are various examples in the "samples" directory that comes with flexgui.
  • dgatelydgately Posts: 1,621
    edited 2020-05-30 13:34
    If you get flexgui sources from git hub, loadp2, & spin2cpp (which includes fastspin) are included and will build on your macOS CPU ("make install"). I copy fastspin, spin2cpp & loadp2 to /opt/parallax/bin and set that directory in my environment within .bash_profile. That way those tools are always available from the command-line without need for any GUI.

    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
  • This is great, guys. Thank you. I had no idea I'd get a response so incredibly fast.
    ersmith wrote: »
    I should point out that flexgui works for me, AFAICT. I can't find any example code that would help me really test things, but it doesn't crash.
    There are various examples in the "samples" directory that comes with flexgui.

    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." :)
  • This is great, guys. Thank you. I had no idea I'd get a response so incredibly fast.
    ersmith wrote: »
    I should point out that flexgui works for me, AFAICT. I can't find any example code that would help me really test things, but it doesn't crash.
    There are various examples in the "samples" directory that comes with flexgui.

    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?
  • Mike GreenMike Green Posts: 23,101
    edited 2020-05-30 14:35
    Just to add another "voice". I use a Mac for all my Propeller tasks. BBEdit for some editing, FastSpin and flexGUI for all P2 and some P1 work. SimpleIDE for C and Spin on the P1 although it's awkward to get it to create the .side project file for Spin initially. I use the built-in serial terminal in loadp2 and proploader, occasionally use CoolTerm for a VT100 terminal. I have a copy of Parallels Desktop that runs Windows 10 and use that to run PNut occasionally. You can even run HomeSpun (a Spin -> P1 compiler) under Mono from the Mac command line.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-05-30 14:53
    Minimal development? How about installing Visual Studio Code as mentioned. I have installed it on Linux and I love it, even though I have used dozens of excellent "editors", and the experience for macOS 10.10+ should be the same.
    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.
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.5 'CHIP' 200MHz 200504-1430                     
    MODULES:                                                                                                       
         44 *TED*           TAQOZ EDITOR - A text editor for TAQOZ                                                 
        350 *PLEXLED*       CharliePlexing LED device driver 190714.0000                                           
       1172 *LIFE*          Conway's Game of Life for TAQOZ in the P2 ROM V1.0 190226.0000                         
       2880 *SIM65*         A SIMULATOR FOR THE 65C02 - 200217.0000                                                
        444 *MORSE*         Morse code keyer 200126-0000                                                           
       1518 *C2*            C2 Debug Interface for Silabs Microcontrollers - 200424.0000                           
       3736 *EASYNET*       WIZnet NETWORK SERVERS 160707.1500                                                     
       2290 *W5500*         WIZNET W5500 driver for TAQOZ V1.0 191007                                              
        518 *MANDELBROT*    MANDELBROT VGA DEMO 190800-0000                                                        
       1506 *BREAKOUT*      BREAKOUT FOR THE P2 - 190606                                                           
        654 *PS2*           PS/2 KEYBOARD                                                                          
       1508 *TEXT*          VGA BMP TEXT 190800-0000                                                               
       1260 *BMV*           BMV VIDEO PLAYER 190800-0000                                                           
        772 *WAVE*          WAVE AUDIO FILE PLAYER 190800-0000                                                     
        430 *BMP*           BMP FILE VIEWER 190800-0000                                                            
       1942 *TIM*           TAQOZ INTERACTIVE MEDIA - AUDIO, TEXT, IMAGE & VIDEO DRIVERS 200403-1200               
       4866 *TIA*           TAQOZ INTERACTIVE ASSEMBLER for the PARALLAX P2 - 200327-2300                          
        654 *CLKGEN*        Si5351 Clock generator 190800-0000                                                     
       2498 *DISK*          SD DISK REPORTING & FORMATTING TOOLS 190800-0000                                       
       4738 *EASYFILE*      SD CARD plus FAT32 with VIRTUAL MEMORY  190800-0000                                    
       1410 *SPIRAM*        LY68L6400 8MB SPI RAM ACCESS 191020-0000                                               
       1770 *DECOMPILER*    A decompiler for TAQOZ 190825-0000                                                     
       1190 *RTC*           RV-3028 RTC DATE and TIME 190800-0000                                                  
        622 *SMARTPINS*     SMARTPIN FUNCTIONS and drive modes 190800-0000                                         
        390 *P2CLOCK*       P2 CLOCK CONTROL 190800-0000                                                           
       2278 *ANSI*          ANSI TERMINAL SUPPORT 200410-0000                                                      
        392 *EXTEND*        Primary kernel extensions 200525-1000                                                  
       5756 *SPIFLASH*                                                                                             
    MEMORY MAP                                                                                                     
      CODE:         0DA3E  55,870 bytes                                                                            
      WORDS:        1A643  22,823 bytes                                                                            
      DATA:         7E1A4  420 bytes                                                                               
      ROOM:                52,229 bytes                                                                            
    HARDWARE                                                                                                       
      PCB           P2      (P2D2)                                                                                 
      CLOCK IN      20.000000MHZ                                                                                   
    DEVICES                                                                                                        
      SD CARD       63 GB  SANDISK   SD SC64G REV$80 #35190404 DATE:2018 /10                                       
      SPI FLASH     16MB WINBOND $EF40_1800 #4837448895114529879                                                   
      USB           Silicon LaBS; EFM8UB3 P2D2v4  USB Bridge UB3_2.5.6 ;0005                                       
    I2C DEVICES                                                                                                    
      $36           P2D2 UB3 USB+SUPPORT  UUID:82C4CF0827DEE8118C5342B1A51F80DA                                    
      $A4           RV-3028 RTC                                                                                    
      $C4           Si5351A CLOCK GEN                                                                              
                    2020/05/31 SUN 00:47:25   38.24'C   Vdd=1.838V                                                 
    -------------------------------------------------------------------------------                                
    TAQOZ#
    
  • Minimal development? How about installing Visual Studio Code as mentioned. I have installed it on Linux and I love it, even though I have used dozens of excellent "editors", and the experience for macOS 10.10+ should be the same.
    That is a good choice and it works well on macOS... I only use SubEthaEdit because I got used to it developing other macOS-based software! I just have not had time to build-up VSC tasks to build and load P2 bits!

  • ersmith wrote: »
    I didn't think the flexgui samples were too complicated.
    ...
    But I'll certainly grant that more examples would always be better. What kinds of things did you have in mind?

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

    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.
Sign In or Register to comment.