Shop Learn
Catalina — Parallax Forums

Catalina

RossHRossH Posts: 4,776
edited 2021-11-23 06:56 in Propeller 2
I have just added the release version of Catalina 4.9.4 to SourceForge. This release is for both Windows and Linux.

The main purpose of this release is to add a new serial interface option that saves a cog.

Here is the relevant section of the README file:
RELEASE 4.9.4

New Functionality
-----------------
 
1. Added a new serial HMI option called SIMPLE (supported on the P2 only).
   This option uses P2 smartpins to implement a very simple serial interface.
   The advantage of the new HMI option is that it saves a cog over the default
   serial HMI option (TTY). The disadvantage is that may not support very high 
   baud rates - but baud rates up to 230400 are supported, which means it is 
   sufficient for a serial terminal.  To use it, define the symbol SIMPLE on
   the command line. For example:

      catalina -p2 -lci hello_world.c -C SIMPLE
      payload -i -b230400 hello_world.bin

2. The serial baud rate can now be specified on the command line, either by
   using the -B command line option, or by defining the symbol _BAUDRATE 
   using a complex definition such as -C "_BAUDRATE=xxx". This is supported 
   on the Propeller 2 only. The payload loader now also accepts -B to specify 
   the baud rate - i.e. payload now accepts either -b or -B (whereas catalina 
   only accepts -B since -b already meant something else). For example:

      catalina -p2 -lci -B9600 hello_world.c
      payload -i -B9600 hello_world.bin

   or

      catalina -p2 -lci -C "_BAUDRATE=9600" hello_world.c
      payload -i -B9600 hello_world.bin

   If it is not specified on the catalina command line, the default baud rate
   defined for the platform (in Catalina_platforms.inc in the target_p2 
   directory) will be used.

Other Changes
-------------
 
1. Complex symbols had not been implemented in the Catalina Optimizer, which 
   meant that the optimizer could not be used if the command line contained a 
   complex definition such as:

      -C "name=value"

2. Payload now allows baud rates down to 300 baud. There was really no reason 
   payload ever limited the baud rates (it used to impose a minimum of 19200 
   baud) except that at the lower baud rates the program load times become so
   long that it was not much use. However, this was before payload could also
   be used as a serial terminal emulator, and in some cases low baud rates
   are useful for testing. However, note that the P2 smart pin UARTs use a 
   16-bit value for baud timing which can limit baud rates - to use baud rates
   lower than 4800 baud you may need to also specify a lower system clock 
   frequency. For instance, to use a baud rate of 300 baud, you may need to
   use a clock speed of 12Mhz or lower:

      catalina -p2 -lci hello_world.c -C SIMPLE -B300 -f12Mhz

3. There was a bug in the Catalina HMI "t_bin()" function, which prints the 32 
   bit binary representation of its integer or unsigned argument. The value 
   was effectively being shifted left by 3 bits.

Ross.
«1345

Comments

  • RossHRossH Posts: 4,776
    edited 2020-10-03 22:36
    Catalina 4.5 has been superseded by release 4.6. See the previous post for details.
  • RossHRossH Posts: 4,776
    Catalina 4.6 has been released. See the top post for details.
  • RaymanRayman Posts: 12,315
    @RossH Thanks for keeping Catalina going. It's nice to have options...

    I just installed the latest version to see if it could run this MicroMax Chess code...

    It compiles and run, but just like FlexC, it hangs if you hit enter when it is supposed to look for a move.
    You can manually move pieces by entering moves like "e2e4", but also just like FlexC, there is something wrong with the black pawns... They don't move, for example.

    Anyway, don't expect you to do anything about it, just letting you know I'm testing out Catalina.

    This code was designed to use as few a characters as possible, which seems very silly to me... I imagine why that is why compilers might have a hard time with it...
  • RaymanRayman Posts: 12,315
    edited 2020-10-10 22:26
    This chess code seems to work, except that the function GetMillisecs() needs fixing because I hacked it to make it compile.
    The interface asks how many seconds to give computer. If you say "0", it moves right away. If you say "1", it thinks longer that I could wait for...

    Also, it can't find the opening book file even though I put it on the uSD card of the Eval board...

    I did the compile and load like this:
    catalina NGplay_61.c -p2 -lc -C P2_EVAL -C NATIVE
    payload -i -z -b230400 NGplay_61.bin
    
    c
    c
  • RossHRossH Posts: 4,776
    Rayman wrote: »
    @RossH Thanks for keeping Catalina going. It's nice to have options...

    I just installed the latest version to see if it could run this MicroMax Chess code...

    It compiles and run, but just like FlexC, it hangs if you hit enter when it is supposed to look for a move.
    You can manually move pieces by entering moves like "e2e4", but also just like FlexC, there is something wrong with the black pawns... They don't move, for example.

    Anyway, don't expect you to do anything about it, just letting you know I'm testing out Catalina.

    This code was designed to use as few a characters as possible, which seems very silly to me... I imagine why that is why compilers might have a hard time with it...

    Seems to work ok for me. But I must admit I only played a few moves, because each move takes a looooonnnnnggg time!

    What are you running it on, and what command did you use? I ran it on a P2, and used the command:
    catalina -p2 micromax.c -lci -ltiny -C P2_EVAL -C TTY -C NATIVE -C NO_FLOAT
    
  • RossHRossH Posts: 4,776
    Rayman wrote: »
    This chess code seems to work, except that the function GetMillisecs() needs fixing because I hacked it to make it compile.
    The interface asks how many seconds to give computer. If you say "0", it moves right away. If you say "1", it thinks longer that I could wait for...

    Also, it can't find the opening book file even though I put it on the uSD card of the Eval board...

    I did the compile and load like this:
    catalina NGplay_61.c -p2 -lc -C P2_EVAL -C NATIVE
    payload -i -z -b230400 NGplay_61.bin
    

    I haven't looked at the code, but to use the SD Card you need to use -lcx instead of -lc
  • RossHRossH Posts: 4,776
    Hi @Rayman

    I was interested as to why the MicroMax chess program is so slow, so I did some measurements on it. I only did a couple of runs, but the reason becomes clear almost immediately - most of the work is done by one function (D), which is recursive. This very complex function gets called anywhere between 200,000 and 500,000 times while searching for the best move, and it recurses to a depth of 25 or so calls.

    I think the author was concentrating on program size, not speed! :)

    Ross.
  • RaymanRayman Posts: 12,315
    @RossH i think you are right. Although it seems to have been ported to microcontrollers. The code is very obtuse though. I think I like the look of ngplay better.
  • RaymanRayman Posts: 12,315
    edited 2020-11-09 14:35
    I tried out MicroMax again after seeing it in Gameduino...

    This code seems to work with Catalina. Rigged for computer vs computer.

    Had to bypass the millis() function though.
    In FlexProp, there is now _getms().
    Not sure this is really used by the chess engine itself, so I didn't bother to fix it.

    BTW: Is there a way to escape from the payload terminal and get back to command line?
  • RossHRossH Posts: 4,776
    Rayman wrote: »
    BTW: Is there a way to escape from the payload terminal and get back to command line?

    CTRL-D
  • RossHRossH Posts: 4,776

    Catalina 4.7 has been released (currently, Windows only). See the first post in this thread for details.

  • RaymanRayman Posts: 12,315

    Just installed... Windows complained a lot, but was able to get it to install.

    Seem to be missing the "Catalina Command Line" shortcut in the start menu. But, I found it in the install folder.

  • RaymanRayman Posts: 12,315

    It does still build a chess program I tried before with Catalina, NGplay_61.c, so that's good.

    Tried to compile lvgl (https://github.com/lvgl/lvgl), but it's not finding the include files...
    There are about a thousand include files...
    Catalina does not seem to be finding them.
    I'm sure I'm doing something wrong...

    This is asking a lot, but if you want to see what I'm looking at...
    The build.bat file in the attached tries to compile lvgl_test1.c
    It looks like it finds include files in the current directory, but not in the \src directory tree...

  • RossHRossH Posts: 4,776

    Hi Rayman

    Will have a look tomorrow.

    rossh

  • RossHRossH Posts: 4,776
    edited 2021-09-05 23:52

    @Rayman said:

    Tried to compile lvgl (https://github.com/lvgl/lvgl), but it's not finding the include files...
    There are about a thousand include files...
    Catalina does not seem to be finding them.
    I'm sure I'm doing something wrong...

    There is something wrong with your directory structure. Here is first error message I get, with an example of the problem:

    cpp: ./lv_conf_internal.h:41 ./src/misc/lv_log.h:16 ./lvgl.h:25 lvgl_test1.c:3 Could not find include file "../../lv_conf.h"

    So, decoding that:

    lvgl_test1.c includes ./lvgl.h at line 3
    ./lvgl.h includes ./src/misc/lv_log.h at line 25
    ./src/misc/lv_log.h includes ./lv_conf_internal.h at line 16
    ./lv_conf_internal.h includes ../../lv_conf.h at line 41

    But from the location you are compiling lvgl_test1.c there is no ../../lv_conf.h - however, there is one at ./lv_conf.h

    rossh

  • RossHRossH Posts: 4,776

    @Rayman said:
    Just installed... Windows complained a lot, but was able to get it to install.

    Seem to be missing the "Catalina Command Line" shortcut in the start menu. But, I found it in the install folder.

    Odd. Works ok for me. What version of Windows are you using?

    rossh

  • RaymanRayman Posts: 12,315

    @RossH said:

    @Rayman said:
    Just installed... Windows complained a lot, but was able to get it to install.

    Seem to be missing the "Catalina Command Line" shortcut in the start menu. But, I found it in the install folder.

    Odd. Works ok for me. What version of Windows are you using?

    rossh

    Latest Win10. I still had the last version installed though. Maybe that messed it up somehow…

  • RaymanRayman Posts: 12,315

    Thanks for looking at the code issue. Looks like an easy fix.

  • RossHRossH Posts: 4,776

    I have updated payload to allow it to be used to program FLASH RAM on the P2 without needing to reset the microswitches on the P2_EVAL board. This required a modification to the Propeller version detection code (basically, you can now override it and manually specify your Propeller version). This update allows payload to correctly use the 100ms serial window on the Propeller 2.

    Attached is a zip file containing the new version of payload and the updated README_P2.TXT file. This version will be included in Catalina 4.7 when I have finished testing the current beta release. Here is an extract from the updated README_P2.TXT file:

    There is also a a payload-based utility that can program the FLASH RAM on the
    P2_EVAL board:

    flash_payload program.bin [ other payload options ]

    e.g:

    flash_payload othello.bin -b230400 -z -i

    Note that you must have the microswitches on the P2_EVAL PCB set correctly to
    program the FLASH. Here is one way to do it:

    FLASH set to ON
    P59^ set to ON
    P59v set to OFF

    Then, execute the flash_payload command, and once all the LEDs have gone out
    (which indicates the FLASH programming has completed) set the P59^ microswitch
    to OFF and reset the P2 to execute the loaded program from FLASH.

    Another way to do this is possible, which does not require microswitch changes.
    However, this method only works if you override payload's normal autodection
    of whether it is talking to a Propeller 1 or a Propeller 2 using the -o option.
    Set the microswitches as follows:

    FLASH set to ON
    P59^ set to OFF
    P59v set to OFF

    Now, by executing the flash_payload command with the -o2 option, you can load
    the FLASH RAM and then execute the program from FLASH in one command without
    needing to change any of the microswiches. For example:

    flash_payload othello.bin -b230400 -o2 -i

    rossh

  • RossHRossH Posts: 4,776

    I have just uploaded a validated (i.e. non-beta) release of Catalina 4.7 to sourceforge. This release is for both Linux and Windows. There are a few changes from the beta release:

    • NATIVE is now the default mode for the Propeller 2.
    • there is a new version of the payload loader, with improved support for FLASH RAM on the Propeller 2.
    • Code::Blocks is no longer supported on Linux (it remains supported on Windows).

    See the first post in this thread for more details.

    rossh

  • RossHRossH Posts: 4,776

    I've just uploaded Catalina 4.8 to Sourceforge. There aren't many differences to 4.7, so I've also uploaded some small "patch" files to the errata directory (https://sourceforge.net/projects/catalina-c/files/errata/) which you can use to upgrade an existing 4.7 release to 4.8 without having to download and install the whole new release.

    The differences are very minor (mostly some missing documentation updates and an update to the inline PASM function).

    Here is an extract from the README.TXT:

    RELEASE 4.8

    1. Updates to the reference manuals and the command summaries to include the
      changes made to payload in release 4.7.

    2. A bug introduced in release 4.7 when making NATIVE the default memory
      model on the P2 has been fixed.

    3. The definition of the PASM() function (used to include inline PASM in C
      code) has been modified to indicate it can return an int rather than a void.
      This prevents Catalina from overwriting return values (i.e. the value
      present in r0 when the PASM code finishes execution). The new definition is:

      extern int PASM(const char *code);

      This should not make any difference to existing code that does not use the
      return value of the PASM function. New PASM example program called
      test_inline_pasm_3.c and test_inline_pasm_4.c have been added to the
      examples in the demos\spinc folder to illustrate the use of the return value.

    4. Updated the build_all scripts in the demos\spinc folder to only build demo
      programs appropriate to the propeller type (i.e. 1 or 2).

    5. The file flash_led.obj was missing from the demos\spinc folder.

    The bug mentioned in point 2 was very minor and is unlikely to have affected anyone's C programs except mine (the compiler was defining both __CATALINA_NATIVE and __CATALINA_TINY in some cases when it should have defined just __CATALINA_NATIVE).

    Ross.

  • RossHRossH Posts: 4,776

    I have no plans for another release of Catalina just yet, but I have a question ...

    I recently dropped support for the Code::Blocks IDE under Linux (I can no longer get it to compile), and I expect to do so in Windows soon (same reason - it is becoming almost impossible to compile). Also, Code::Blocks is far too complex for the type of projects we typically build on the Propeller.

    The Catalina Geany IDE (which will remain supported) is much simpler and easier to use.

    However, one advantage Code:Blocks did have is that you didn't have to have a make utility installed - it has an equivalent built in. Geany does not have this - it can build simple projects very easily, but complex projects must use an external Makefile, and therefore (on Windows) this requires you to also install a version of make.

    So ... here is the question ...

    Would it be ok to assume Windows users can install and use a version of make (e.g. from http://gnuwin32.sourceforge.net/packages/make.htm) to build all the example programs and demos? Doing so would mean that I would no longer have to support different batch scripts on Windows and Linux - I could just use a common Makefile.

    Obviously, I am thinking 'yes' because it would save me quite a lot of work - but I am interested in hearing other opinions before I finally decide.

    Rossh

    P.S. Also, just an early warning - the next version of Catalina will probably remove the -F compiler option, which allowed the binary output to be produced in different formats (e.g. Motorola S record or Intel Hex format). You will of course still be able to generate the standard Parallax formats - .bin on the P2, or .binary or .eeprom on the P1. If anyone still needs this capability (I can't even remember now who originally requested it) then the srecord utility (which is what -F invokes) has a stand-alone version you can use to do the same job. It no longer seems necessary to have this capability embedded within Catalina. Again, comments welcome.

    Ross.

  • Would CodeLite be a replacement worth looking at? I think it's a maintained fork of Code::Blocks. Otherwise, is there any accessible/reusable portion of LccWin32?

  • RossHRossH Posts: 4,776

    @Circuitsoft said:
    Would CodeLite be a replacement worth looking at? I think it's a maintained fork of Code::Blocks. Otherwise, is there any accessible/reusable portion of LccWin32?

    Sorry, just saw this - been busy. I think CodeLite would have the same compilation nightmares as Code::Blocks, since it also uses wxWidgets (which was Code::Blocks downfall).

    Geany does everything I need, is much simpler to modify, build and use, so I have decided to go with that. The only thing missing from Geany on Windows was the lack of a built-in ability to build complex programs (which Code::Blocks had). But since I have now added **make **to do that particular task, this deficiency has been very neatly solved.

    Ross.

  • RossHRossH Posts: 4,776

    All

    I have just released Catalina 4.9. See the first post in this thread for details. It is primarily a Propeller 1 "bug fix" release, but it also adds better integration between Catalina, Geany and make on the Propeller 2.

    I would appreciate feedback on the installation process from Windows users. I have seen some odd initial behavior - basically, on initial install some programs (most notably Geany) seem to crash or not run at all ... then, a few minutes later, everything seems to work fine without further intervention. I am presuming this is some weird new Windows 10 behavior, but every time I try and reproduce it, it just seems to go away by itself before I can figure out what's wrong.

    Ross.

  • RossHRossH Posts: 4,776
    edited 2021-10-17 12:19

    Errata file deleted, as it would cause problems with release 4.9.1. It is still available on SourceForge for 4.9 users - but better to upgrade to 4.9.1.

  • RaymanRayman Posts: 12,315

    @RossH Just download and installed on a relatively old computer running Win10 that didn't have Catalina before.

    The install went as expected. Having trouble with Geany though...

    The file->Open command takes a very long time to bring up the file browser, but eventually does.
    When I try to open the star trek game example, startrek.c, it crashes.
    Rebooted, but it still does this.

  • RaymanRayman Posts: 12,315
    edited 2021-10-12 22:01

    Tried on a better Win10 computer after uninstalling Catalina 3.15.4.
    Same thing.

    Well, the file-Open was lightning fast. But, it crashed after opening startrek.c.

    It shows the code for about 3 seconds then crashes with no user input.

  • RossHRossH Posts: 4,776
    edited 2021-10-12 22:31

    Thanks, Rayman. My problem is that on every computer I have installed it, it ends up working after a while ... but I'm not sure how or why.

    One thing to try - it doesn't seem to like being opened from the Start Menu straight after the install. Can you try opening a Catalina Command Line window and start geany from that using the command "catalina_geany"? It seems that once it has run successfully once, it runs ok thereafter no matter how it is started. Also, if you get it to run once, go into the Edit->Preferences menu, and on the Miscellaneous tab, select both the Project Options - i.e.:

    • "Use project-based session files"
    • "Store project files inside the projects base directory"

    I'll investigate further now that I know it is not just my imagination! :)

    Ross.

  • RaymanRayman Posts: 12,315

    @RossH Tried that, but it still crashes a couple seconds after loading...

Sign In or Register to comment.