Shop OBEX P1 Docs P2 Docs Learn Events
Catalina 3.3 BETA — Parallax Forums

Catalina 3.3 BETA

RossHRossH Posts: 5,550
edited 2011-10-09 05:49 in Propeller 1
UPDATE: The non-beta version of Catalina 3.3 has been released. See here.

All,

A BETA release 3.3 of Catalina is now available on SourceForge (here). Presently, only the Windows version is available. I will post Linux versions (32 and 64 bit) when I have done some more testing and am ready to release the non-beta version.

Release 3.3 is a full release of Catalina. It is primarily intended for users who have a FlashPoint SuperQuad or FlashPoint RamPage module and want to use it with Catalina.

However, be aware that this release has not been extensively tested on other platforms (except for the C3, which is the platform what I used to develop and test the SuperQuad and Rampage support).

Here is a brief overview of the changes:
  1. Support for the FlashPoint XMM boards (i.e. the SuperQuad and the RamPage). Although they are both XMM "add on" boards that must be connected to a suitable propeller platform, each has been assigned its own platform symbol (i.e. SUPERQUAD and RAMPAGE). However, if you don't want to use these names, the necessary details can easily be incorporated into the configuration files for another platform (e,g. CUSTOM). Since they are quite similar, the options for both boards are defined in the same configuration files (i.e. FlashPoint_DEF.inc, FlashPoint_CFG.inc, FlashPoint_HMI.inc and FlashPoint_XMM.inc). See FlashPoint_README.txt in the Catalina\target directory for more details on how these files can be used.
  2. Removed all platform-specific options from the plugins, and added a new CFG file for each platform (e.g. Hydra_CFG.inc) which contains all plugin configuration options for the platform. This makes it much easier to support new platforms without having to edit each plugin file.
  3. Included the RTC (CLOCK) functionality in the SD plugin – now, if the SD plugin is loaded, the CLOCK plugin will not be loaded – the CLOCK code embedded in the SD plugin will be used instead (if the SD plugin is not loaded, the CLOCK plugin will still be loaded as usual). This saves a cog in many cases on large complex programs. This is all automatic - no user intervention is required.
  4. Formalized the XMM API to include both Cache and Flash support. This was required since the quad-bit SPI Flash chips used by the FlashPoint modules could not be accommodated in the existing (but largely undocumented) Flash API, which could only cope with the type of single-bit SPI chips used by the C3 and Morpheus platforms. Now all platforms use a common XMM API, which is divided into three parts:
  • the cached API, intended to be used only via the cache
  • the direct API, intended for inclusion directly in the kernel
  • the flash API, intended to be used when Flash support is required.
See the updated section on the XMM API in the Catalina Reference Manual for details on the individual functions required by each part of the API. Note that not all the parts are necessary - if you are happy to access the XMM RAM only via the cache, then the cached API can be used stand-alone. It requires only four simple PASM functions to be written (i.e. XMM_Activate, XMM_Tristate, XMM_ReadPage & XMM_WritePage). The direct API is just the existing XMM API (i.e. pre 3.3), and the flash API adds the functions required to erase and program Flash chips to allow them to be used as XMM RAM.
Any problems, questions (or bugs!) please let me know.

Ross.

Comments

  • RossHRossH Posts: 5,550
    edited 2011-10-05 04:45
    This page reserved for updates and bug fixes.

    Found the first bug already ...
    1. Compiling Catalyst gives you an undefined symbol error on DEFAULT_CPU.

      To fix this, copy the updated version of Catalyst_XMM_SD_Loader.spin (attached) to your Catalina target folder (e.g. C:\Program Files (x86)\Catalina\target).
    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-05 09:23
    Thanks Ross! I'm still learning how to use Catalina, but so far, I think it's great.
    Hopefully, my Rampage and Superquad modules will be useful to those who want to try out huge C programs like you "Super Star Trek" example,
    without using a soldering iron. Should be able to just plug them in, even to a breadboard Prop setup, and be off...

    I think with Rampage you should have the option of running from SRAM or Flash, right? How do you select between these two?
  • RossHRossH Posts: 5,550
    edited 2011-10-05 14:52
    Hi Rayman,

    Because of the complexity of driving the Quad Flash chips, and also the speed of access, you need to use the cache for both boards. To do this via the command line you define one of the cache symbols - i.e. CACHED_1K, CACHED_2K, CACHED_4K, CACHED_8K (or just CACHED).

    The SuperQuad only has Flash memory, but you still you need to define the symbol FLASH. Also, the SuperQuad only supports the SMALL memory model. So to compile "hello_world" to run out of the SuperQuad Flash you would use a command like:
    catalina hello_world.c -lc -D SUPERQUAD -D CACHED -D FLASH -D SMALL
    
    With the RamPage you have more flexibility. You can elect to use the Flash or not, and since the RamPage has both Flash and SRAM, you can use either the SMALL or LARGE memory models. So all of the following should work:

    To use only the Flash (i.e. SMALL mode):
    catalina hello_world.c -lc -D RAMPAGE -D CACHED -D FLASH -D SMALL
    
    To use both the Flash and the SRAM (i.e. LARGE mode):
    catalina hello_world.c -lc -D RAMPAGE -D CACHED -D FLASH -D LARGE
    
    To use only the SRAM (here you can use either SMALL or LARGE mode):
    catalina hello_world.c -lc -D RAMPAGE -D CACHED -D SMALL
    catalina hello_world.c -lc -D RAMPAGE -D CACHED -D LARGE
    
    If you don't like using the command line, you can do exactly the same in Code::Blocks by just selecting the appropriate project build option. Also, you will notice that SUPERQUAD and RAMPAGE are now available choices in the Code::Blocks Catalina Project Wizard.

    It is worth remembering that to load the programs successfully, you also have to build the appropriate loaders and other utilities - either use the Build XMM Utilities tool in Code::Blocks, or execute the build_utilities batch file from the command line, and answer the questions it asks.

    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-05 16:24
    Thanks Ross, that's a lot to sort through...

    BTW: Do I need to uninstall my current version before installing this one?

    BTW2: (I hate to keep asking for stuff but) How hard would it be to add Harrison's ethernet driver to a Catalina project?
    I was just thinking that if I could use the ethernet port on my PropBox along with RamPage, that might open up some possible apps.

    BTW3: I just remembered that my PropBox has a "real" RTC, the DS1307. Is there an easy way to use that instead of the synthetic one?

    BTW4: Have you looked at all into getting a chess program, such as GNU chess, to compile?
  • RossHRossH Posts: 5,550
    edited 2011-10-05 18:26
    Rayman wrote: »
    BTW: Do I need to uninstall my current version before installing this one?
    No - just install the new one to a different directory (e.g. C:\Program Files\Catalina 3.3 BETA).
    Rayman wrote: »
    BTW2: (I hate to keep asking for stuff but) How hard would it be to add Harrison's ethernet driver to a Catalina project?
    I was just thinking that if I could use the ethernet port on my PropBox along with RamPage, that might open up some possible apps.
    Network support has been on my "to do" list for a while. One day ...
    Rayman wrote: »
    BTW3: I just remembered that my PropBox has a "real" RTC, the DS1307. Is there an easy way to use that instead of the synthetic one?
    This would be a perfect opportunity for you to learn how to write a simple plugin! :smile:
    Rayman wrote: »
    BTW4: Have you looked at all into getting a chess program, such as GNU chess, to compile?
    No - first thing to check is to look at the size of the PC executable. Then double it - if you don't have that much RAM on your Propeller, then it probably can't be ported. If you do, then just try compiling it. Of course, GNU C is typically not ANSI C, so you'll probably have to rewrite at least parts of it.

    Ross.
  • RossHRossH Posts: 5,550
    edited 2011-10-06 01:34
    All,

    First bug fix already posted (well, I did say it was a beta ...!).

    See here for details.

    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-06 03:37
    Ross, I tried the link for the bug fix and it just brings me back here...
  • RossHRossH Posts: 5,550
    edited 2011-10-06 04:09
    Rayman wrote: »
    Ross, I tried the link for the bug fix and it just brings me back here...

    Hmm. How odd. It should take you to post #2 in this thread.

    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-06 12:41
    Ross, one more question...
    How do I tell Catalina which pins I'm using for Superquad or Rampage?
  • RossHRossH Posts: 5,550
    edited 2011-10-06 14:45
    Rayman wrote: »
    Ross, one more question...
    How do I tell Catalina which pins I'm using for Superquad or Rampage?

    Hi Rayman,

    See the file FlashPoint_DEF.inc. There is some general platform stuff at the beginning (which is currently configured for a C3) then near the end you will see the following section:
    '<---------------------------------- snip! ------------------------------------>
    '
    ' RAMPAGE Specific Definitions:
    '
    #ifndef RAMPAGE
    #define RAMPAGE
    #endif
    '
    ' XMM Base Address. Catalina currently requires one contiguous block 
    ' of XMM RAM - Note that this is the internal hardware address, not 
    ' the address the Catalina XMM Kernel uses:
    '
    XMM_BASE_ADDRESS = $0000_0000   ' XMM adddressing from 0
    '
    ' XMM RW & RO Base Addresses - Note that these are the addresses used
    ' by the Catalina XMM Kernel - they typically start AFTER the last
    ' Hub address:
    '
    XMM_RW_BASE_ADDRESS = $0000_8000 ' Read-Write Base address
    XMM_RO_BASE_ADDRESS = $0002_8000 ' Read-Only Base address
    '
    ' XMM RW & RO Sizes (in bytes):
    '
    XMM_RW_SIZE = $0002_0000         ' Read-Write Size
    XMM_RO_SIZE = $0010_0000         ' Read-Only Size
    '
    ' RAMPAGE QUAD SPI RAM Definitions (NOTE you also need to set the symbols 
    ' defined below these pin definitions to appropriate values): 
    '
    QSPI_VDD    = 0                 ' PIN (RAMPAGE) - see below to enable
    QSPI_CEN    = 1                 ' PIN (RAMPAGE)
    QSPI_SCK    = 2                 ' PIN (RAMPAGE)
    QSPI_SIO3   = 6                 ' PIN (RAMPAGE) \
    QSPI_SIO2   = 5                 ' PIN (RAMPAGE)  | MUST BE CONTIGUOUS
    QSPI_SIO1   = 4                 ' PIN (RAMPAGE)  |  (and see below)
    QSPI_SIO0   = 3                 ' PIN (RAMPAGE) /
    QSPI_RSCK   = 7                 ' PIN (RAMPAGE)
    QSPI_RCEN   = 16                ' PIN (RAMPAGE)
    QSPI_VSS    = 17                ' PIN (RAMPAGE) - see below to enable
    SSPI_SI     = QSPI_SIO0         ' PIN (RAMPAGE)
    SSPI_SO     = QSPI_SIO1         ' PIN (RAMPAGE)
    
    '
    ' Define this if QSPI_SIO0 is the highest numbered pin amongst SIO0 .. SI03
    '
    '#define QUAD_BITS_REVERSED
    '
    ' Define this to enable applying power to the QSPI_VDD & QSPI_VSS Pins
    ' (i.e. if they are connected to Propeller pins, and not directly to the
    ' appropriate power rails):
    '
    #define QUAD_POWER_PINS
    '
    ' Since Homespun has no general "#if" capability, we cannot tell whether
    ' or not we have to shift bits left or right to make the nibbles align
    ' with the pins QSPI_SIO0 .. QSPI_SIO3 when outputting data - so we have 
    ' to explicitly define whether or not we need to shift each nibble left 
    ' or right (but since the lower nibble would never have to be shifted 
    ' right, we only have three possibilities to worry about):
    '
    ' Define this symbol if the lower nibble has to be 
    ' shifted LEFT for output (i.e. lowest SIO pin is > 0) :
    '
    #define QUAD_LOWER_NIBBLE_LEFT
    '
    ' Define this symbol the upper nibble has to be 
    ' shifted LEFT for output (i.e. lowest SIO pin is > 4) :
    '
    '#define QUAD_UPPER_NIBBLE_LEFT
    '
    ' Define this symbol if the upper nibble has to be 
    ' shifted RIGHT for output (i.e. lowest SIO pin is < 4) :
    '
    #define QUAD_UPPER_NIBBLE_RIGHT
    '
    ' The following constant determines the number of longs used in the
    ' cache cog index - it can be reduced (e.g. to 6) if the XMM API 
    ' is so large it needs more space even in the cache cog (e.g. for 
    ' QUAD FLASH boards):
    '
    CACHE_INDEX_LOG2 = 6            ' log2 of entries in cache index
    '
    '<---------------------------------- snip! ------------------------------------>
    
    This contains all the RAMPAGE specific definitions, including the pin assigments. The only complex bit is that as well as specifying the pin numbers, you need to define (or undefine) the following symbols depending on what pins you use (as documented in the extract above):
    • QUAD_BITS_REVERSED Define this if QSPI_SIO0 is the highest numbered pin amongst SIO0 .. SI03
    • QUAD_POWER_PINS Define this to enable applying power to the QSPI_VDD & QSPI_VSS pins (i.e. if they are connected to Propeller pins, and not directly to the power rails).
    • QUAD_LOWER_NIBBLE_LEFT Define this symbol if the lower nibble has to be shifted LEFT for output (i.e. lowest SIO pin is > 0)
    • QUAD_UPPER_NIBBLE_LEFT Define this symbol the upper nibble has to be shifted LEFT for output (i.e. lowest SIO pin is > 4)
    • QUAD_UPPER_NIBBLE_RIGHT Define this symbol if the upper nibble has to be shifted RIGHT for output (i.e. lowest SIO pin is < 4)
    These symbols are used in the XMM API itself (which is in the file FlashPoint_XMM.inc).

    There is a similar section for the SUPERQUAD. In both cases, the files are correctly configured for use with the module plugged into the C3 expansion slot with Vdd connected to pin 0.

    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-06 15:48
    Thanks Ross.
    One final question: Suppose I foolishly attempt to improve the XMM code speed...
    Can you recommend a good test program for speed test?
  • RossHRossH Posts: 5,550
    edited 2011-10-06 16:07
    Rayman wrote: »
    Thanks Ross.
    One final question: Suppose I foolishly attempt to improve the XMM code speed...
    Can you recommend a good test program for speed test?

    You could use the XMM RAM test program. In the Catalina\utilities folder, type:
    build_ram_test RAMPAGE FLASH CACHED
    
    then any one of the following:
    payload ram_test_TV.binary
    payload ram_test_VGA.binary
    payload ram_test_PC.binary
    
    This is an interactive program. It does a trivial test of the first few memory locations, then a complex test of ALL memory locations. The complex test is designed to "thrash" any memory paging techniques in use (including the paging used by the cache). Finally, it tests the Flash functions.

    The complex test takes 5 - 10 seconds to run, so you can just use a stopwatch.

    This also has the advantage of letting you know if your changes break the XMM code, since the memory test will fail.

    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-07 16:13
    Ross, I was just looking around for ANSI C chess programs.... First hit looks like "Crafty". Does being ANSI mean it will be easy to port?
  • RossHRossH Posts: 5,550
    edited 2011-10-07 17:34
    Hi Rayman,

    I had a quick attempt at compiling Crafty Chess. It could be made to compile (with a few minor tweaks) but it appears to have a in-build assumption that 64 bit integers are available - even on 32 bit machines.

    If this assumption is deeply embedded in the internal algorithms (as it appears to be!) then it would require significant modification to get it to run.

    Ross.
  • RaymanRayman Posts: 15,000
    edited 2011-10-08 08:36
    I just took a quick look and I think all modern chess codes use "bitboards" where a 64-bit long has one bit for every square of the 8x8 board...

    Suppose that's a real issue, unless there's some trick like defining "long" to be a structure of two ints and then somehow defining operators for that structure...

    I think I want to make a chess program though for Catalina. I have my Spin code that I ported from Javascript that I could go from.
    I also just found "picChess" on Instructables.com that uses a char[128] array for the board...
    But, that engine doesn't look to be as strong as others because it does't use hash boards. Still, that's something that looks easy to port over here...
  • KMyersKMyers Posts: 433
    edited 2011-10-08 09:39
    Rayman, I would love to see / use a Catalina chess program but that sort of programming is well beyond my current skill level! I guess I will never get to that level, Good luck with your project!
  • RaymanRayman Posts: 15,000
    edited 2011-10-08 11:37
    Ross, I still must not understand what's going on because I still need to do a "payload flash_boot" to make StarTrek run...

    Can you please tell me exactly what options I should pick for XMM Utilities and the project to run on regular C3 with HighRes_VGA output?

    I think I've tried every way I can think of and I still get that error like before. I think you decided it was using too many cogs.
    But, isn't that all fixed now that the clock is part of the SD?
  • RaymanRayman Posts: 15,000
    edited 2011-10-08 11:56
    Never mind. Figured out that I need to select "flash loader".
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-08 16:44
    Expect to start on Catalina 3.3 Beta next week sometime. I have my new pcbs back (commercial so cannot talk about them, but my first RamBlade3 on it where Catalina will run). Guess I/we may have a few questions shortly. The new features in 3.x to integrate PASM and SPIN objects will be fantastic. Keep up the great work Ross!
  • RaymanRayman Posts: 15,000
    edited 2011-10-08 19:44
    Ross, I finally figured out what PropTerminal is...
    It's actually a nice utility, but the problem I have is that it is only 40 column display...
    Star Trek (and I think a lot of things) need an 80 column display....

    Also, I tried "PC" with Parallax's "Propeller Serial Terminal". But, that doesn't work very well either...
    It seems the line feed doesnt' work exactly right.

    What terminal emulator is "PC" designed for?
    Any chance of modifying it to work with "Propeller Serial Terminal" (especially now that Windows doesn't include a Terminal Emulator).

    It appears that Prop Terminal is outside your domain, so I suppose you can't ask them for an 80-column version...

    PS: I hope I don't sound too critical.... I think Catalina is absolutely great, and I am very thankful that you've included FlashPoint support...
    There's just a lot of moving parts here to get a handle on...
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-08 23:30
    It seems the line feed doesnt' work exactly right.

    rayman, yes I agree and I have not used prop terminal much either because of the line feed problem. But there are many other free terminal programs around that can do 80 columns. Is that what you are looking for?
  • RossHRossH Posts: 5,550
    edited 2011-10-09 02:18
    Dr_Acula wrote: »
    rayman, yes I agree and I have not used prop terminal much either because of the line feed problem. But there are many other free terminal programs around that can do 80 columns. Is that what you are looking for?
    Rayman wrote: »
    Ross, I finally figured out what PropTerminal is...
    It's actually a nice utility, but the problem I have is that it is only 40 column display...
    Star Trek (and I think a lot of things) need an 80 column display....

    Also, I tried "PC" with Parallax's "Propeller Serial Terminal". But, that doesn't work very well either...
    It seems the line feed doesnt' work exactly right.

    You really need to know a little about serial terminals to get this working correctly. While they are both great programs for their intended purposes, neither PropTerminal nor the Parallax Serial Terminal are very good as general-purpose terminal emulators - they are "Windows-only" programs, and cannot simulate the type of serial terminal expected by programs from other environments.

    To get the best out of Catalina, you really need to use a proper terminal emulation program like "putty" (google it - it's free) .

    Also (without trying to start an argument about which is correct, even though the answer is blindingly obvious :smile:) you need to understand whether the program you are trying to execute comes from a Unix environment (where LF is the line terminator) or from a Windows environment (where CRLF is the line terminator).

    PST does have a few options you can try tweaking, and PropTerminal has a "normal terminal" mode (on the options menu) that you can select to get something approximating correct line termination behaviour. PropTerminal also has an 80 column mode - this must be specified in an "ini" file. Copy the following to a file called something like propterminal_80x25.ini and then select it as the settings file from within PropTerminal:
    /* PropTerminal Settings v0.1 */'
    [Config]
    ComNr=3
    FT232R=0
    BinPath=
    AutoDis=1
    VKeys=0
    TxtCurs=0
    MsMoveOff=0
    BaudRate=0
    Rows=25
    Cols=80
    Autoload=
    [Colors]
    pal_0=#FFFFFF
    pal_1=#FFFF00
    pal_2=#020FC0
    pal_3=#FF00FF
    pal_4=#FF0000
    pal_5=#00FF00
    pal_6=#00FFFF
    pal_7=#C0C0C0
    
    If you use PropTerminal or PST, and are still having trouble with line feeds and the like, try setting one or both of the following Catalina options (described on or about page 25 of the Catalina Reference Manual):
    • CR_ON_LF Translate CR to CR LF on output
    • NO_CR_TO_LF Disable translation of CR to LF on input
    For instance you might try:
    catalina othello.c -lc -D PC -D CR_ON_LF
    
    I'm sorry if this seems complicated - it is.

    Ross.
  • RossHRossH Posts: 5,550
    edited 2011-10-09 05:49
    All,

    The non-beta version of Catalina 3.3 has been released. See here.

    Ross.
Sign In or Register to comment.