naspi_master_ns9750: SPI Master Driver API Example Application

This application shows how to use the simple SPI Master Driver API 
with the supported GPIO ports.

NOTE:

This example ONLY works on ns9750_a platform.
It will not work on any other development boards.


The "naspi_master" application is a single thread application that tests 
serial EEPROM block write support and write / read reliability.  The test 
performs the following:

1) Register the SPI device using NASpiRegisterDevice()
2) Using NASpiReadWrite() to perform the following functionalities in step 3),
   4), 5), 6) and 7).
3) Sets a write protection level.
4) Writes data to the EEPROM, then reads data back and compares write and 
   read data.  Printf() messages of the test status are sent out the serial
   port.
5) Repeats 3) and 4) for all the write protection levels supported.  This 
   part of the application tests serial EEPROM write protection support.
6) Disables write protection.
7) Writes data to the EEPROM, then reads data back and compares write and read
   data.  Printf() messages of the test status are sent out the serial port.
   This part of the application tests serial EEPROM write / read reliability.
8) Deregister the SPI device using NASpiDeregisterDevice()

This application requires only one modification.  In root.c, user can modify
the device configuration structure "NASpiDeviceConfigType NS_SEEPROM" accoding 
to user's actual SPI EEPROM device.

The GPIO I/O lines used for the _CS, SCLK, SI and SO signals must match the 
actual physical connections, and  SCLK, SI and SO signals must be connected 
with the default pins on NS9750 SPI port B.

Extended period testing can be accomplished by increasing the "NUMBER_OF_TESTS"
constant (in root.c) to a larger number from the default value of 1.  Note that
the serial EEPROM has a one million write cycle limit.

The maximum write byte size can be adjusted by changing the "MAX_WRITE_SIZE"
constant.  The C library rand() function is used to generate the write byte 
sizes with a maximum value up to the lesser of 32767 or MAX_WRITE_SIZE.


BSP Setup

	1. BSP_SERIAL_PORT_2 must be defined as BSP_SERIAL_SPI_DRIVER in bsp_serial.h.

	2. BSP_GPIO_MUX_SERIAL_B must be defined as BSP_GPIO_MUX_SERIAL_SPI_APP 
	   in gpio.h

    3. Set NASPI_MAX_DESCRIPTORS to be 10 so you can read 128k byte data using
	   one call.

	4. Recompile the BSP library, sflash library and application.

Development Board Setup

	Make sure the SEEPROM part is connected to NS9750 default SPI port B.

Refer to the NS9750 hardware manual for more information about GPIO ports.	
Refer to the Atmel AT25P1024 SEEPROM specifications for details.


One GNU make file is provided.  Build the target 'image' to
generate an image that can be debugged with gdb, and the file 
image.bin which can be written to flash if the bootloader is used.
Build the target 'rom.bin' to create the file rom.bin which 
can be written to ROM if the bootloader is not used.

The following files are provided in this template.

appconf.h         sets application configuration settings
makefile          Make file for the GNU toolset.
readme            this file
root.c            contains the applicationStart() function that starts
                  a series of tests

In addition, the following files in the BSP directory are built
as part of this application.

reset.s         contains the reset code
appconf_api.c   contains code used to read settings in appconf.h


The application build file links in the following libraries.

libbsp.a           		contains the BSP code
libtcpip.a         		contains the Net+Works TCP/IP stack
libtx.a            		contains the ThreadX kernel
libposix.a         		contains the POSIX layer libraries
libflash.a         		contains the Flash driver API library
libtelnsvr.a       		contains the Telnet server library
libaddp.a		   		contains the ADDP Library
libssh.a		   		contains the SSH Library
libpppintf.a			contains the PPP Interface Library
libdnsclnt.a        	contains the DNS Client library

The application uses the following files located in the
netos\src\linkerScripts directory.

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
