Search by Tags

Build Custom i.MX 8/8X System Controller Firmware (SCFW)

 
Applicable for

Article updated at 03 Sep 2019
Subscribe for this article updates

Build Custom i.MX 8/8X System Controller Firmware (SCFW)

Warning: Toradex customers rarely need to rebuild SCFW. Please think carefully if you really need to rebuild it.

First, please download the SCFWKIT directly from NXP (requires a valid account):

https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/embedded-linux-for-i.mx-applications-processors:IMXLINUX?tab=Design_Tools_Tab

Note: At the time of this writing, the latest version is L4.14.98_2.0.1_SCFWKIT-1.2.2.

Then, extract the top-level SCFWKIT package:

$ tar xf imx-scfw-porting-kit-1.2.2.tar.gz

Now, cd into the packages folder and launch the .bin package extractor reading and accepting NXP's EULA:

$ cd packages/
$ ./imx-scfw-porting-kit-1.2.2.bin

This creates another folder imx-scfw-porting-kit, cd into it and its subsequent src folder:

$ cd imx-scfw-porting-kit/src/

Now, extract the desired porting kit (containing mostly binaries but also some sources), the i.MX 8QM one for Apalis iMX8:

$ tar xf scfw_export_mx8qm_b0.tar.gz

Or the i.MX 8QX one for Colibri iMX8X:

$ tar xf scfw_export_mx8qx_b0.tar.gz

Download/install a suitable toolchain e.g. gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 from:

https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

And setup various environment variable relevant for building:

$ export ARCH=arm
$ export CROSS_COMPILE=~/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-
$ export PATH=$PATH:~/gcc-arm-none-eabi-8-2019-q3-update/bin

Now, as the NXP parts are ready, get the Apalis iMX8 resp. Colibri iMX8X specific board source files:

https://github.com/toradex/i.MX-System-Controller-Firmware

And, deploy them to the relevant platform/board/ folder e.g. for Apalis iMX8:

scfw_export_mx8qm_b0/platform/board/mx8qm_apalis/

Or for Colibri iMX8X:

scfw_export_mx8qx_b0/platform/board/mx8qx_colibri/

Once that is done cd into the top-level src folder e.g. for Apalis iMX8:

packages/imx-scfw-porting-kit/src/scfw_export_mx8qm_b0

Or for Colibri iMX8X:

packages/imx-scfw-porting-kit/src/scfw_export_mx8qx_b0

And last but not least do a clean build e.g. for Apalis iMX8:

$ make clean;make SOC=MX8QM B=apalis DL=2 R=b0 U=0 V=0 qm

Note: U=2 above will select the SCU's tightly coupled UART aka SCU.UART0.RX/TX available on SCU UART test pin for debug output.

Or for Colibri iMX8X:

$ make clean;make SOC=MX8QX B=colibri DL=2 R=b0 U=0 V=0 qx

Note: U=2 above will select the SCU's tightly coupled UART aka SCU.UART0.RX/TX available on SODIMM pin 144/146 for debug output.

The final binary SCFW artefact will be called scfw_tcm.bin and for Apalis iMX8 can be found here:

scfw_export_mx8qm_b0/build_mx8qm_b0/scfw_tcm.bin

Or for Colibri iMX8X here:

scfw_export_mx8qx_b0/build_mx8qx_b0/scfw_tcm.bin

Next Steps / Additional Resources

Further documentation may be found inside NXP's extracted SCFWKIT at:

packages/imx-scfw-porting-kit/doc/pdf