===== Building System Controller Firmware for @stk_name@ and Intergation into the BSP ===== ==== Prerequisites ==== * BSP revison @bsp_version@ built according to [[@lang@:@mod_arch@:@mod_name@:@bsp_name@:@build_system@:quickstart_yocto| quickstart guide]] * Request [[Support@tq-group.com?subject=[SCFW Patch Series] | SCFW Patch Series]] from TQ Support. Please specifiy the BSP Revision in the request. ==== Setup Development Host ==== === Install additional Packages === The tools cppcheck and srec_cat must be installed on the development host to build the System Controller Firmware, on a Ubuntu host they can be installed with the following command: sudo apt-get install srecord cppcheck === Download and Install GNU ARM Toolchain === Download the [[@gnu_arm_toolchain_link@|GNU Arm Embedded Toolchain @gnu_arm_toolchain_ver@]] cd ~/Downloads wget @gnu_arm_toolchain_link@ sudo tar xvjf @gnu_arm_toolchain_archive@ -C /opt === SCFW Patch Series === In this guide the SCFW patch series provided from TQ is stored in the current users **Download** folder. One can choose any other location in the home directory. ==== Download and Install SCFW Porting Kit ==== The SCFW porting kit download requires the registration on the NXP website, afterwards it can be downloaded from the link below: [[@scfw_porting_kit_dl_link@]] Create a new folder for the SCFW porting kit e.g. in the home directory mkdir -p ~/workspace/scfw Extract the SCFW porting kit archive to the folder created above. cd ~/Downloads tar xvzf @scfw_porting_kit_archive@ -C ~/workspace/scfw/ Navigate to folder "packages" in the scfw directory and make the SCFW proting kit binary executable. Start the SCFW Porting Kit afterwards and read/accept the NXP EULA. cd ~/workspace/scfw/packages chmod +x imx-scfw-porting-kit-@scfw_ver@.bin ./imx-scfw-porting-kit-@scfw_ver@.bin Navigate to subfolder src/ in the new created folder imx-scfw-porting-kit-@scfw_ver@ and extract the source archives cd imx-scfw-porting-kit-@scfw_ver@/src/ for FILE in *.tar.gz ; do tar xvzf $FILE; done Move back to root folder imx-scfw-porting-kit-@scfw_ver@ and initialize the SCFW porting kit as git repository. cd .. git init Add all files to the git repository created before and create an inital commit git add . git commit -m "initial commit" Check the git repository status: git status An output on the shell that the working tree is clean should appear and look like something below: On branch master nothing to commit, working tree clean Extract porting-kit patch archive into your scfw root directory: e.g. tar xvzf ~/Downloads/@imx_scfw_patch_series_name@.tar.gz -C ~/workspace/scfw/ Create **patches** variable for current shell session, e.g.: patches=$(cat ~/workspace/scfw/@imx_scfw_patch_series_name@/series) Patch scfw firmware repository: for p in ${patches}; do git am ~/workspace/scfw/@imx_scfw_patch_series_name@/${p}; done Create a new git tag with reference to the tq revision of the scu firmware, e.g.: git tag -a @scfw_local_git_tag@-local Build the scfw firmware using one of the following commands: ^ Build Command ^ Description ^ | make -f Makefile.release | Disables monitor, debug and sets TEST=NONE | | make -f Makefile.debug | Enables monitor, debug and sets DEBUG_LEVEL=3, TEST=all | | make -f Makefile.monitor | Enables monitor, debug and sets DEBUG_LEVEL=1, TEST=NONE | | make -f Makefile.test | Disables monitor, enables debug and sets DEBUG_LEVEL=3, allows overwrite TEST from environment | Copy the SCU firmware archive into the following folder in the build directory .../ci-meta-tq/sources/meta-tq/meta-tq/recipes-bsp/imx-sc-firmware/imx-sc-firmware-tq e.g. cp ~/workspace/scfw/packages/imx-scfw-porting-kit-@scfw_ver@/@scfw_local_git_tag@-local.tar.gz ~/workspace/@bsp_git_tag@.@bsp_version@/ci-meta-tq/sources/meta-tq/meta-tq/recipes-bsp/imx-sc-firmware/imx-sc-firmware-tq Customize the **SC_FIRMWARE_VERSION_TQ** variable in the recipe file .../ci-meta-tq/sources/meta-tq/meta-tq/recipes-bsp/imx-sc-firmware/imx-sc-firmware_1.3.1.bbappend to match the SCU firmware archive naming: SC_FIRMWARE_VERSION_TQ ?= "@scfw_local_git_tag@-local"