5 .15 SDK Documentation - WinSystems/c444-manifest GitHub Wiki

SDK Documentation 5.15

Background

The SDK (Software Development Kit) is a bundle of tools, libraries, and drivers that support development and deployment of applications on the ITX-P-C444 product.

Yocto can build an SDK for the target platform, allowing developers to build and deploy applications, u-boot, and the kernel remotely. The SDK is built automatically with every image build (ex: fsl-image-validation-imx). Here are the steps for setting it up on a development machine.

Development Machine Requirements

8GB of memory minimum

315GB of Disk Space available

Ubuntu 22.04

Build and install SDK with Yocto / bitbake

  1. Build the toolchain in Yocto.
    bitbake winsys-image-demo -c populate_sdk
    This step will create a script file that can be run on any Linux machine to create the SDK.
    Note, this first step assumes that you already went through the BSP Build guide. If the bitbake command is not found; run the following command in your top directory.

Configure the build directory to target the c444.

MACHINE=imx8mq-itx-p-c444 DISTRO=c444-xwayland source winsys-setup-release.sh -b build

This command will only work if you have already pulled the project using the repo command.

  1. From the build directory in yocto, change directories to the sdk directory.
    cd tmp/deploy/sdk

  2. Run the file ending in .sh in the directory that was opened in the previous step.
    ./c444-xwayland-glibc-x86_64-winsys-image-demo-armv8a-imx8mq-itx-p-c444-toolchain-5.15-kirkstone.sh

    This script file can be run on any Linux machine to create a development machine for the C444.

  3. It will prompt for a directory to be installed to. By default it gets installed under /opt/.

  4. Once it has finished installing you can run the following to set up your environment.
    source /opt/c444-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux
    (Path may be different depending on the installation directory selected in step 4)

  5. After that run the following.
    unset LDFLAGS

From there you should be good to build for your target from your development machine. You will have to run steps 5 and 6 every time you open a new terminal to build the target. You can use tools like scp and ssh to transmit files over the network to your target and run commands.

Building Linux Kernel on a Development Machine

The kernel and device tree can be rebuilt using the SDK. The source can be cloned from the WinSystems GitHub like so:
git clone https://github.com/WinSystems/linux-imx.git -b 5.15.32

After it is done cloning, cd into the folder it pulls down. Here are some steps for building and modifying your own kernel.

To set up the configuration file for building a kernel.
make defconfig
From this point the drivers built can be modified by editing the .config file in this folder.

To build the kernel.
make Image -j[Number of threads]

To build the device tree.
make dtbs
The path to the device tree source is arch/arm64/boot/dts/freescale/imx8mq-itx-p-c444.dts. This file can be edited if configuration changes are desired.

To build kernel modules.
make modules

To copy all kernel modules to a folder.
export INSTALL_MOD_PATH=[insert path to destination folder for modules]
make modules_install

To copy the new kernel to a target (make sure target is on same network as build machine).
scp ./arch/arm64/boot/Image root@[ip of target]:/run/media/mmcblk0p1
May not be root if you set up a user account. Also may not be mmcblk0p1 if you aren’t booting from the eMMC.

To copy the new device tree.
scp ./arch/arm64/boot/dts/freescale/imx8mq-itx-p-c444.dtb root@[ip of target]:/run/media/mmcblk0p1
May not be root if you set up a user account. Also may not be mmcblk0p1 if you aren’t booting from the eMMC.

Any of the make steps can be accelerated by using more of the available threads. Add the argument -j[number of threads].
Example command for building the kernel on a machine with 16 threads available
make Image -j16