===============================================================================
                         uC/OS-II, The Real-Time Kernel

                         Hitachi SH3 Port Version: 1.0

                                  Read Me File

                         Kuan, Yeou-Fuh   July 6th 1999
===============================================================================

INSTALLATION:

    The files for the SH3 port of UCOS-II should be placed in the UCOS-II
    'SOFTWARE' directory.
    To install the files create a directory called 'SH3' in the '\SOFTWARE\UCOS-II\' path,
    then unzip 'SH3-SHC01.ZIP' file in the 'SH3' subdirectory.
    The zipped file will then create subdirectories 'SHC\SOURCE\' and 'SHC\TEST'.
    The overall directory structure should then be:

    \SOFTWARE\UCOS-II\SH3\SHC\SOURCE\
    \SOFTWARE\UCOS-II\SH3\SHC\TEST\

############################################################################################

SH3 PORT NOTES:

1.  The 'SOURCE' directory contains the SH3 specific files:
    'OS_CFG.H'
    'OS_CPU.H'
    'OS_CPU_A.SRC'
    'OS_CPU_C.C'

2.  The 'TEST' directory contains files and a simple demonstration program 'TEST0.C'
    using the kernel. 'TEST0.C' creates a start task. The start task then create
    10 tasks. Start task will output 'S' to RS232 port. The 10 tasks output '0', '1',
    ..., '9' respectively.

3.  The current version of the Hitachi SH3 port is based on:

    Hitachi SH SERIES C COMPILER                     Ver. 3.0F
    Hitachi SH SERIES ASSEMBLER                      Ver. 3.3
    Hitachi H  SERIES LINKAGE EDITOR                 Ver. 5.3
    Hitachi H  SERIES SYSROF STYPE OBJECT CONVERTER  Ver. 1.5
    Hitachi H  SERIES OBJECT LIBRARIAN               Ver. 1.4

4.  In the 'TEST' subdirectory, there is a 'SETENV.BAT' to setup
    environment variables which is need by each Hitachi tools.
    You may need to modify it to match your Hitachi tools directory.

5.  There are two makefiles in 'TEST' subdirectory (kernel.mak and ap.mak).
    I use Microsoft make utility V1.62 (nmake.exe) to build uCOS2 library and
    application.

    Type the following command line to build uCOS2 OS library:
       nmake kernel.mak
    It creates 'KERNEL.LIB' in 'TEST' Directory.

    Type the following command line to build application:
       nmake ap.mak
    It links 'KERNEL.LIB' and creates 'AP.MOT'.

    The file 'AP.MOT' is in Motorola S-Record format which can be loaded into the
    ROM Emulator.

    The ROM code (AP.MOT) is downloaded to ROM Emulator. After system reset,
    the application start running and output message to terminal by RS232 port.

    You can use HyperTerminal program provided by Windows 95 and set the COM port
    to 19200 bps N-8-1 to receive message from target.

6.  The target platform I use to test my port has the following components:     Hitachi's
    1)  SH7709 CPU.
    2)  HD64461F companion chip.
    3)  512K ROM.
    4)  16M SDRAM.
    5)  16M Flash Memory.
    6)  One PCMCIA Socket.
    7)  Smart Card Socket.
    8)  SAM (Secure Application Module) Socket. (same as SIM Card Socket)
    9)  320 * 240 Mono LCD display
    10) Touch Pannel.
    11) RS232 Port.
    12) 8 * 7 Keyboard Matrix.
    13) 33.6K Modem Module.
    14) Telephone Circuit.

    But for this port, I just use timer 0 module in CPU to generate OS tick interrupt
    and RS232 port for debugging.

7.  The interrupt architecture is not same as SH1 and SH2. When exception occurs,
    CPU jumps to offset 0x00000100 from VBR. When interrupt occurs, CPU jumps to
    offset 0x00000600 from VBR. In exception handler, you use EXPEVT register to
    judge which real excpetion occurs. In interrupt handler, you use INTEVT and
    INTEVT2 registers to judge which real interrupt occurs.

    The flow of context switch is as following:

     OS_TASK_SW ()    is #defined to the compiler intrinsic function 'trapa(UCOS)'.
          |
          v
        GE ()         is defined in GE.SRC to store all CPU registers into stack.
          |           and then call GEHandler().
          v
      GEHandler ()    is defined in GEHDL.C to judge which real exception occurs.
          |
          v
       OSCtxSw ()     is defined in OS_CPU_A.SRC to do context switch.


    The flow of OS Tick interrupt is as following:

     TICK Interrupt   CPU Timer 0 interrupt. (see HWTIMER.C)
          |
          v
        INTJ ()       is defined in INTJ.SRC to store all CPU registers int stack.
          |           and then call INTJHandler().
          v
     INTJHandler ()   is defined in INTJHDL.C to judge which real interrupt occurs.
          |
          v
      OSTickISR ()    is defined in TICKISR.C

8.  Note that only the port is provided and it is assumed that you have the rest
    of the source for uC/OS-II from the book.

############################################################################################

CONTACT DETAILS:

This port is provided as is and without guarantee.  Although this port has been tested there
is no warranty implied of any kind.

If you have any questions about this port, You can contact me via Email at:

kuan@ms.chttl.com.tw or amandahu@ms6.hinet.net

I will try to help.  If you find this port useful then send me an email and let me know.

############################################################################################

ACKNOWLEDGEMENTS:

1. MicroC/OS-II The Real-Time Kernal - Jean J. Labrosse, R&D Books, 1999, ISBN 0-87930-543-6
2. UCOS port for the SH2 - Ian Hall (Available from www.ucos-ii.com).

############################################################################################

HITACHI SH3 PORT RELEASE NOTE:

July 6th 1999
--------------

1.  First release of the SH3 port.

