Shop OBEX P1 Docs P2 Docs Learn Events
Problem getting started with the P2 kit. — Parallax Forums

Problem getting started with the P2 kit.

PrebenPreben Posts: 15
edited 2024-11-27 02:12 in Propeller 2

I assembled the kit. (Recommendation: A simple drawing of how the parts go together in the box would have saved me a bit of time)
I also have the Propeller Tool up and running, and I tested a number of the examples provided.
That was the good news :-)

I did, however, run into a problem installing the Spin2 extension in the VSC. The extension itself installed fine, but when I tried to follow the instructions about "setting the environment in Migrate from v2.2.x to v2.3.0," I encountered a problem:

  1. Enable the Propeller 2 Advanced toolchain features: by clicking Spin Extension->Toolchain->Advanced:Enable.

I can't seem to find this path at all!

I did go through items 2 to 5 and think that they are updated correctly.

Despite item "1" not being performed, I tried to "Run" with and without a debugger, and was instantly told that "You don't have an extension for debugging Spin2. I don't know if this is caused by Item 1.

I also tried to look for the tasks:
Under Task: Run Test Task:
DownloadP2 - Download the binary to RAM in our connected P2 (to RAM/FLASH)
But got the:
Variable ${config:spin2.fSpecLoader} can not be resolved because setting 'spin2.fSpecLoader' not found.

Please help

Thanks

Preben

Comments

  • @"Stephen Moraco" could you help ?

  • Stephen MoracoStephen Moraco Posts: 320
    edited 2024-11-28 01:41

    @Preben said:
    I did, however, run into a problem installing the Spin2 extension in the VSC. The extension itself installed fine, but when I tried to follow the instructions about "setting the environment in Migrate from v2.2.x to v2.3.0," I encountered a problem:

    1. Enable the Propeller 2 Advanced toolchain features: by clicking Spin Extension->Toolchain->Advanced:Enable.

    Please help

    @Preben, this is my fault. I'm partway through releasing a new version that makes compiling easier. However, we must use the older instructions until it is released.

    The easiest way to get your own copy of the docs is to download the latest formal release from this page. Downoad the .zip file and unpack it. The following files are the instructions you should be able to use:

    • EXTENSIONS.md
    • InsertMode.md
    • PT-Color-setup.md
    • README.md
    • Spin2-Settings.md
    • TAB-VisualEx.md
    • TASKS-User-RPi.md
    • TASKS-User-macOS.md
    • TASKS-User-win.md

    These are found at the top of the new folder created when the .zip file was unpacked.

  • I will have a look at it.

    Thanks

    Preben

  • JonnyMacJonnyMac Posts: 9,148

    If you're not wed to VSC (I know some folks really like it), there is another option with great features that's easy to setup and works on any the major OSes: Spin Tools IDE. You can find it at
    -- https://www.maccasoft.com/spin-tools-ide/

  • pik33pik33 Posts: 2,382
    edited 2024-11-29 08:09

    There is also Flexprop, a Spin, C and Basic compiler for P1 and P2 - and you can even mix all 3 languages in one project. https://github.com/totalspectrum/flexprop

  • RossHRossH Posts: 5,471
    edited 2024-11-30 01:50

    And, when all else fails, there is always Catalina! :)

  • "If you're not wed to VSC" :-) I'm a free as a bird and open to whatever aid I can get.
    Some 10+ years ago I dabbled with the P1 and had an LCD display up and running using the "Spin Tool",
    and that is also what I play around with now while (re) learning via the examples.

    What I would like to have is a powerful debugger, something I have had in my prior life as an Aerospace SW and Systems engineer. (retired, and this playing around with the P2 is only to keep my mind working.)

    But I should be very happy if you could tell me what Debugger functions I have, apart from inline debug statements. A step through code, or breakpoints, and with insights into memory, registers etc would be a nice start.

    I will look into the other programming options you gents have pointed me to one at a time.

    BTW please excuse me if I'm not on top of your responses as I am also under my car, Citroen Cx, fixing it as nobody else knows it, and Stone sculpting, so I tend to forget to check reguarly.

    Thanks all!

    Preben

  • JonnyMacJonnyMac Posts: 9,148
    edited 2024-12-01 02:59

    Propeller Tool is/was the official IDE from Parallax -- though they retired and stopped updating it more than a year ago.

    Spin Tools IDE is an independent, x-platform product from @macca that looks a lot like Propeller Tool, or where Propeller Tool should have gone should Parallax wanted to support a nice IDE (their resources are slim, so they couldn't).

    If you're running Windows, as I do, you can link PNut, the compiler Chip maintains to test new features in the P2 (using Spin2 and PASM). This gives you access to all of the debugging features available in PNut -- which is the only place, to my knowledge, where all of the debugging features are available. Chip doesn't concern himself with IDE niceties, so PNut is not a pleasant user experience. But it can be used as a command line tool for other environments (e.g., VSC or Spin Tools).

    In the latest version of Spin Tools IDE Marco has added some of the debugging features found in PNut. So... if you're okay programming the P2 in Spin2 and PASM, I think that Spin Tools IDE is the best offering, and those of us running Windows have access to all the latest features of Chip's PNut compiler.

    There is a very long thread on Spin Tools IDE here:
    -- https://forums.parallax.com/discussion/174436/spin-tools-ide#latest

    I think the discussion on using external tools starts on page 14 (this came up the other day). What you'll find about Spin Tools IDE is that it's a nice environment and, most importantly, it's creator is open to improvements that make the programmer's workflow and life easier.

    You can find details about PNut debugging features in this document:
    -- https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit?tab=t.0#heading=h.ipofegnjk1p9

  • Jon,

    I'm running WIN 10, and I was using the Propeller Tool.

    I had a little problem figuring out which Java version to use.

    I have now installed the Spin IDE too and am running the sample programs I had running in Prop Tool.

    I will now have a look into the debug features.

    Thanks for the tips!

  • JonnyMacJonnyMac Posts: 9,148

    For my setup I put a copy of PNut into my Propeller Tool library folder as that's where I prefer to keep all of my global libraries (there are a few editing niceties I like in Propeller Tool). Putting a copy of PNut.exe into that library folder will allow things to work if you setup PNut as an external tool.

    1920 x 1080 - 251K
  • maccamacca Posts: 805

    @Preben said:
    I'm running WIN 10, and I was using the Propeller Tool.

    I had a little problem figuring out which Java version to use.

    There are two packages for each OS, one that requires the java runtime already installed (version 17 or later) and one that already includes the java runtime, if in doubt, download the package with the included runtime.

    I have now installed the Spin IDE too and am running the sample programs I had running in Prop Tool.

    I will now have a look into the debug features.

    @JonnyMac said:
    In the latest version of Spin Tools IDE Marco has added some of the debugging features found in PNut. So... if you're okay programming the P2 in Spin2 and PASM, I think that Spin Tools IDE is the best offering, and those of us running Windows have access to all the latest features of Chip's PNut compiler.

    The latest version implements the PAsm debugger as seen on the first page of the PNut thread, not fully complete yet but the debugging functions should work. Also I'm working to implement the latest PNut additions (structures and pointers), will publish a new release soon.

  • @JonnyMac said:
    For my setup I put a copy of PNut into my Propeller Tool library folder as that's where I prefer to keep all of my global libraries (there are a few editing niceties I like in Propeller Tool). Putting a copy of PNut.exe into that library folder will allow things to work if you setup PNut as an external tool.

    I did what you suggested, but how does the PNut get invoked?

  • JonnyMacJonnyMac Posts: 9,148
    edited 2024-12-08 03:53

    Edit your code in Spin Tools and then invoke PNut with the [Alt] plus # key based on your External Tools assignment(s). Get the new version 0.41.0 because it has additional features for external programs.

    I have three external tools so they would be invoked with [Alt]+[1], [Alt]+[2], and [Alt]+[3].

  • Maybe I don't download it from the correct place?

    I found a v47 (PNut_v47), which I downloaded and added to the external tools area, as shown in your image.

    When I invoke it, it invokes PNut with a blank page. I would have thought that it would bring up the currently active program in Spin Tolls IDE.

  • evanhevanh Posts: 16,016

    Pnut doesn't give much away on how to use it in a shell. Oddly, it is documented right at the end of the Spin2 manual, under the heading of "Command Line options for PNut.exe"

    I prefer using just -c or -cd compile options, and then separately use another loader program to download it, so then I'm not confronted with that awful graphic rendered debug window that Chip devised.

  • JonnyMacJonnyMac Posts: 9,148
    edited 2024-12-09 18:00

    You need to manually setup each tool -- Spin Tools IDE doesn't know anything about PNut or any other tool you might want to invoke (e.g., PNut or FlexProp).

    These's are MY settings for the tools I use. As Evan pointed out, the CLI docs for PNut are in the end of the Spin2 documentation.

    The last one, for Parallax Serial Terminal, uses a CLI suggestion from Marco. There is a very long thread vis-à-vis Spin Tools IDE and features. I suggest you go back and review the last several pages.

  • Will do, thanks!

  • I got all set up like you have specified above, and I'm using the simplest of programs possible: Hello World."

    Using F10 and Ctrl + F10, all is well.

    Using Alt 1 or 2, brings up PNut with a blank page.
    The console shows the (Correct) path for both the PNut and the Hello programs.

    Isn't it supposed to show the Hello program?

    I have triple-checked the path in the external tools, and it's correct.
    Am I missing a setting or such?

  • JonnyMacJonnyMac Posts: 9,148
    edited 2024-12-11 23:26

    Are you adding the

    ${file} -r

    argument in your tool definition dialog?

  • Yes, both the ${file} -r and the ${file} -rd as per your instructions.

    C:\Users\Pridbor\Documents\Propeller Tool\Library\PNut_v47.exe Hello Blinky.spin2 -r

    C:\Users\Pridbor\Documents\Propeller Tool\Library\PNut_v47.exe Hello Blinky.spin2 -rd

    Should I try to reinstall the Spin Tool ?

  • maccamacca Posts: 805
    edited 2024-12-12 06:34

    @Preben said:
    I got all set up like you have specified above, and I'm using the simplest of programs possible: Hello World."

    Using F10 and Ctrl + F10, all is well.

    Using Alt 1 or 2, brings up PNut with a blank page.
    The console shows the (Correct) path for both the PNut and the Hello programs.

    Just a question, why you want to use PNut ?
    While the suggestions you received are valid, that kind of setup is a bit complicated and can easily lead to confusion, in particular for novice users. Spin Tools IDE is a complete editor, compiler, uploader and terminal, if you can compile and upload programs with it you don't need any external program. It improves every day, what doesn't work today is likely to work tomorrow or shortly after.

    Yes, both the ${file} -r and the ${file} -rd as per your instructions.

    C:\Users\Pridbor\Documents\Propeller Tool\Library\PNut_v47.exe Hello Blinky.spin2 -r

    C:\Users\Pridbor\Documents\Propeller Tool\Library\PNut_v47.exe Hello Blinky.spin2 -rd

    Should I try to reinstall the Spin Tool ?

    In that specific case, the file name contains spaces so, I guess, PNut attempts to load a non existent file. You need to enclose the file keyword between quotes "${file}".
    But again, there is no need for PNut in your case.

  • JonnyMacJonnyMac Posts: 9,148

    In that specific case, the file name contains spaces so, I guess, PNut attempts to load a non existent file. You need to enclose the file keyword between quotes "${file}".

    Sorry, Marco, I didn't think of that. I do everything I can to avoid spaces in folder and file names.

    In another thread he was trying to run a bit of code that I provided to him -- it compiles fine with PNut, but not with the internal compiler (though I did show him a work-around).
    -- https://forums.parallax.com/discussion/176053/example-program-for-multi-cog-usage

    I thought I had tagged you in that thread so the (PASM2) compilation issue could be addressed.

  • Let me first say I like the IDE you (Hello Marco) have created, dark mode, so please don't feel that I'm criticizing it. I'm trying to get a setup that I will be using to play around with the P2, and yes, I'm a newbie :-)

    As I stated in a previous post, I'm looking for something you didn't include in your list of IDE capabilities, "compiler, uploader and terminal," namely a Debugger that gives me control of the execution of the code, like breakpoints, single steps, etc. maybe it's there but I haven't yet found?

    I thought that I had read that the PNut program has some complementary debugger features your tool doesn't posess, and please don't ask me to elaborate as I don't know where and what I read and got that piece of information from. Maybe it was in one of the very many posts I have perused.
    I find that information for a newcomer to the "P" is scattered a bit, making it hard for me to recall.

    Either way, I thought that someone, and now I find out is you, Marco, might want to know if there's an issue with this external "call."

    I'm also not quite sure if I addressed this topic in the correct place, so please advise me where to post if not here.

    Jon was kind enough to provide me with a program, which I have butchered a bit by removing the terminal stuff, to make it simpler to follow for me, and it has no blank characters in the file name and works fine with his correction.

    You need to enclose the file keyword between quotes "${file}". I did as Jon also specified that.

    So maybe this is the right place to ask you where I can find documentation for the Debugging capabilities of the Spin Tool IDE?

    I looking forward to learn how to use the IDE properly

    Thanks

    Preben

  • maccamacca Posts: 805

    @JonnyMac said:

    In that specific case, the file name contains spaces so, I guess, PNut attempts to load a non existent file. You need to enclose the file keyword between quotes "${file}".

    Sorry, Marco, I didn't think of that. I do everything I can to avoid spaces in folder and file names.

    In another thread he was trying to run a bit of code that I provided to him -- it compiles fine with PNut, but not with the internal compiler (though I did show him a work-around).
    -- https://forums.parallax.com/discussion/176053/example-program-for-multi-cog-usage

    I thought I had tagged you in that thread so the (PASM2) compilation issue could be addressed.

    No problem, I haven't linked the two... the issue in that thread (long literal) is fixed for the next release, in the meantime your workaround to use a temporary variable to store the value is still valid.

  • maccamacca Posts: 805
    edited 2024-12-12 19:22

    @Preben said:
    Let me first say I like the IDE you (Hello Marco) have created, dark mode, so please don't feel that I'm criticizing it. I'm trying to get a setup that I will be using to play around with the P2, and yes, I'm a newbie :-)

    As I stated in a previous post, I'm looking for something you didn't include in your list of IDE capabilities, "compiler, uploader and terminal," namely a Debugger that gives me control of the execution of the code, like breakpoints, single steps, etc. maybe it's there but I haven't yet found?

    Yes, missed that, the IDE implements the same PAsm debugger as PNut, and AFAIK, it is everything we have. Breakpoints are a bit limited (only one per Cog if I'm not wrong), and the debugger itself is useful only for PAsm programs, unless I'm missing something (I never used it extensively) there is no way to set a breakpoint to a Spin statement.

    I thought that I had read that the PNut program has some complementary debugger features your tool doesn't posess, and please don't ask me to elaborate as I don't know where and what I read and got that piece of information from. Maybe it was in one of the very many posts I have perused.
    I find that information for a newcomer to the "P" is scattered a bit, making it hard for me to recall.

    Yes I know what you mean, the IDE itself is not documented aside from its own long thread.
    The PNut documentation linked on the first page of the PNut thread https://forums.parallax.com/discussion/171196/pnut-spin2-latest-version-v47-cooperative-multitasking-added-to-spin2-up-to-32-tasks/p1 documents the debugger feature that are also valid for Spin Tools IDE (if not let me know, I'll implement as soon as possible). Some debug window (like Midi or FFT) are not yet implemented.

    Either way, I thought that someone, and now I find out is you, Marco, might want to know if there's an issue with this external "call."
    I'm also not quite sure if I addressed this topic in the correct place, so please advise me where to post if not here.

    There is the Spin Tools IDE thread https://forums.parallax.com/discussion/174436/spin-tools-ide or just tag my nickname so I get a notification (I don't always read all threads).

Sign In or Register to comment.