Porting

Version 4 (Anthony Rowe, 03/08/2007 05:45 pm)

1 1 Anthony Rowe
2 1 Anthony Rowe
= Porting Nano-RK =
3 2 Anthony Rowe
4 2 Anthony Rowe
[[Image(many-fish.jpg,200)]]
5 3 Anthony Rowe
6 3 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 will likely be different across platforms.
7 4 Anthony Rowe
8 4 Anthony Rowe
The /include/platform.mk file takes the PLATFORM_TYPE parameter set in a project's local make file and then sets:
9 4 Anthony Rowe
 * MCU
10 4 Anthony Rowe
 * RADIO
11 4 Anthony Rowe
 * PROG_TYPE
12 4 Anthony Rowe
These are used in the common makefile to switch to the correct directories for architecture specific files.
13 4 Anthony Rowe
14 4 Anthony Rowe
The hal file can be found in: /src/kernel/hal/$(MCU) and consist of:
15 4 Anthony Rowe
 * nrk_status.c
16 4 Anthony Rowe
 * nrk_timer.c
17 4 Anthony Rowe
 * $(mcu)_hw_specific.S
18 4 Anthony Rowe
19 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.