Mistake on this page? Email us

Add new port to pal-platform

Adding a new port to pal-platform includes two main steps:

  • Adding toolchain configurations.
  • Adding CMake files to the platform components.

Adding port to pal-platform script

To add a new port to the Python script, update the pal-platform json file by filling in the target name and components.

For the full build option, you need to update the toolchain lookup table function checkToolchainEnv() in the pal-platform.py file.

Adding toolchain configurations

To add a new toolchain, you need to create a new folder with the following two files:

  • Toolchain: a file with basic configurations for the toolchain. See the GCC file.
  • Flags file: a file that contains all the compilation flags for this specific toolchain. See the GCC flags file.

Note:
You need to set the value of TOOLCHAIN_FLAGS_FILE inside the toolchain file to the toolchain flags file. See the example in the GCC file.
The flags file must contain an include to include_file.txt file for the ADD_GLOBALDIR CMake macro to work. See the example in the GCC flags file.

Adding CMake files to platform

Every component added to pal-platform should have its own CMake file. It does not matter if this is an SDK, device or middleware.