Shop Learn P1 Docs P2 Docs
Visual Studio Code supports P2 development on Windows, Mac, Linux (yes, RPi) - Page 4 — Parallax Forums

Visual Studio Code supports P2 development on Windows, Mac, Linux (yes, RPi)

124»

Comments

  • Wuerfel_21Wuerfel_21 Posts: 3,138
    edited 2021-06-15 22:42

    Here's a VSIX of the align extension. Insert to toggle modes, etc, etc.... Is probably kinda buggy, etc, etc...

  • Wuerfel_21Wuerfel_21 Posts: 3,138
    edited 2021-06-16 19:49

    I've fixed two issues with the align extension, now newlines work properly and I also fixed an edge case that would break alignment in some cases.

    EDIT: Aaaaand fixed another one

  • Cluso99Cluso99 Posts: 18,063

    I just noticed this marking of indented code in VSC.
    Looks good but don't know if it is possible with spin/spin2?

  • Stephen MoracoStephen Moraco Posts: 218
    edited 2021-09-24 22:22

    @Cluso99 Interesting... do you know which extension or setting is enabling that display? Once I learn that I can research how to get support. Who knows, maybe?

    FYI- I run with settings that always show my code as follows:

    I realize it's not quite the same but offers some of the same indications.

  • Stephen MoracoStephen Moraco Posts: 218
    edited 2021-09-25 00:14

    @Wuerfel_21 am trying your overtype extension... Aaaand it (0.4.3) seems to work fine! Nice.

  • Cluso99Cluso99 Posts: 18,063

    @"Stephen Moraco"
    No idea. It was in yesterday's update on the update features page.

  • NEWS

    I've just released v1.2.0 of our spin2 extension. The changes are:

    Highlighting Update, Bugfixes, and Catch up with Spin2 Language updates inclu. new DEBUG methods and constants

    Syntax/Semantic Adjustments:
    NEW: add new Spin2/Pasm2/Debug methods & constants which were added since our last release
    NEW: directives that shouldn't be used in inline-pasm are now highlighted with bright red color
    BUGFIX: parser no longer expects pasm2 labels to be in the 1st column
    BUGFIX: added missing: four pasm if_ conditionals, one spin2 method name
    BUGFIX: parser now parses multiplying of constant values correctly
    BUGFIX: previously seen files no longer affect the semantic highlighting of the current file
    BUGFIX: symbol-names starting with PUB, PRI, CON, DAT, etc. are no longer confusing parser
    BUGFIX: RES and FIT coloring is working

    Please review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2. Install it and you are good to go. Additionally, as suggested, it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing this new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? Some of you may have heard we are working on Propeller Tool like custom tabbing for VSCode. Yes, we are refining its behavior and it will be appearing in an upcoming extension release!

    Enjoy!

    Stephen

  • Its' really great, to the point of changing my mind about spin. I am working with a KISS board.

    I want to ask about the loadp2 task.

    loadp2.exe -b230400 myapp.binary -t

    It works fine actually but it seems to load it into RAM because when I repower the board it runs a program previous program.

    When I use the Propeller Tool there are 2 options, Load RAM and Load FLASH.

    Currently it seems the load task loads to RAM. What changes to the loadp2 task should I make so I can load to FLASH.

  • @VBBSim said:
    Its' really great, to the point of changing my mind about spin. I am working with a KISS board.

    Thank you, that's really fun to hear. I'm at the point where I use VSCode for all my Spin2/Pasm2 editing needs now.

    I want to ask about the loadp2 task.

    loadp2.exe -b230400 myapp.binary -t

    It works fine actually but it seems to load it into RAM because when I repower the board it runs a program previous program.

    When I use the Propeller Tool there are 2 options, Load RAM and Load FLASH.

    Currently it seems the load task loads to RAM. What changes to the loadp2 task should I make so I can load to FLASH.

    You are correct. The solution will be to load a flasher program (provided precompiled with FlexSpin) as well as your program with something like:

    bin/loadp2 -b230400 @0=board/P2ES_flashloader.bin,@8000+MY_FLASH_FILE.BIN -t -k

    I haven't had time to test this and post the solution to our how-to page and update the TASK file examples.

    If you look in the PNut task file example you can see how we'll add flashing to the file. We need to add the flash section to the task file and
    change the command within the new section to invoke loadp2 as it does for loading ram but then add the additional parameters to make it load flash instead.

    Does this make sense? You should have enough info here to get it working. If you do, would you mind sending me the task file additions you ended up with? I'll then test to confirm and update my Tasks page with your contribution applied to all needed platforms.

  • @"Stephen Moraco" said:
    Does this make sense? You should have enough info here to get it working. If you do, would you mind sending me the task file additions you ended up with? I'll then test to confirm and update my Tasks page with your contribution applied to all needed platforms.

    Yes I understand. I will send task changes when I figure it out.

  • Yes, it worked just as you suggested with one slightly hacky work-around. I put a copy of the P2ES_flashloader.bin into a board/ directory in the project (suite) because I am not sure how to specify the found working path directory of the loadp2.

    I then had the idea to add an extra build task and aligned the function keys with prop tool
    F8 = Compile
    F10 = Program RAM
    F11 = Program Flash

    // Place your key bindings in this file to override the defaults
    
    [
        {
            "key": "F8",
            "command": "workbench.action.tasks.build",
            "args": "compileP2"
        },
        {
            "key": "F10",
            "command": "workbench.action.tasks.runTask",
            "args": "downloadP2"
        },
        {
            "key": "F11",
            "command": "workbench.action.tasks.runTask",
            "args": "flashP2"
        },
     ]
    
    

    I attached the task.json zipped because quite long.

  • VBBSimVBBSim Posts: 37
    edited 2022-02-18 23:38

    @"Stephen Moraco" said:
    Thank you, that's really fun to hear

    I think the VSCode is a game changer. I usually use Full Visual Studio but I have knocked about enough in VSCode to know my way around. I have written a single step debugging extension in VSCode with variable viewers. If we can figure out the backend debugger, symbols tables, memory allocation etc I will dust off my code and see if I can bind a debugger to Spin. It might be easier in the Flex compiled spin vs interpreted spin as the variables might actually have static locations?? not sure, it seemed mysterious last time I tried to figure out.

    I had been pretty much allergic to spin in the pnut notepad and propeller tool color band bubblegum styling but I can already feel the coding patterns binding as I work with VSCode. Git integration and all the rest. The Propeller tooling circus seems highly fragment but this feels very modern.

  • NEWS

    I've just released v1.2.3 of our spin2 extension. The changes are:

    Minor Highlighting Update

    • Repair highlighting of float operators used in spin2
    • Repair coloring of constant names used in array declarations
    • Minor update to debug() statements: (1) allow in pasm, (2) don’t flag unknown names within debug()
    • Repair recognition of org on DAT lines

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing this new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? We continue to work on Propeller Tool like custom tabbing for VSCode. Yes, we are refining its behavior and it will be appearing in an upcoming extension release!

    Enjoy!

    Stephen

  • NEWS

    I've just released v1.3.0 of our spin2 extension. The changes are:

    Initial Release of debug()-display Highlight and Validation

    • Adds initial highlighting support for all debug() displays (Logic, Scope, Scope_XY, FFT, Spectro, Plot, Term, Bitmap, and Midi)
    • Unique colors within debug statement for displayType, displayName, keywords, and colors
    • Validation: When a keyword is not legal for the display or is spelled incorrectly then is colored bright red
    • Moved single comment out of syntax into semantic highlighting so we can have single-quoted strings in our debug statements. (Syntax highlighting is not context-aware, so the entire tail of a debug() statement was incorrectly rendered as a comment)

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing this new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? We continue to work on Propeller Tool like custom tabbing for VSCode. Yes, we are refining its behavior and it will be appearing in an upcoming extension release!

    Enjoy!

    Stephen

  • NEWS

    I've just released v1.3.1 of our spin2 extension. The changes are:

    **Finish debug()-display Highlight and Validation

    • Adds new directive support for validating debug() display lines that use runtime display names
    • Fix highlighting of debug() statements within in-line pasm
    • Fix label on ORG directive
    • Fix highlighting of ORGH directive

    NOTEs

    • this adds support for the new Spin2 Extension directive:

      • {-* VSCode-Spin2: nextline debug()-display: {displayType} *-}
      • Where: {displayType} should be one of [Logic, Scope, Scope_XY, FFT, Spectro, Plot, Term, Bitmap, and Midi]
    • The following runtime forms can now be handled by preceeding them with this new directive:

    • debug(`zstr_(displayName) lutcolors `uhex_long_array_(image_address, lut_size))
    • debug(`lstr_(displayName, len) lutcolors `uhex_long_array_(image_address, lut_size))
    • debug(`#(letter) lutcolors `uhex_long_array_(image_address, lut_size))

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing this new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? We continue to work on Propeller Tool like custom tabbing for VSCode. Yes, we are refining its behavior and it will be appearing in an upcoming extension release!

    Enjoy!

    Stephen

  • This is amazing. I loved that I just pointed it to my Azure Dev Ops repo and it cloned my project.

    Haven't got it fully working, as I haven't read all of the docs or updated my environment variables yet, but this looks so promising.

  • NEWS

    I've just released v1.3.7 of our spin2 extension. The changes are:

    Miscellaneous semantic highlight fixes

    -Fix highlighting of multiple same-name constants in con declaration
    -Fix highlighting of built-in variable and method names in debug() statements
    -Fix highlighting of constant names in case statements with a constant range as match case
    -Fix highlighting of org constant name as the offset
    -Fix highlighting of constant names in complex constant assignment

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? This is taking a bit longer than we planned but we continue to work on Propeller Tool like custom tabbing for VSCode. Yes, we are refining its behavior and it will be appearing in an upcoming extension release!

    Enjoy!

    Stephen

  • bozobozo Posts: 70
    edited 2022-05-24 06:46

    [deleted]

  • ManAtWorkManAtWork Posts: 1,527
    edited 2022-05-27 16:27

    @VBBSim said:
    Yes, it worked just as you suggested with one slightly hacky work-around. I put a copy of the P2ES_flashloader.bin into a board/ directory in the project (suite) because I am not sure how to specify the found working path directory of the loadp2.

    I then had the idea to add an extra build task and aligned the function keys with prop tool
    F8 = Compile
    F10 = Program RAM
    F11 = Program Flash
    ...

    Compiling (F8) and F10 works but I always get an "unrecognized token" error when I try to flash.

    Executing task: loadp2.exe -b230400 @0=P2ES_flashloader.bin,@8000+SC3_main.binary -t -k <
    
    Unbekanntes Token im Quelltext.
    Bei Zeile:1 Zeichen:21
    + loadp2.exe -b230400  <<<< @0=P2ES_flashloader.bin,@8000+SC3_main.binary -t -k
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnrecognizedToken
    

    I've tried placing the flashloader directly in the project folder or in a "board" subfolder. Or I even tried the absolute path in the json-file:

                "label": "flashP2",
                "type": "shell",
                "args": [
                    "-b230400",
                    "@0=d:/flexprop/board/P2ES_flashloader.bin,@8000+${config:topLevel}.binary",
                    "-t",
                    "-k"
    

    None of this works.

  • NEWS

    I've just released v1.3.8 and then v1.3.9 of our spin2 extension. The changes are:

    Miscellaneous semantic highlight fixes

    -BUGFIX (#7) - Fix highlighting in pasm statements when using operators with constants. (added missing detection of =,?,:,!, and ^ pasm operators as defined in pasm language manual)
    -BUGFIX: (#6) correct internal misspelling of X_4P_4DAC1_WFBYTE symbol.

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? This is taking a bit longer than we planned but we continue to work on Propeller Tool like custom tabbing for VSCode. Yes, we are refining its behavior and it will be appearing in an upcoming extension release!

    Enjoy!

    Stephen

  • Stephen MoracoStephen Moraco Posts: 218
    edited 2022-09-18 00:53

    NEWS

    I've just released v1.4.1 of our spin2 extension. The changes are:

    Various Highlight fixes and better single-line comment processing

    • BUGFIX: (#8) Now correctly recognize assignments within enum declarations
    • BUGFIX: (#5) Most of the single-line comments are once again recognized during syntax recognition the remaining exception is when comments following debug() statements
    • Now recognizes the use of spin2 unary and binary operators within constant assignments
    • Fixed a number of small highlight problems: (1) (local variables were not recognized in spin statements), (2) occasionally some comments were processed as spin statements

    Thank you Ada for taking the time to help with the change to our single-line comment parsing!

    You can always review the Spin2 Extension ChangeLog from within VSCode or at github for more details.

    Reminder: The Spin2 extension is in the VSCode marketplace. After one has a working install of VSCode then from within the VSCode Extensions panel search for Spin2, install it and you are good to go. Once installed it will automatically notify you of new update availability whenever I publish new updates.

    If you are already using this extension and for some reason, it did not update for you automatically, in VSCode go to your extensions view (SHIFT+CMD+X), and type in spin2. On the left, the info panel for the extension should appear and will indicate that an update has happened or needs to happen. Update it if needed.

    NOTE You may want to double-check that all older versions are removed from your .vscode/extensions folder after installing any new version.

    If you find code that you believe is not highlighting correctly (yes, we will likely find some for a while yet...) then please file an issue at my github repository issues page

    I also point out a number of extensions that make this an even better Spin2/Pasm2 development environment. See: my VSCode repo extensions page

    There is more than just installing the extension as one needs to set up build and run facilities based on the compiler tools one is using and also based on the platform (Windows, Mac, RPi, Linux, etc.) To help us learn how to do this Ken posted a very useful VSCode P2 QuickByte.

    What's next? Two things are on the horizon: (1) tabbing à la PropellerTool and (2) A backport of this Syntax/Semantic highlighting to a new Spin VSCode extension for our P1

    Enjoy!

    Stephen

Sign In or Register to comment.