Shop OBEX P1 Docs P2 Docs Learn Events
Catalina - ANSI C for the Propeller 1 & 2 - Page 15 — Parallax Forums

Catalina - ANSI C for the Propeller 1 & 2

191011121315»

Comments

  • RossHRossH Posts: 5,406

    Just a couple of notes on using the 2-port and 8-port serial plugins in Propeller 2 XMM programs.

    1. The default pins for the second serial port are 52 & 50. However, these defaults WILL conflict with the pins used for PSRAM on the P2-EC32MB, and MAY conflict with the pins used for the HyperFlash/HyperRAM add-on board on other P2 EVAL or P2 EDGE boards. To use these plugins in an XMM program, change the pins to something else in the relevant Platform configuration file (e.g. P2_EDGE.inc or P2_EVAL.inc). Set both the tx and rx pins to -1 to disable the second port altogether.
    2. Apparently, the 2-port serial plugin works in both XMM SMALL and LARGE programs, but the 8-port serial plugin only works in XMM SMALL programs (and in non-XMM programs, of course). I have confirmed this, but it looks like it needs more than a simple configuration change, so I will need to investigate further and fix it in a future release.

    Ross.

  • RossHRossH Posts: 5,406

    Another d'oh! moment ...

    Unlike the 2 port serial plugin, the 8 port auto-initialize process (which automatically opens any ports defined in the platform configuration file) uses static data buffers, not local data buffers. In a SMALL XMM program, all data (static or local) is in Hub RAM so everything works, but in a LARGE XMM program, static data is in XMM RAM not Hub RAM, and this is out of reach of the plugin.

    A simple workaround is to manually close any auto-initialized ports (or disable the auto-initialize functionality in the relevant Platform file by setting the tx and rx pins to -1) and open them manually using local data buffers.

    I thought it must be something like this, but my d'oh moment was that the program I used to try and test it (demos/test_serial8_2.c) closes the auto-initialized ports, but then re-opens them using more static data buffers :(

    I will fix both the auto-initialize functionality and the test program in the next release.

    Ross.

  • RossHRossH Posts: 5,406

    Catalina 7.6.2 has been released here.

    No major new functionality, just fixes for a few more issues. It is a full release because it requires a rebuild of all the C libraries.

    Here is the relevant extract of the README.TXT file:

    RELEASE 7.6.2
    
    New Functionality
    -----------------
    
    1. Two new catapult multi-model demo programs have been added, which
       demonstrate a threaded secondary program being executed from an XMM 
       primary program (which would not support multi-threading if it was 
       compiled as a simple XMM program). See demos\catapult\thread_p1.c and 
       demos\catapult\thread_p2.c - note that the 'build_utilities' script
       must be used to build an XMM loader suitable to load them.
    
    2. The default pins used for the second serial port when the 2 port or 8 
       port serial plugins were in use (pins 50 & 52) conflicted with the pins 
       used for the PSRAM on the P2-EC32MB, and may conflict with the pins 
       used for the HyperFlash/HyperRAM add-on board, which made these plugins 
       unusable in XMM programs. The second port has now been disabled by 
       default by setting the tx and rx pins to -1 on all P2 platforms.
    
    Other Changes
    -------------
    
    1. Fixed a problem with Catapult when a secondary program required threads
       - e.g. the secondary pragma included "options(-lthreads)" - but the 
       primary program did not - the secondary program was being compiled to use 
       the threads library but was being started using the non-threaded kernel
       and thus would not execute correctly. Affected the Propeller 1 and 
       Propeller 2 under Windows and Linux.
    
    2. Fixed a bug in the XMM dynamic kernel, which broke the start.c program in
       the demos\p2_psram folder, which needs to load the XMM kernel dynamically.
       This was the only program that uses that particular version of the kernel. 
       Also, the Makefile referred to the target directory using a relative 
       reference, which only worked if the programs were built in the installed 
       source tree. Affected the Propeller 2 only under Windows and Linux.
    
    3. The 8 port serial plugin "autoinitialize" functionality, which opens any
       ports defined in the relevant platform file (e.g. P2EDGE.inc, P2EVAL.inc 
       etc) was allocating buffers using static data, not local data. This meant 
       that the plugin would not work an XMM LARGE program (it worked in all 
       other memory models, including XMM SMALL programs). Affected the Propeller
       2 only under Windows, Linux and Catalyst.
    
    4. The 8 port serial plugin test program (demos/test_serial8_2.c) was opening
       ports using static data buffers instead of local buffers, and so it would
       not work in XMM LARGE mode (it worked in all other memory models, including 
       XMM SMALL programs). Now it uses local buffers and works in all modes. Also, 
       the default pin numbers for the second port are now 18 (tx) and 20 (rx).
       Affected the Propeller 2 only under Windows, Linux and Catalyst.
    
Sign In or Register to comment.