Qoriq SDK v2.0-1703 Documentation 5-20-2020
Qoriq SDK v2.0-1703 Documentation 5-20-2020
Qoriq SDK v2.0-1703 Documentation 5-20-2020
This PDF was created from content on https://nxp.com. For the most current NXP
product documentation, go to https://nxp.com.
Getting Started
Yocto Project is an open-source collaboration project for embedded Linux developers. Yocto Project uses the Poky
build system to make Linux images. For complete information about Yocto Project, see https://
www.yoctoproject.org/.
This section describes the file system images that can be built using standard Yocto Project recipes included with
the NXP SDK.
The file system images contain the programs, scripts, and other files that make up Linux user space. There are five
standard images. They are described in the following sections.
In the SDK installation directory, look in meta-freescale/recipes-fsl/images for files that define these
images.
Where to start: “fsl-image-full” contains a rich set of standard Linux features and all special NXP SDK-specific
features. It is the best starting point for exploration and evaluation.
fsl-image-minimal
Contents:
This is a barebones image. It contains a small file set that allows Linux to boot and little else.
Purpose:
This image is intended as a starting point for product development. Users may add packages to it to form an image
that targets their particular project or purpose. Packages may be added by editing conf/local.conf and adding new
packages to be built and installed via
Then, rebuild the image using bitbake. The result will be an image that is small enough for simple flash devices and
is narrowly focused on a specific goal.
Users must add packages to “fsl-image-minimal” to make it useful. Thus it is not intended for “out-of-the-box”
evaluation. Instead, use it as the basis for targeted images for your specific product.
fsl-image-mfgtool
Contents:
This is a small image that NXP preprograms into the flash on development boards. On many boards, the image is
stored in a NOR flash and is loaded into a RAM disk when Linux boots. It contains disk management functions as
described in the next section.
Purpose:
This image is intended to help users to load much larger images onto disks or disk-like devices such as SDHC
cards or USB thumb drives. Thus, this image contains networking support to transfer images and also standard
Linux disk and file system manipulation commands.
NXP preloads “fsl-image-full” (see below) onto disks on development boards that have them. For these boards, “fsl-
image-mfgtool” can be used to restore the larger disk image if it becomes corrupted.
Users will find that it is often convenient to work with larger images and may wish to install “fsl-image-full” onto a
disk-type device and use it with NXP development boards that do not come with a disk drive.
The networking and disk management commands that NXP supplies are standard Linux commands. They are, in
fact, identical on all architectures and thus are not unique to NXP. Users with Linux experience will find them
familiar. They include:
fsl-image-full
Contents:
This is a large image that contains many standard Linux commands and features including native (target-resident)
versions of the GNU tools including gcc and gdb.
If you boot this image, the resulting Linux environment will be much like a command-line on a full desktop-type
Linux system rather than an embedded system.
Purpose:
While this type of image may not be appropriate for a final embedded product, it can be very helpful for many
development and evaluation tasks. The reason is the full set of standard Linux facilities that are already present in
the image. In fact, users may find that they can use this image instead of installing the Yocto Project-based NXP
SDK onto a development system, at least initially.
For this reason, “fsl-image-full” is preinstalled on the disk drives of NXP development boards that have disks.
For example, the image is complete enough that the standard Linux open source command sequence “configure;
make” stands a decent chance of working for arbitrary open source packages that do not happen to be on the
image already.
To be clear, the NXP SDK is a Yocto Project/Poky-derived embedded distribution. However, the Yocto Project
standard Linux package set is large enough that if one enables a lot of the available packages, the result begins to
have the feel of desk top Linux. NXP added the special NXP-specific packages, and the result is “fsl-image-full.” It is
intended for “out-of-the-box” evaluation because it is rather complete.
fsl-image-core
Contents:
This is a small image somewhat like “fsl-image-minimal” except it contains all of the NXP-specific SDK packages.
Purpose:
This image is useful for evaluating the NXP-specific software packages in the context of a file system image that is
much more embedded-oriented than “fsl-image-full”.
Embedded file system images contain fewer helpful tools and utilities by definition. They are intended to support an
embedded product’s functionality rather than a developer’s tasks. Thus, it can be convenient to begin with “fsl-
image-core” for evaluation and planning and then later narrowly extend “fsl-image-minimal” to support your
embedded product.
fsl-image-virt
Contents:
This is an image which contains the specific packages needed to enable virtualization.
Purpose:
This image is useful for virtualization scenarios (KVM, libvirt, lxc). It contains:
• the guest image (uImage format for Power based architectures and zImage for ARM based architectures)
• QEMU
• all necessary libraries and tools for libvirt and lxc support
The following sections are essential to the build process and must be performed when using Yocto Project to build
the SDK. In order to install the SDK, download the necessary ISO's and follow steps for installing SDK 2.0, install
SDK v2.0-1703. When those steps are completed, prepare the host environment, setup Poky, perform builds, and
follow the instructions in the subsequent sections. When these steps are completed, the build process will be
complete. Linux images that have been built will be found in the following directory: build_<machine>/tmp/
deploy/images/<machine>
See Additional Instructions for Developers for more information on using Yocto Project.
SDK-V2.0-1703 is an incremental update to SDK 2.0. Prior to installing SDK-V2.0-1703, install SDK 2.0. Both SDK
2.0 and SDK V2.0-1703 can be downloaded from www.nxp.com/sdk. SDK 2.0 documentation and installation
instructions can be found on Install SDK 2.0 section.
SDK-V2.0-1703 includes all the changes of previous incremental/NPI releases, such as SDK-V2.0-1701/SDK-
V2.0-1611/SDK-V2.0-1609/LS1046A-SDK-V0.4. They can't be installed at the same time. The install script will
detect conflict releases and prompt the steps to deal with them.
1. Extract the SDK-V2.0-1703.tar.bz2, and run the 'install' script to install the incremental updates:
2. During the install process, the user will be prompted to input the SDK 2.0 ISO installed location, i.e.,
<ISO_INSTALL_PATH>/QorIQ-SDK-V2.0-20160527-yocto.
$ /mnt/cdrom/install
3. When you are prompted to input the install path, ensure that the current user has the correct permission for
the install path.
There is no uninstall script. To uninstall Yocto Project, you can remove the <yocto_install_path>/QorIQ-SDK-
<version>-<yyyymmdd>-yocto directory manually.
Note:
* The source ISO contains the package source tarballs and Yocto Project recipes. It can be installed and used to
do non-cache build.
* The cache ISO contains the pre-built cache binaries. To avoid a long time build, you can install the source ISO
and the cache ISO in the same installation folder.
* The image ISO includes all prebuilt images: flash images, standalone toolchain installer, HD rootfs images and
small images.
* The source ISO can be used separately. The cache ISO and the source ISO should work together.
In general, Yocto Project can work on most recent Linux distributions with Python-2.7.3 or greater (excluding
python3 which is not supported), git-1.7.8 or greater, tar-1.24 or greater and required packages installed. The
default Python is not 2.7.x on some Linux distros, e.g. CentOS 6.5 installs python 2.6.6. Follow the instructions
below to install the Python 2.7.x in custom path instead of override the system default python, the override may
cause system utilities breaking.
$ wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
[NOTE: Python 2.7.3 and python 2.7.5 can be used as well.]
$ tar -xf Python-2.7.6.tar.xz
$ cd Python-2.7.6
$ ./configure --prefix=/opt/python-2.7.6
$ make
$ sudo make install
Run the export command below to ensure python 2.7.x is used for Yocto build.
$ export PATH=/opt/python-2.7.6/bin:$PATH
Yocto Project supports typical Linux distributions: Ubuntu, Fedora, CentOS, Debian, OpenSUSE, etc. More Linux
distributions are continually being verified. This SDK has been verified on following Linux distributions: Ubuntu
14.04, CentOS-7.1.1503, Debian 8.2, Fedora 22 and OpenSUSE 13.2
For a list of the Linux distributions tested by the Yocto Project community see SANITY_TESTED_DISTROS in poky/
meta-yocto/conf/distro/poky.conf.
To ensrure Yocto can run on host machine with different Linux distribution, the following packages should be
installled on the host.
$ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat SDL-
devel xterm
$ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \
findutils which SDL-devel xterm
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev xterm
$ sudo zypper install python gcc gcc-c++ libtool subversion git chrpath automake m
ake wget diffstat makeinfo freeglut-devel libSDL-devel
Set Up Poky
Source the following poky script to set up your environment for your particular NXP platform. This script needs to be
run once for each terminal, before you begin building source code. Make sure that you are currently in the
<install_path> when running the commands below.
$ . ./fsl-setup-env -m <machine>
For example:
$ . ./fsl-setup-env -m b4860qds-64b
The following shows the usage text for the fsl-setup-env command:
Usage:
$ . ./fsl-setup-env -h
Usage: . fsl-setup-env -m <machine>
Supported machines
QorIQ: b4420qds-64b b4420qds b4860qds-64b b4860qds c293pcie ls1021atwr ls1043a
rdb p2041rdb p3041ds p4080ds p5020ds-64b p5020ds p5040ds-64b p5040ds t1023rdb-64b
t1023rdb t1024rdb-64b t1024rdb t1040d4rdb-64b t1040d4rdb t1042d4rdb-64b t1042d4rd
b t2080qds-64b t2080qds t2080rdb-64b t2080rdb t4160qds-64b t4160qds t4240qds-64b t
Op tional parameters:
* [-m machine]: the target machine to be built.
* [-b path]: non-default path of project build folder.
* [-j jobs]: number of jobs for make to spawn during the compilation stage.
* [-t tasks]: number of BitBake tasks that can be issued in parallel.
* [-d path]: non-default path of DL_DIR (downloaded source)
* [-c path]: non-default path of SSTATE_DIR (shared state Cache)
* [-g]: enable Carrier Grade Linux
* [-l]: lite mode. To help conserve disk space, deletes the building
directory once the package is built.
* [-h]: help
Perform Builds
Follow these steps to do builds using Yocto Project. Be sure to set up the host environment before doing these
steps.
1. $ cd <sdk-install-dir>/build_<machine>
2. $ bitbake <image-target>
• fsl-image-core: contains common open source packages and NXP specific packages.
• fsl-image-kernelitb: A FIT image comprising the Linux image, dtb and rootfs image.
• fsl-image-mfgtool: contains all the user space apps needed to deploy the fsl-image-mfgtool image
to a USB stick, hard drive, or other large physical media.
• core-image-x11: NXP image with a very basic X11 image with a terminal
A Yocto Project build produces images that will be located in the following directory:
<sdk-install-dir>/build_<machine>/tmp/deploy/images/<machine>/
The following list shows the typical directory/image files (exact contents depend on the setting of the
<IMAGE_FSTYPES> variable):
• u-boot-<machine>.bin - U-Boot binary image that can be programmed into board Flash
• rcw/*/rcw_*.bin - rcw
Note: For additional Yocto Project usage information, please refer to the https://www.yoctoproject.org/.
This section describes additional "How To" instructions for getting started with Yocto Project.
Each set of instructions is aimed towards developers that are interested in modifying and configuring the source
beyond the default build. Each section will describe instructions on how to use Yocto Project to achieve a specific
development task.
Customize U-boot
If source code has already been installed, please skip steps 1 & 2 and proceed modifying source code.
3. $ cd <S> and modify the source code. Follow instructions to "Rebuild U-Boot Image" when you are finished
modifying source code.
Note: Use bitbake -e <package-name> | grep ^S= to get value of <S>, the package source code
directory.
1. $ cd build_<machine>
3. $ bitbake u-boot
Note: U-Boot image can be found in build_<machine>/tmp/deploy/images/<machine>/
If source code has already been installed, please skip steps 1 & 2 and proceed modifying source code.
3. $ cd <S> and change the source code. Follow instructions to "Rebuild Kernel Image" when you are finished
modifying source code.
Note: Use bitbake -e <package-name> | grep ^S= get the value of <S> (package source code
directory).
To Change dts:
To Do menuconfig:
Note: If you are going to reuse this new kernel configuration for future builds, tell menuconfig to "Save
Configuration to Alternate File" and give it an absolute path of /tmp/my-defconfig. If you do not do this,
the new defconfig file will be removed when doing a clean/cleansstate for kernel.
Note: This runs the normal kernel menuconfig within the Yocto Project environment. If the kernel configure
UI cannot open, edit /<yocto_install_path>/build_<machine>/conf/local.conf and add the
following based on your environment (prior to issuing the bitbake command).
• OE_TERMINAL = "screen"
• OE_TERMINAL = "gnome"
• OE_TERMINAL = "konsole"
• OE_TERMINAL = "auto"
1. $ cd build_<machine>
3. $ bitbake virtual/kernel
4. $ bitbake fsl-image-kernelitb
Note: Kernel images can be found in <sdk-install-dir>/build_<machine>/tmp/deploy/images/
<machine>/
Patch Packages
1. $ cd <sdk-install-dir>/build_<machine>
3. $ cd <RECIPE_FOLDER>
Note: Use bitbake <package-name> -e | grep ^FILE_DIR to get the value of
<RECIPE_FOLDER>
4. $ mkdir -p <RECIPE_FOLDER>/files
SRC_URI += "file://<name-of-patch1> \
file://<name-of-patch2> \
... \
file://<name-of-patchn>"
$ bitbake <package-name>
3. $ cd <S>
Note: Use bitbake -e <package-name> | grep ^S= to get the value of <S>.
fsl-image-mfgtool:sources/meta-freescale/recipes-fsl/images/fsl-image-mfgtool.bb
fsl-image-core:sources/meta-freescale/recipes-fsl/images/fsl-image-core.bb
fsl-image-full:sources/meta-freescale/recipes-fsl/images/fsl-image-full.bb
fsl-image-virt: sources/meta-freescale/recipes-fsl/images/fsl-image-virt.bb
fsl-image-minimal:sources/meta-freescale/recipes-fsl/images/fsl-image-minimal.bb
fsl-image-kernelitb:sources/meta-freescale/recipes-fsl/images/fsl-image-kernelitb.
bb
fsl-toolchain:sources/meta-freescale/recipes-fsl/images/fsl-tooichain.bb
The rootfs type can be customized by setting the IMAGE_FSTYPES variable in the above recipes.
cpio
cpio.gz cpio.xz
cpio.lzma
cramfs
ext2
ext2.gz
ext2.gz.u-boot
ext2.bz2.u-boot
ext3
ext3.gz.u-boot
ext2.lzma
jffs2
live
squashfs
squashfs-lzma
ubi
tar
tar.gz
tar.bz2
tar.xz
• Package source tarballs are in the folder named sources, which is in the same folder level as
build_<machine>.
If <PREFERRED_VERSION> is not defined, Yocto Project will pick up the recent version. For example, to downgrade
Samba from 3.4.0 to 3.1.0: add PREFERRED_VERSION_samba = "3.1.0" in <sdk-install-dir>/sources/
meta-freescale/conf/machine/<machine>.conf
Rebuild rootfs:
$ bitbake <image-target>
Native packages such as cst-native are supported in Yocto Project. To build a native package, do the following:
$ bitbake cst-native
Note: The binaries can be found in build_<machine>/tmp/sysroot/
1. $ . ./fsl-setup-env -m <machine>
2. $ bitbake fsl-toolchain
3. $ cd build_<machine>/tmp/deploy/sdk
4. $ ./fsl-qoriq-glibc-<host_arch>-<core>-toolchain-<release>.sh
Note: The default installation path for standalone toolchain is /opt/fsl-qoriq/2.0/. The install folder can
be specified during the installation procedure.
To use the installed toolchain, go the the location where the toolchain is installed and source the environment-
setup-<core> file. This will set up the correct path to the build tools and also export some environment variables
relevant for development (eg. $CC, $ARCH, $CROSS_COMPILE, $LDFLAGS etc).
To invoke the compiler, use the $CC variable (eg. $CC <source files>).
Note: This is a sysrooted toolchain. GCC needs option --sysroot=<path-to-target-sysroot> to find target
fragments and libraries (eg. crt*, libgcc.a) as the default sysroot is poisoned to /not/exist. However, when invoking
the compiler through the $CC variable, there is no need to pass the --sysroot parameter as it is already included in
the variable (check by running echo $CC).
Build an rootfs image with multilib libraries (e.g. ppc64 rootfs with lib32).
1. Use the following setting in local.conf (this example is for e6500 targets)
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "ppce6500"
3. $ bitbake <rootfs_image>
Both "64bit kernel + 32bit userspace" and "64bit kernel + 64bit userspace" are supported by e6500 targets.
1. Install both source ISO and e6500-64b cache ISO in the same folder
2. $ cd <sdk-install-dir>
4. $ bitbake <rootfs-target>
The standalone toolchain generated by Yocto Project doesn't support multilib, 32bit and 64bit build should be done
by different toolchain. This SDK supports to build 32-bit and 64-bit standalone toolchains. Both prebuilt toolchains
are provided in the image ISO. The kernel image should be built using fsl-qoriq-glibc-*-
ppc64e6500-.toolchain-<sdk_version>+*.sh.
The SDK supports openjdk-7 on 32b targets and 64b targets, Jtreg has been used to verify the openjdk.
1. $ . ./fsl-setup-env -m <machine>
2. $ bitbake java-test-image
Note: The rootfs image with openjdk support can be found in build_<machine>/tmp/deploy/images/
<machine>/
Deploy Openstack
Setup Diagram
Host Machine based on QorIQ platform can be used for Openstack Multiple Node demo in the following way:
To build Openstack images for QorIQ Platform, X86 Laptop/Host machine for Yocto Project build should be
available. After build environment is ready, refer to following steps to build images:
2. After those two ISOs install successfully, create project for target platform
$ . ./fsl-setup-poky -m <targer_platform>
Or
$ . ./fsl-setup-poky -m <targer_platform>
Openstack Controller
$ bitbake openstack-image-controller
Openstack Network Node
$ bitbake openstack-image-network
Openstack Compute Node
$ bitbake openstack-image-compute
5. After the image builds successfully, you will see following images under directory
cd tmp/deploy/images/<target_platform>
Controller Rootfs:
openstack-image-controller-<target_platfrom>.tar.gz
Network Node Rootfs:
openstack-image-network-<target_platform>.tar.gz
Compute Node Rootfs:
openstack-image-compute-<target_platform>.tar.gz
4. Create the partition in the Hard drive using the following commands:
a. Run the following command to enter into partitioning system
$ fdisk /dev/sda
Command action
e extended
p primary partition (1-4)
p
g. Enter ‘w’ and press enter to write the changes to Hard drive
$ mkfs.ext2 /dev/sda1
6. Mount the formatted partition to local folder. Run the following command to execute it
$ mkdir /media/sda1
$ mount /dev/sda1 /media/sda1
$ scp <username>@<tftp_server>:<Openstack_image_dir>/openstack-image-controlle
r-<target_platform>.tar.gz /media/sda1
$ cd /media/sda1
$ tar –zxf openstack-image-controller-<target_platform>.tar.gz
Note: Make sure at least two ethernet ports on target platform are available. One port is for management interface,
another one is for data interface.
Configuration for Openstack
http://docs.openstack.org/kilo/install-guide/install/apt/content/index.html
References
*http://docs.openstack.org/kilo/config-reference/content/list-of-compute-config-op
tions.html
*hhttp://docs.openstack.org/kilo/install-guide/install/apt/openstack-install-guide
-apt-kilo.pdf
BitBake has the capability to accelerate builds based on previously built output. This is done using "shared state"
files which can be thought of as cache objects and this option determines where those files are placed. The shared
state cache (sstate-cache), as pointed to by SSTATE_DIR.
SSTATE_DIR="<absolute_path_of_cache_folder>"
e.g. SSTATE_DIR = "/home/yocto/sdk/sstate-cache/"
Note: Some packages have no caches because the ISO uses 4GB of space. Thus, cache size is limited by ISO
size. Some packages (e.g. u-boot, kernel, rcw, hv-cfg, fmc, depmodwrapper-cross, keymaps, base-files, merge-
files, shadow-securetty, etc.) have no caches and building them requires about 20 minutes.
FAQ
Q: How do I install source code, modify source code and rebuild u-boot/kernel?
1. $ cd <sdk-install-dir>/build_<machine>
2. If the source code has been installed, please skip this step.
• $ bitbake -c patch <package-name>
4. Rebuild images:
• $ cd <sdk-install-dir>/build_<machine>
• $ bitbake <package-name>
A: For u-boot:
1. $ cd <sdk-install-dir/build_<machine>
4. Rebuild u-boot:
• $ bitbake u-boot
For kernel:
1. $ cd <sdk-install-dir>/build_<machine>.
2. If kernel source code is not installed, install the kernel source code first.
• $ bitbake -c cleansstate virtual/kernel
• Enable Kernel hacking -> Include CodeWarrior kernel debugging in kernel configuration UI.
4. Rebuild kernel:
• $ bitbake virtual/kernel
Note: Use bitbake -e <rootfs-name> | grep ^IMAGE_ROOTFS= to get the value of <IMAGE_ROOTFS>.
A: Do the following:
1. $ cd <sdk-install-dir>.
• Put the files into files/merge, e.g. put bash into files/merge/, bash will be included in /home/root/
of the new rootfs.
A: Do the following
1. $ export PATH=<path-of-dtc>:$PATH
A: Do the following
1. $bitbake fsl-toolchain
Q: I failed to get source tarball of a packages with wget. What should I do?
A: Use the --no-check-certificates optionwhen Yocto Project uses wget to fetch source tarball from
internet, the option is only available when wget was configured at build time with SSH support. Ensure that wget
on your host is built with SSH support.
A: The toolchain runs on target board, which is the same exact version as the cross tools in this SDK, is only
included in fsl-image-full rootfs, if you want to add toolchain into other rootfs images, do the following:
2. $ bitbake <rootfs-target>.
A: If you want to build the linux kernel using toolchain, you can do the following:
1. cd <toolchain-install-dir>
2. source environment-setup-<core>-fsl-linux
3. export LDFLAGS=""
4. cd <linux-src-dir>
5. make mrproper
6. ./scripts/kconfig/merge_config.sh
arch/arm64/configs/defconfig
arch/arm64/configs/freescale.config