				Product bare metal software library
				===================================
			    Supporting GCC with C and C++ based on newlib
				
-----------------------------------------------------------------------------------------

Package release version: 	1.0
Date: 				March 7, 2012
License: 			GPL v2 or later

Copyright (c) AAC Microtec AB 2012. 

Author(s): 	Fredrik Bruhn, 	fredrik.bruhn@aacmicrotec.com
		Magnus Norgren, magnus.norgren@aacmicrotec.com
		Dan Ohlsson, 	dan.ohlsson@aacmicrotec.com

		http://www.aacmicrotec.com	- Main company website
		http://wiki.aacmicrotec.com	- Product support WIKI
		http://pnp.aacmicrotec.com	- Development community

-----------------------------------------------------------------------------------------

The purpose of this source code is to demonstrate simple sw-project examples for
AAC certified OpenRISC and OpenRISC Fault Tolerant™ compatible processors. This source
tree also provides a starting point for development on AAC product line including the
OBC lite™, RTU lite™ and µRTU™ series of products.

This reference source tree is regularaly updated and maintained by AAC Microtec and 
regular updates are provided as part of the product package.

Please visit <http://wiki.aacmicrotec.com> for product specific support, frequently asked
questions (FAQ), and software updates.

README

This README.

-----------------------------------------------------------------------------------------

				  Software description
				-------------------------

drivers/
	Example driver-API for some of the peripherals in AAC products
	
examples/
	Example projects for demonstration of toolchain use.
	
sw-project-skel/
	Skeleton project folder for new project.
	Remember to update and complete the Makefile before compilation.


					Building
				       ----------

Each program can be built separately in its own folder using the supplied Makefile.

Usage. make clean; make BOARD=<product>

	Where <product> is defined from these default options, 
	<product> = {
	obc-lite-521
	obc-lite-522
	rtu-lite-511
	rtu-lite-512
	urtu-311
	urtu-312
	}

Alternatively the user can compile programs directly from command line using this command
for C

$ or32-aac-elf-gcc -Wall -O2 -mboard=<product> main.c -o myprog

and this for C++

$ or32-aac-elf-g++ -Wall -O2 -mboard=<product> main.cpp -o myprog


				Define a new board definition
                     	       -------------------------------

If you are developing for a tweaked board or want to explore a new possible design
you may have to add a new <product/board> definition to the toolchain/newlib.

Make a new .S definition file <newboard.S> from the provided examples in the 
board_defines directory.

$ or32-aac-elf-gcc -c newboard.S

copy newboard.o to bare metal toolchain directory:

$cp newboard.o /opt/aac-ria/gcc-bare/or32-aac-elf/lib/boards/

compile with this makefile or directly with

$ or32-aac-elf-gcc -mboard=newboard main.c -o myprog


			 Simulation with architectural simulator
			-----------------------------------------
AAC provides an architectural simulator as part of the toolchain (or1ksim) in which
the customers can test their designs.

launch the simulator using the following command:

$ sim -f /opt/aac-ria/or1ksim/configuration_scripts/<board>.cfg myprog

where <board> can be selected from the following options:

<board> = {
obc-lite-52X
rtu-lite-51X
urt-31X
}

					Cleaning
				       ----------

Perform the following command in the software directory of target to remove previous
files.

$ make clean 


