Shop OBEX P1 Docs P2 Docs Learn Events
Spin Tools IDE - Page 3 — Parallax Forums

Spin Tools IDE

1356714

Comments

  • @macca said:

    This is how it currently works already, I think I didn't mentioned it when writing about the library path, when looking for a referenced object it first searches the compiled source folder, then the library folders, so if you have exerything in a single directory you should not have any problem.

    OK, Great, I did not know exactly how this part works.

    a small bug, but not a show stopper, i have noticed all the usb devices seems to be "duplicated" , what is the difference between "tty" and "cu"?

    I have absolutely no idea, the list is from the jSSC (Java Simple Serial Connector) library and, for MacOS, it searches for tty and cu under the /dev folder.
    Maybe this helps https://stackoverflow.com/questions/8632586/whats-the-difference-between-dev-tty-and-dev-cu-on-macos

    I shall take a look

    SPINTOOLS shows a syntax error when using @@ symbols.

    This should work, need to investigate a bit.

    OK, Thanks

  • @DavidM said:
    One last issue ( but an important one)

    My current project compiles and loads to the propeller in both SPIN TOOLS and FLEXPROP, but the SPINTOOL version does not run at all, i.e the proller does nothing. the code is exactly the same.

    I have attached my code files for reference.

    BTW, this code:

    VAR
        LONG PtrDMXBuffer
    
    PUB Main | vColourNo
        ...
        DMXTX.start (DMXTXPinDI, DMXTXEnableDE, PtrDMXBuffer)   'Starts a DMX TX using a COG
    

    Doesn't look right to me, PtrDMXBuffer is never initialized, maybe you want to use @PtrDMXBuffer but still it is defined as a long and the driver expects 513 bytes.
    Maybe it works because of a side effect with flexprop ?

  • @macca said:

    @DavidM said:
    One last issue ( but an important one)

    My current project compiles and loads to the propeller in both SPIN TOOLS and FLEXPROP, but the SPINTOOL version does not run at all, i.e the proller does nothing. the code is exactly the same.

    I have attached my code files for reference.

    BTW, this code:

    VAR
        LONG PtrDMXBuffer
    
    PUB Main | vColourNo
        ...
        DMXTX.start (DMXTXPinDI, DMXTXEnableDE, PtrDMXBuffer)   'Starts a DMX TX using a COG
    

    Doesn't look right to me, PtrDMXBuffer is never initialized, maybe you want to use @PtrDMXBuffer but still it is defined as a long and the driver expects 513 bytes.
    Maybe it works because of a side effect with flexprop ?

    Hmm, well spotted, I shall test tomorrow, its late here, thanks for "Pointing" this out.

  • @macca said:
    This looks like a relative-path issue. The default include folders are referenced with the relative path library/spin1 (or library/spin2), looks like the current application path is not what I tought.

    What do you see if you open the File -> Open From... menu ? The top 4 lines should be the examples/P1(P2) and library/spin1(spin2) with full path, and give an indication about what is the default application path.

    I tried Open From with the path: /Applications/Spin Tools IDE.app/Contents/Java/examples/P2

    I get the same result.

  • @dgately said:
    I tried Open From with the path: /Applications/Spin Tools IDE.app/Contents/Java/examples/P2

    I mean, what are the paths shown on the menu, but if the above is what is shown, then the relative paths seems correct and the application's startup folder is /Applications/Spin Tools IDE.app/Contents/Java
    From the File -> Open From... menu you can open all kind of files, examples and library, right ?

    Wondering why doesn't work when searching for the object files.

  • @macca said:
    I mean, what are the paths shown on the menu, but if the above is what is shown, then the relative paths seems correct and the application's startup folder is /Applications/Spin Tools IDE.app/Contents/Java

    Since I had entered changes in Preferences (File Browser Root Path) after the above tests, I wanted a fresh start. I used CleanMyMac X to remove Spin Tools IDE app and all of its prefs/caches, etc... I also removed .spin-tools from my home directory and re-installed Spin Tools IDE.

    These are the choices I am now given for the "Open From" menu, even after having deleted any examples or library directories that I had copied from the app's package (where are these stored?):

    Once I have navigated to an example .spin2 file, then Open From provides "/Applications/Spin Tools IDE.app/Contents/Java/example/P2"...

    Here's what Clean My Mac uninstalled... (I had to manually removed .spin-tools) before I downloaded and re-installed the app):

    From the File -> Open From... menu you can open all kind of files, examples and library, right ?

    Right now it just brings up my Documents directory for Open From (since the example & directories were removed from Documents). From there I can re-navigate to the app's package and get to the example files from: Contents/Java/examples/P2. There I can open any .spin2 file or open library files from: Contents/Java/examples/spin2

    I originally thought that the spaces in the app's name caused an issue, but at one point I changed the name to SpinTools.app and it made no difference. I guess my question is about where the Open From paths are getting stored even through an uninstallation & reinstallation?

  • @macca said:

    VAR
    LONG PtrDMXBuffer

    PUB Main | vColourNo
    ...
    DMXTX.start (DMXTXPinDI, DMXTXEnableDE, PtrDMXBuffer) 'Starts a DMX TX using a COG
    ```
    Doesn't look right to me, PtrDMXBuffer is never initialized, maybe you want to use @PtrDMXBuffer but still it is defined as a long and the driver expects 513 bytes.
    Maybe it works because of a side effect with flexprop ?

    Hi Macca.

    You were correct, I did not set my Buffer Pointer up correctly should be..
    VAR
    BYTE PtrDMXBuffer[513]

    It's a wonder it worked in FLEXPROP at all.

    I also got rid of the @@ symbol, and did it a different way, ( whilst you looking into the @@ syntax error sometime later).

    But what this means is that SPIN TOOLS now WORKS fully on the MAC! I don't need to use FLEXPROP anymore.

    So thanks for this!

  • @dgately said:
    These are the choices I am now given for the "Open From" menu, even after having deleted any examples or library directories that I had copied from the app's package (where are these stored?):

    Once I have navigated to an example .spin2 file, then Open From provides "/Applications/Spin Tools IDE.app/Contents/Java/example/P2"...

    Ok, that clarify things: the application is run from the /Users/altergator directory, that's why it can't find the library paths that, internally, are references as relative. Will fix that.

    I originally thought that the spaces in the app's name caused an issue, but at one point I changed the name to SpinTools.app and it made no difference. I guess my question is about where the Open From paths are getting stored even through an uninstallation & reinstallation?

    The first 4 items in the Open From menu are fixed and set to the default examples and library paths (should be "Spin Tools IDE.app/Contens/Java/examples/P1", etc.), these can't be changed.
    Other items are added when you open spin files around and set to the respective folders, it is a sort of last recently used directories list, and is derived from the last recently used files stored in the .spin-tools file.

  • @DavidM said:
    You were correct, I did not set my Buffer Pointer up correctly should be..
    VAR
    BYTE PtrDMXBuffer[513]

    It's a wonder it worked in FLEXPROP at all.

    I guess because flexprop uses it's own interpreter runtime and the first ~1k or so hub bytes are used by that interpreter, since the default value for PtrDMXBuffer should be 0 it overwrites the interpreter and doesn't have any effect on your code. Maybe if you start another cog later it won't work.

    I also got rid of the @@ symbol, and did it a different way, ( whilst you looking into the @@ syntax error sometime later).

    Working on that, I didn't noticed that it is spin1, it works for spin2 but not for spin1 with that kind of expressions.

    But what this means is that SPIN TOOLS now WORKS fully on the MAC! I don't need to use FLEXPROP anymore.

    Very good.

  • Hello @macca , the compiler is giving me this error. It works in both propeller tool and flexprop.

  • Hi macca, firstly I'd like to say THANKS to you for developing your great app for using our Propellers under macOS!!!!
    I regret disturbing you for a thing I doo not understand; Java 19 is installed as shown

    AirM1dicdossi:Downloads cdossi$ java -version
    java version "19.0.2" 2023-01-17
    Java(TM) SE Runtime Environment (build 19.0.2+7-44)
    Java HotSpot(TM) 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing)

    but SpinTools is still warning "The application requires Java 11 or later..."; will you be so kind to suggest me some hints?

    Thanks again

    Carlo

  • @jrullan said:
    Hello @macca , the compiler is giving me this error. It works in both propeller tool and flexprop.

    That syntax is not yet implemented, will work on it.

  • @dossic said:
    Hi macca, firstly I'd like to say THANKS to you for developing your great app for using our Propellers under macOS!!!!
    I regret disturbing you for a thing I doo not understand; Java 19 is installed as shown

    AirM1dicdossi:Downloads cdossi$ java -version
    java version "19.0.2" 2023-01-17
    Java(TM) SE Runtime Environment (build 19.0.2+7-44)
    Java HotSpot(TM) 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing)

    but SpinTools is still warning "The application requires Java 11 or later..."; will you be so kind to suggest me some hints?

    If it is a warning (the application still runs, just an annoying message) you can ignore it, otherwise, all I can say is to install version 11 for now, unless you need version 19 for other programs.

    Unfortunately the jre check is implemented in a third-party tool and since I don't have any experience with Mac I don't know if it doesn't work as expected or there is something else to do.

    For reference, the tool is this:
    https://github.com/evolvedbinary/appbundler

  • @macca said:

    @jrullan said:
    Hello @macca , the compiler is giving me this error. It works in both propeller tool and flexprop.

    That syntax is not yet implemented, will work on it.

    Thanks! Btw, awesome features! Excited to see how it evolves! Keep it up!

  • Hi Macca, thanks! It appears to be a warning, but it prevents your app to be run
    Here is a screenshot.
    Looking forward to hearing from you, I'll send a big thanks
    carlo

  • @dossic said:
    Hi Macca, thanks! It appears to be a warning, but it prevents your app to be run

    Maybe this page can help...
    https://docs.oracle.com/en/java/javase/19/install/installation-jdk-macos.html#GUID-F575EB4A-70D3-4AB4-A20E-DBE95171AB5F

  • Thanks @dgately! Now I have Java11 but the same error is occurring. I?ll think about again. Maybe the M1 processor? I'll try with my old MacBook.
    carlo

  • Published version 0.20.0 that fixes the reported issues:

    • Spin1 absolute addressing
    • Spin2 method pointers
    • Added library paths preferences
    • Added a check to to prevent the overwrite of the distributed examples and folders: attempting to save one of these files opens the Save As dialog to save to another location
    • Changed the file browser selected folders display
    • Terminal speed saved to preferences

    On MacOS the default entries of the Open From menu should point to the correct folder (if the launcher sets the variables correctly).

    @JonnyMac said:
    With Propeller Tool and FlexProp I flush the serial buffer used for the terminal and then wait for a keypress. This allows PST users to open and enable PST. That doesn't seem to work with SpinTools, so I replaced those lines with a small delay. It would be nice if I could use one code set with any of the tools.

    Did some tests and it looks working for me. The only issue I found is that if the terminal is closed, when it is opened the propeller is reset (at least on Linux, a common know problem) so if the program is not stored in flash it doesn't run. To prevent this, use the upload with terminal options (SHIFT+F10 for example), this opens the terminal, upload the program and then it is ready. Tried with jm_i2c_devices.spin2 and work.

  • JonnyMacJonnyMac Posts: 8,894
    edited 2023-02-07 15:49

    The intent behind my process is to let me check new code in RAM without changing the contents of the EEPROM. I'll give 0.20 a try. Thanks for your efforts on this.

  • There seems to be a problem with the user paths for the browser. This screen shot is from after setting the paths, restarting SpinTool, and even toggling the the "Show file browswer" checkbox.

    This feature works in version 0.19.3 (I kept it in a separate folder).

  • JonnyMacJonnyMac Posts: 8,894
    edited 2023-02-07 16:34

    I am having trouble uploading to Flash (F11 with P2). There is activity on the Eval LEDs when I use F11, but the program (blinks P56 and P57) doesn't run after, nor after a manual reset. If I use F10, the program does run.

  • @JonnyMac said:
    There seems to be a problem with the user paths for the browser. This screen shot is from after setting the paths, restarting SpinTool, and even toggling the the "Show file browswer" checkbox.

    Yes, the "enhancements" I made to the browser are working only for subdirectories of the user's home, directories outside the home are ignored.

    I am having trouble uploading to Flash (F11 with P2). There is activity on the Eval LEDs when I use F11, but the program (blinks P56 and P57) doesn't run after, nor after a manual reset. If I use F10, the program does run.

    No problems here with both Linux and Windows 11.
    Was it working with the previous release ?

  • evanhevanh Posts: 15,049

    Make sure DIP switch 2 "FLASH" is ON and switch 3 and 4 are OFF.

  • Posted 0.20.1 that hopefully fixes the file browser directory filter (including those outside the home).

  • I tested this a while ago but seems a lot of work has been done. It has huge potential and I just noticed relative paths appear to work, which is HUGE for me (can properly separate libraries and application code!).

    I tried my demos/test code again, which rely on method pointers, and it looks like the return value suffix at the end of a call isn't handled. Basic example (not tested, just compiled in Prop Tools vs. Spin Tools). Shows the error "undefined symbol :". Also @ doesn't count as a reference to a method so Square has a warning even though it is "used".

    CON
      _xtlfreq                      = 20_000_000
      _clkfreq                      = 200_000_000 
    
    VAR
        LONG testMethod
    
    PUB Main() | x
        testMethod := @Square
        x := testMethod(5):1 '<--- error here
        debug(udec(x))
    
    PUB Square(a) : r '<---- warning here
        r := a * a
    
  • @DarkInsanePyro said:
    I tried my demos/test code again, which rely on method pointers, and it looks like the return value suffix at the end of a call isn't handled. Basic example (not tested, just compiled in Prop Tools vs. Spin Tools). Shows the error "undefined symbol :".

    Aside from the unused method (that you can work around by calling it directly once) the pointer call should already work without the suffix.

    I'm wondering why it is needed since it is impossible to know the actual number of values returned, you can put whatever value there and mess the stack regardless of the called method. A quick check shows that it doesn't change the generated code at all, so I think I'll parse that and ignore, I don't see the need to check a user entered parameter.

    Also @ doesn't count as a reference to a method so Square has a warning even though it is "used".

    Right, missed that.

  • DarkInsanePyroDarkInsanePyro Posts: 31
    edited 2023-02-08 16:55

    @macca said:

    @DarkInsanePyro said:
    I tried my demos/test code again, which rely on method pointers, and it looks like the return value suffix at the end of a call isn't handled. Basic example (not tested, just compiled in Prop Tools vs. Spin Tools). Shows the error "undefined symbol :".

    Aside from the unused method (that you can work around by calling it directly once) the pointer call should already work without the suffix.

    I'm wondering why it is needed since it is impossible to know the actual number of values returned, you can put whatever value there and mess the stack regardless of the called method. A quick check shows that it doesn't change the generated code at all, so I think I'll parse that and ignore, I don't see the need to check a user entered parameter.

    Also @ doesn't count as a reference to a method so Square has a warning even though it is "used".

    Right, missed that.

    What if you don't need to consume the return value? It is optional to specify variables to grab the returned values. I wonder if it there to handle that or even validate the # of return values being pop'd from the stack (2nd check essentially). However there are cases where I don't consume the return value, so I think handling this is necessary if that is the case.

    I am at work currently so I can't validate it though.

  • Few other quirks based on seeing if I can get my code to work. The following example snippet works in Propeller Tool but not Spin Tools. There are two errors:

    Line 10, "unexpected #"
    Line 17, "symbol PR0 not found"

    PUB Main()
      regload(@stub)
      repeat
        AsmBlink()
        waitms(500)
    
    PRI AsmBlink()
      PR0 := 56
      call(#stub_toggle_led) '<-- Line 10, "unexpected #"
    
    DAT
    stub                            word stub_toggle_led, stub_end - stub_begin - 1
                                    org
    stub_begin
    stub_toggle_led         _ret_   drvnot PR0 '<-- Line 17, "symbol PR0 not found"
    stub_end
    

    I use this syntax/mechanism when interfacing with my "inline serial" (same cog as Spin2): piLibrary/piInlineSerial.spin2.

  • JonnyMacJonnyMac Posts: 8,894
    edited 2023-02-10 20:06

    I also found that SpinTools does not understand the P2's new floating point operators.

  • @DarkInsanePyro said:
    Line 10, "unexpected #"
    Line 17, "symbol PR0 not found"

    Will implement them (PRx are available for inline pasm only, not for generic pasm).

    @JonnyMac said:
    I also found that SpinTools does not understand the P2's new floating point operators.

    I tought I have implemented them... what operators are missing ?

Sign In or Register to comment.