SDK Documentation 5.4 - WinSystems/c444-manifest GitHub Wiki
SDK Documentation 5.4
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.
Build and install SDK with Yocto / bitbake
-
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. -
From the
build
directory in yocto, change directories to the sdk directory.
cd tmp/deploy/sdk
-
Run the file ending in .sh in the directory that was opened in the previous step.
./c444-xwayland-glibc-x86_64-winsys-image-demo-aarch64-imx8mq-itx-p-c444-toolchain-5.4-zeus.sh
This script file can be run on any Linux machine to create a development machine for the C444.
-
It will prompt for a directory to be installed to. By default it gets installed under
/opt/
. -
Once it has finished installing you can run the following to set up your environment.
source /opt/c444-xwayland/5.4-zeus/environment-setup-aarch64-poky-linux
(Path may be different depending on the installation directory selected in step 4) -
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-imx8m.git -b 5.4.24
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
Using the SDK in QT Creator
QT Creator is a cross-platform IDE provided by The QT Company. The following steps will set up remote deployment and debug of a c444 from a development machine. The SDK must be installed before proceeding.
Configuring QT Kit using the SDK
- Install and open QT Creator
- Open the settings window by selecting Tools->Options from the top bar.
- Select Kits from the menu on the left side of the window
- Select the Qt Versions tab and click Add...
- Navigate to
/opt/c444-xwayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/qmake
(Path may vary if SDK was installed somewhere else) - Select the Compilers tab
a. Select Add and GCC/C
b. Set the name to C444_GCC and the path to:
/opt/c444-xwayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc
c. Click Apply
d. Select Add and GCC/C++
e. Set the name to C444_G++ and path to:
/opt/c444-xwayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
f. Click Apply - Select the Debuggers tab
a. Click Add
b. Name it C444_GDB
c. Set the path to:
/opt/c444-xwayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gdb
d. Click Apply - Select the CMake tab
a. Click Add
b. Name it C444_CMake
c. Set the path to:
/opt/c444-xwayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/cmake
d. Click Apply
Setting up Remote Debug and Deployment
- Connect C444 to the network
- Get the board's IP (can be done with
ifconfig
orip addr
) - Add the Device to Qt Creator
a. In Qt Creator open the settings from the top bar Tools->Options
b. Select Devices in the left portion of the Options Dialog Box
c. Click Add...
d. Pick Generic Linux Device e. Click the Start Wizard button
f. Name the device, such as C444, and provide the IP address and user name (winsys)
g. Authentication via Keys can be set up via Qt
h. If a password is requested, enter 'winsys'. - Select Kits from the side bar
- Under the Kits tab, click Add
a. Set the name to C444
b. Set the Device type to Generic Linux Device, and Start Wizard
c. Set the Device Name, such as:C444
d. Set the compilers to C444_GCC and C444_G++
e. Set the Debugger to C444_GDB
f. Set the Qt version to Qt 5.15 (qt5)
g. Set CMake to C444_CMake