Porting Nano-RK

Image(many-fish.jpg,200)

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.

The /include/platform.mk file takes the PLATFORM_TYPE parameter set in a project's local make file and then sets:
  • MCU
  • RADIO
  • PROG_TYPE
    These are used in the common makefile to switch to the correct directories for architecture specific files.
The hal file can be found in: /src/kernel/hal/$(MCU) and consist of:
  • nrk_status.c
    • 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.
  • nrk_timer.c
    • This is where any Nano-RK timer functions need to be changed
  • $(mcu)_hw_specific.S
    • This file containts the assembly context swap

Add the correct switches into the /includes/common.mk to select the correct platform directories as well as the correct hw_specific.S file.

many-fish.jpg (28.7 kB) Anthony Rowe, 03/08/2007 05:32 pm