Shop OBEX P1 Docs P2 Docs Learn Events
Catalina - Page 2 — Parallax Forums

Catalina

245

Comments

  • RaymanRayman Posts: 13,797

    Tried a third PC, a relatively good one, and got the same result, even by command line.

    This PC still has that other issue where the Catalina command line does not appear in the start menu. There is an icon for it on the desktop though...

  • RaymanRayman Posts: 13,797
    edited 2021-10-13 16:17

    @RossH I've installed Geany from here: https://www.geany.org/download/releases/

    Now, this and the Catalina version seem to work.

    Just need to read the help on how to target P2.

  • RaymanRayman Posts: 13,797

    Ok, at least it doesn't always crash on file open now, but it does still crash when opening a different file...
    So, something is still wrong...

  • RaymanRayman Posts: 13,797
    edited 2021-10-13 16:51

    I was able to add "-P2" to the project options and then compile and build.
    But, I'm not seeing how to load into P2 RAM..

    The Execute button is just for P1, is that right?

    Anyway, Geany looks promising, but need to figure out how to make stable...

  • RossHRossH Posts: 5,336

    Hi Rayman

    Ok - I think I have it.

    Can you confirm that you can start Geany reliably from the Catalina command line (i.e. using the "start_geany" command?)

    If so, I will issue another small errata with a simple fix for those shortcuts.

    Ross.

  • RaymanRayman Posts: 13,797

    I don't think I have "start_geany"...

    catalina_geany.bat starts geany just fine. It just crashes when I open a file...
    Except for the computer where I also installed geany independently...

  • RossHRossH Posts: 5,336

    Ok, just saw your responses, and I'm back to being stumped again. If standard Geany crashes as well, then it may not be a Catalina problem at all.

    I have gotten to the point where I can use Catalina reliably on all the machines I have available, but I can't seem to reproduce what you are seeing. I saw something similar once on one machine, but it went away by itself and now I cannot reproduce it even on _that _machine.

    One thing to try is deleting your Geany configuration files. They may be corrupted. These should be in %HOMEPATH%\Appdata\Roaming\geany. Just delete that whole folder - it will be rebuilt automatically next time you start Geany.

    Ross.

    P.S. Catalina's version of Geany has some changes to better support Catalina. If you use standard Geany you will not be able to use the project files and Makefiles provided with Catalina, and will instead have to configure everything for yourself manually.

  • RossHRossH Posts: 5,336

    HI Rayman

    One more thing to try - part of the problem appears to be permissions related, so give yourself full permissions on all the files in the Catalina directory and see if that helps.

    The easiest way to do this is by using File Explorer: right click on the Catalina program directory (e.g. C:\Program Files (x86)\Catalina_4.9) and select Properties. On the Security tab, click the Edit button, select "Users" in the top pane and tick n the "Allow" & "Full Control" box in the bottom pane. Then say OK.

    Ross.

  • RossHRossH Posts: 5,336

    @Rayman said:
    I don't think I have "start_geany"...

    catalina_geany.bat starts geany just fine. It just crashes when I open a file...
    Except for the computer where I also installed geany independently...

    Sorry, yes I meant "catalina_geany". The permissions change I just recommended may help.

  • RossHRossH Posts: 5,336

    Hello Rayman

    Good news - I now have a virtual machine on which I can reproduce your problem. It makes no sense to me yet - I can fix it with enough frigging about, but I cannot understand what causes it. On other machines everything just works fine every time. Windows is doing something odd, but I am yet to identify exactly what.

    I'd suggest ignoring this release for a while - I will post again when I have a reliable solution.

    Ross.

  • RaymanRayman Posts: 13,797

    Glad you are able to reproduce…
    Permissions didn’t help?

  • RaymanRayman Posts: 13,797
    edited 2021-10-14 19:46

    FWIW: On the computer that I've installed Geany separately AND THEN REBOOTED, everything seems fine. Other two computers still crash the program after opening a file even after reboot.

  • RaymanRayman Posts: 13,797

    With Geany, can compile some things, but some of the games I've tried are giving floating point errors like this:

    632 x 150 - 8K
  • RaymanRayman Posts: 13,797

    @Rayman said:
    With Geany, can compile some things, but some of the games I've tried are giving floating point errors like this:

    Never mind, I figured it out... Was using othello.geany project instead of the one for star trek.
    Seems it needs the "-lm" build option...

  • RaymanRayman Posts: 13,797

    Another clue for you...

    On one of the computers where geany is crashing: Installed Geany 1.38 separately. This didn't help the Catalina Geany at first.
    But, after opening both a .c and a .geany file with Geany 1.38, the Catalina Geany no longer crashes!

    No idea what this means though. Feels like some sort of strange registry problem...

  • RossHRossH Posts: 5,336

    Hello Rayman

    I have added an errata file to the first post in this thread that includes a workaround to the problem of Catalina Geany crashing on startup on some Windows systems. Just unzip that file over your Catalina installation (you will need Administrator permission).

    The problem is with Geany, but the Geany developers claimed to have fixed it. However, I tried their fix and it does not work in all instances. The workaround just adds the -s option to Catalina Geany on startup, which prevents it trying to load any files from a previous session.

    This workaround works on all the systems I have. Let me know how it goes on yours. I will issue a better fix in the next release.

    Ross.

  • RaymanRayman Posts: 13,797

    It works!
    Tried this errata file out on my 1 PC that wasn't already fixed by installing geany separately, and it did fix the crashing issue.

  • RossHRossH Posts: 5,336

    Thanks, Rayman. I have a better fix almost ready to go. Just need to do a bit more testing before releasing it.

    Ross.

  • RaymanRayman Posts: 13,797

    Can you pls remind me what I need to do to have the Execute button work for P2, if anything?

    It couldn’t find my P2 although think connected…

  • RaymanRayman Posts: 13,797

    Any way to move the project open commands tab all the way to the left?

    Or, put it under files?

    It’s strange being in the middle like that…

  • RaymanRayman Posts: 13,797

    Glad you found an IDE that works BTW. This is great for quick testing.

    I’ll probably stick to visual studio for large projects though.

  • RossHRossH Posts: 5,336
    edited 2021-10-16 06:09

    @Rayman said:
    Can you pls remind me what I need to do to have the Execute button work for P2, if anything?

    It couldn’t find my P2 although think connected…

    Nothing special. I just compiled and downloaded the Geany startrek example project to my P2. Here is how I did it:

    Start a Catalina Command Line window (we do this so we can set the CATALINA_DEFINE environment variable, which means we don't need to modify any of the project settings).

    Enter the following commands (assuming you have a P2_EVAL):

    set CATALINA_DEFINE=P2_EVAL
    cd %LCCDIR%\demos\games
    catalina_geany startrek.geany
    

    Then, in Geany, do Build->Clean then Build->Make (the Clean is just in case there is an existing binary).

    This will compile the program to use the serial interface - so to download, execute and interact with it use the command Build->Download and Interact. Your problem may be that the Execute button just downloads - it does not start the serial terminal to interact with the program. To do that you need to use the menus.

    That's all. The only thing you may need to check is the Baudrate in Project->Properties. For the Propeller 2, make sure it is set to 230400.

    If you still have problems, try doing it without using Geany. Open a Catalina Command Line window and enter the following commands:

    set CATALINA_DEFINE=P2_EVAL
    cd %LCCDIR%\demos\games
    make clean startrek
    payload -i -b230400 startrek
    

    Ross.

  • RossHRossH Posts: 5,336

    @Rayman said:
    Any way to move the project open commands tab all the way to the left?

    Or, put it under files?

    It’s strange being in the middle like that…

    I didn't want to change the basic Geany interface since that would confuse people who were familiar with it.

    The silliest thing is that you can open a project file using the normal File->Open menu entry but it opens it as a text file, not as a project. This would hardly ever be what you intended.

    It would make sense if Geany recognized you are opening a project file and give you the option to open it as a project instead. I may think about doing that as a Catalina customization in a future release.

  • RaymanRayman Posts: 13,797

    @RossH The above didn't work for loading into P2 Eval Board. But, giving payload the "-o2" option did work.

  • RaymanRayman Posts: 13,797

    Ok, got Geany to load p2 by adding the -o2 option to project:

    Can you replace the "Execute" menu item with "Download and Interact"?

    607 x 423 - 14K
  • RaymanRayman Posts: 13,797

    @RossH Looking at your "chimaera" example...

    Spin2 and FlexProp recently added defined values for all the smartpin settings. Have you added this yet?
    Also, the pinstart macro (?) would be nice so you can set up a smartpin in one line like this: _pinstart(8, P_NCO_FREQ+P_OE, 12, 0x8000_0000);

    BTW: I believe there's a typo in that example. Repository mode is actually 0x02 instead of 0x06. Although, it seems 0x06 also works.

  • evanhevanh Posts: 15,126

    WRPIN #2, #4 and #6 will all work as a repository smartpin. They overlay the three DAC dither modes.

  • RossHRossH Posts: 5,336
    edited 2021-10-16 23:40

    @Rayman said:
    Ok, got Geany to load p2 by adding the -o2 option to project:

    Can you replace the "Execute" menu item with "Download and Interact"?

    You can do this yourself in a few ways:

    1. Add -i to the Loader field in Project->Properties.
    2. Add -i to the Download and Execute command in Project->Set Build Commands.
    3. Edit the file "%LCCDIR%\catalina_geany\data\filedefs\filetypes.c", find the following line:
      EX_00_CM=payload %x "%e" -b%b
      and change it to
      EX_00_CM=payload %x "%e" -b%b -i

    The first two will only work for the current project. The third method will work for all projects. And of course you can also add the -o2 flag to any of these methods if you find it necessary.

    Ross.

  • RossHRossH Posts: 5,336

    @Rayman said:
    @RossH Looking at your "chimaera" example...

    Spin2 and FlexProp recently added defined values for all the smartpin settings. Have you added this yet?
    Also, the pinstart macro (?) would be nice so you can set up a smartpin in one line like this: _pinstart(8, P_NCO_FREQ+P_OE, 12, 0x8000_0000);

    BTW: I believe there's a typo in that example. Repository mode is actually 0x02 instead of 0x06. Although, it seems 0x06 also works.

    ... and ...

    @evanh said:
    WRPIN #2, #4 and #6 will all work as a repository smartpin. They overlay the three DAC dither modes.

    Thanks guys. Yes, I added "smartpins.h" header file to Catalina. I will check out the pinstart macro and example this afternoon. But if it's just a macro, then I'm fairly sure you could add it yourself if you need it.

  • RossHRossH Posts: 5,336

    @Rayman said:

    Also, the pinstart macro (?) would be nice so you can set up a smartpin in one line like this: _pinstart(8, P_NCO_FREQ+P_OE, 12, 0x8000_0000);

    Turns out I had to add a "pinstart" function for the recently added 8 port serial driver - but I didn't realize it would be generally useful, so I left it internal to that code.

    I could add it to the standard libraries, or else add a macro version to the standard header.

    Or you can do either or both yourself. Here is some example code that implements it both ways:

    #include <propeller2.h>
    #include <smartpins.h>
    
    /*
     * pinstart.c - a demonstration of pinstart as a macro and as a function.
     *
     * Compile this program with a command like ...
     *
     *   catalina -p2 pinstart.c -y -lci -O5
     *
     * ... and examine the listing output
     */
    
    /*
     * example of a _pinstart macro
     */
    #define _pinstart(pinfield, mode, xval, yval) \
       { \
          _dirl(pinfield); \
          _wrpin(pinfield, mode); \
          _wxpin(pinfield, xval); \
          _wypin(pinfield, yval); \
          _dirh(pinfield); \
       }
    
    /*
     * example of a pinstart function
     */
    static void pinstart(int pinfield, uint32_t mode, uint32_t  xval, uint32_t  yval) {
       _dirl(pinfield);
       _wrpin(pinfield, mode);
       _wxpin(pinfield, xval);
       _wypin(pinfield, yval);
       _dirh(pinfield);
    }
    
    void main() {
    
       // the following two lines of code are functionally identical ...
    
       // using the function ...
       pinstart(8, P_NCO_FREQ+P_OE, 12, 0x80000000);
    
       // using the macro ...
       _pinstart(8, P_NCO_FREQ+P_OE, 12, 0x80000000);
    
       // using the macro method is faster, but using the 
       // function will give you smaller code sizes.
    
    }
    
    

    I don't mind implementing it the same way others have done for compatibility, if someone can tell me which way they do it.

Sign In or Register to comment.