Version 9 (Anthony Rowe, 03/08/2007 07:50 pm)

1 1 Anthony Rowe
2 1 Anthony Rowe
3 9 Anthony Rowe
h1. Porting Nano-RK
4 9 Anthony Rowe
5 9 Anthony Rowe
6 1 Anthony Rowe
7 1 Anthony Rowe
8 9 Anthony Rowe
Porting Nano-RK to other platforms should be relatively simple.  Most architecture specific files are in seperate _platform_ or _hal_ directories.  When moving to a different processor, first focus on porting the hal files.  The platform directories deal with different configurations that exist even if two platforms use the same processor.  For instance, one board might use UART0 by default, the other might use UART1.  GPIO pin layout as well as radios will likely be different across platforms.
9 4 Anthony Rowe
10 1 Anthony Rowe
The /include/platform.mk file takes the PLATFORM_TYPE parameter set in a project's local make file and then sets:
11 9 Anthony Rowe
12 9 Anthony Rowe
13 9 Anthony Rowe
14 4 Anthony Rowe
These are used in the common makefile to switch to the correct directories for architecture specific files.
15 4 Anthony Rowe
16 4 Anthony Rowe
The hal file can be found in: /src/kernel/hal/$(MCU) and consist of:
17 9 Anthony Rowe
* nrk_status.c
18 9 Anthony Rowe
** The status file checks the state of the hardware at startup to catch an unexpected restart.  This uses processor specific information about the default cpu state.
19 9 Anthony Rowe
* nrk_timer.c
20 9 Anthony Rowe
** This is where any Nano-RK timer functions need to be changed
21 9 Anthony Rowe
* $(mcu)_hw_specific.S
22 9 Anthony Rowe
** This file containts the assembly context swap
23 4 Anthony Rowe
24 4 Anthony Rowe
Add the correct switches into the /includes/common.mk to select the correct platform directories as well as the correct hw_specific.S file.