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:
These are used in the common makefile to switch to the correct directories for architecture specific files.
- 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.
- This is where any Nano-RK timer functions need to be changed
- 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.