nauart: FIM UART Driver Example Application

Supported platforms
===================
This test can run on the ConnectCore 9P 9215, ConnectCore Wi-9P 9215,
Digi Connect ME 9210 development boards.

Running this sample application requires external hardware to interconnect to 
your Digi JumpStart Kit Development board.  This readme provides instructions 
based on the Digi FIM Application Kit (Digi P/N DG-ACC-FIM).

Please note it is not mandatory to use the FIM Application kit to successfully 
run this application; prototype hardware can be built up in its place.  
However, the FIM Application Kit provides a standard reference design platform 
with all the hardware components and accessory items necessary for immediate 
prototyping of NET+OS applications with FIM-based I/O capabilities.

Complete documentation and schematics for the FIM Application Kit are available 
in the "Application Kit" section on the Digi technical support website 
at www.digi.com/support.

Please also visit the www.digiembedded.com  for additional information and purchase options.


Connecting and configuring your FIM Application Kit board
-----------------------------------------------------------------------

The application requires FIM0 to be configured as /com/4 and connected to 
the UART_0 section of the FIM Application board.  

Please refer to the FIM Application Kit Quick Start Guide and the Hardware Reference
Manual (HRM) for guidance on how connect and configure your FIM Application Kit board.

What it does
-------------
a) The application can perform a loopback test on a single serial 
   port if the port is wired for loopback as follows:
   
PORT1TX -->--|
             |
PORT1RX --<--|

PORT1RTS -->--|
              |
PORT1CTS --<--|


b) The application can perform a loopback test between two serial
   ports if they are connected to each other as follows:
   
PORT1TX -->-- PORT2RX -->--|
                           |
PORT1RX --<-- PORT2TX --<--|

PORT1RTS -->-- PORT2CTS -->--|
                             |
PORT1CTS --<-- PORT2RTS --<--|

c) The test can be configured for different baud rates and flow control
   options.

d) You can edit the test to have it check parity and stop bits.

e) 200K of data is transfered for the test.

f) An error message is printed if data corruption is detected, or if
   there is some other error transmitting or receiving.

g) The test repeats indefinitely

h) Test also starts FTP server to allow the firmware in flash to be 
   updated.


Procedure
---------


Connectcore9p9215_a/Connectcorewi9p9215_a Jump Start Kit
--------------------------------------------------------
This application uses 4-lines UART configuration.

For FIM0:

1. To use FIM0 UART port RS232_0 "com/4", make sure TX_PORT_NAME is set to "com/4" in root.c.
   Application then uses FIM0 UART port RS232_0 "com/4" as test PORT1 and "com/1" as test PORT2.

   Since we need "com/1", make sure serial CLI is disabled in bsp_cli.h
   #define BSP_CLI_SERIAL_ENABLE   FALSE
       
2. In gpio.h make sure 
   BSP_GPIO_MUX_IOP_0_GEN_IO_0 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH
   BSP_GPIO_MUX_IOP_0_GEN_IO_1 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH
   BSP_GPIO_MUX_IOP_0_GEN_IO_2 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH
   BSP_GPIO_MUX_IOP_0_GEN_IO_3 is set to BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH

   These will configure the GPIO Pins for FIM0 UART.

3. In bsp_iop.h, make sure 
    BSP_IOP_FIM0_UART_TXD is set to BSP_IOP_GEN_IO_0
    BSP_IOP_FIM0_UART_RXD is set to BSP_IOP_GEN_IO_1
    BSP_IOP_FIM0_UART_RTS is set to BSP_IOP_GEN_IO_2
    BSP_IOP_FIM0_UART_CTS is set to BSP_IOP_GEN_IO_3

For FIM1:

1. To use FIM1 UART port RS232_1 "com/5", make sure TX_PORT_NAME is set to "com/5" in root.c.
   Application then uses FIM1 UART port RS232_1 "com/5" as test PORT1 and "com/1" as test PORT2

   Since we need "com/1", make sure serial CLI is disabled in bsp_cli.h
   #define BSP_CLI_SERIAL_ENABLE   FALSE
       
2. In gpio.h make sure 
   BSP_GPIO_MUX_IOP_1_GEN_IO_4 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH
   BSP_GPIO_MUX_IOP_1_GEN_IO_5 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH
   BSP_GPIO_MUX_IOP_1_GEN_IO_6 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH
   BSP_GPIO_MUX_IOP_1_GEN_IO_7 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH

   These will configure the GPIO Pins for FIM1 UART.

3. In bsp_iop.h, make sure 
    BSP_IOP_FIM1_UART_TXD is set to BSP_IOP_GEN_IO_4
    BSP_IOP_FIM1_UART_RXD is set to BSP_IOP_GEN_IO_5
    BSP_IOP_FIM1_UART_RTS is set to BSP_IOP_GEN_IO_6
    BSP_IOP_FIM1_UART_CTS is set to BSP_IOP_GEN_IO_7

Connectme9210 development board
-------------------------------
This application only uses 2-lines UART configuration.

1. Application uses FIM0 UART Port RS232_0 "com/4" as test PORT1 and "com/0" as test PORT2
   Connectme9210 supports only FIM0 for UART.

2. Make sure use "/com/2" for dialog and stdio output.
   In bsp_sys.h configure dialog and stdio to use "com/2" by setting
   BSP_STDIO_PORT to "/com/2" and 
   BSP_DIALOG_PORT to "/com/2"

3. In gpio.h make sure 
   BSP_GPIO_MUX_SERIAL_A is set to BSP_GPIO_MUX_SERIAL_2_WIRE_UART
   BSP_GPIO_MUX_IOP_0_GEN_IO_1 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH
   BSP_GPIO_MUX_IOP_0_GEN_IO_2 is set to BSP_GPIO_MUX_USE_PRIMARY_PATH

   These will configured the GPIO Pins for FIM0 UART.

4. Make sure the IO2 and IO3 are selected on SW3 switch on the Digi Connect ME 9210 development board.

5. Make sure P5 jumper on the Connectme9210 development board is set to enable RS232.

The application uses the following files located in the
netos\src\linkerScripts directory.  These files are generated
when the BSP is built.

bootldr.dat     bootloader configuration file used to generate the
                file image.bin.  It controls the information placed
                in the bootloader header of the image.

image.ldr       GNU linker script used to build an image that can
                be debugged and used with the bootloader.
                
customize.ldr   Customizable GNU linker script

   


