Search by Tags

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

 

Article updated at 11 Dec 2020
Compare with Revision




Subscribe for this article updates

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

Pre-built System Controller Firmware (SCFW)

You can find the pre-built binaries for Toradex SoMs on our GitHub project i.MX-System-Controller-Firmware:

The scfw_tcm.bin is an older file that you can disregard. We have switched to using a less generic name as mx8qm-apalis-scfw-tcm.bin for Apalis iMX8, mx8qx-apalis-scfw-tcm.bin for Apalis iMX8X, and mx8qx-colibri-scfw-tcm.bin for Colibri iMX8X to make it easier to distinguish which binary is meant for each SoM.

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

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

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

Then, extract the top-level SCFWKIT package:

tar xf imx-scfw-porting-kit-1.3.2.tar.gz

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

cd packages/
chmod +x imx-scfw-porting-kit-1.3.2.bin
./imx-scfw-porting-kit-1.3.2.bin

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

cd imx-scfw-porting-kit-1.3.2/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:

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.

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

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

cp -r i.MX-System-Controller-Firmware/src/scfw_export_mx8qm_b0/* scfw_export_mx8qm_b0/

Or for Colibri iMX8X:

cp -r i.MX-System-Controller-Firmware/src/scfw_export_mx8qx_b0/* scfw_export_mx8qx_b0/

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

cd scfw_export_mx8qm_b0/

Or for Colibri iMX8X:

cd 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