Build SECO BSP for i.MX and Rockchip boards
In embedded systems, the Board Support Package (BSP) is the layer of the software that contains hardware-specific drivers and other routines that allow a particular operating system to work in a specific hardware environment, integrated with the software itself.
BSPs are typically customizable, allowing the user to specify which drivers and routines should be included in the build based on their selection of hardware and software options.
SECO also provides a toolchain to build programs to run on the embedded system and other utilities needed to configure the device (while running) along with the BSP.
To perform the following procedure, you will need to install Docker Engine on Ubuntu according to these instructions Ubuntu.
For further information on Docker platform, visit What is Docker?.
INDEX
Source code for linux kernel, u-boot and yocto seco layers is available here.
How can I configure my environment with Docker?
To avoid the time consuming setup of the building environment, we distribute it inside a Docker container.
The following table contains the instructions to create the building environment from the Docker container, depending on the product family of the device used.
Product Family | Environment Setup |
---|---|
i.MX6 |
|
i.MX8 |
|
Rockchip |
|
How can I build SECO U-Boot?
Clone SECO U-Boot from SECO repository
For BSP 10 boards:
$ git clone https://git.seco.com/pub/i.mx/yocto/5.x/uboot-seco-imx.git -b seco/release/imx_5.4.70_2.3.0 --depth=1
For BSP 9 boards:
$ git clone https://git.seco.com/pub/i.mx/yocto/4.x/u-boot-seco.git
In the following paragraphs, the procedures for selecting the correct defconfig
file are different for i.MX6 and i.MX8 based boards. Be careful to follow the right one according to your device.
Procedure for i.MX6-based boards
For i.MX6 Quad, DualLite and Solo CPUs there’s a specific defconfig
file for each RAM configuration.
i.MX6 SoloX, on the other hand, has dynamic RAM setup implemented in U-Boot.
U-boot will allocate the RAM memory based on your board configuration with the correct default defconfig
file.
The table below shows the correct association RAM Configuration/defconfig
file.
Be careful to select the correct RAM configuration, or the device won’t boot.
Choose the right defconfig
file from table below using the following command. After having chosen the right defconfig
file, you can build SECO U-Boot.
cd u-boot-seco
make <board_defconfig_filename>
# eg: make mx6qdl_seco_Q7_928_2G_4x512M_defconfig
# compile u-boot
make spl_imx
Device | RAM Configuration |
|
---|---|---|
RAM Size=1GB RAM Configuration=4x256 MB |
| |
RAM Size=2GB RAM Configuration=4x512 MB |
| |
RAM Size=512 MB RAM Configuration=2x256 MB |
| |
Q7-928 | RAM Size=1GB RAM Configuration=4x256 MB |
|
RAM Size=2GB RAM Configuration=4x512 MB |
| |
RAM Size=512 MB RAM Configuration=2x256 MB |
| |
RAM Size=4GB RAM Configuration=8x512 MB |
| |
μQ7-A75-J | RAM Size=1GB RAM Configuration=4x256 MB |
|
RAM Size=256MB RAM Configuration=1x256 MB |
| |
RAM Size=512 MB RAM Configuration=2x256 MB |
| |
SBC-A62-J | RAM Size=1GB RAM Configuration=4x256 MB |
|
RAM Size=2GB RAM Configuration=4x512 MB |
| |
RAM Size=512 MB RAM Configuration=2x256 MB |
| |
SBC-C23 | RAM Size=dynamic RAM Configuration=512MB and 1GB |
|
SBC-B08 | RAM Size=dynamic RAM Configuration=512MB and 1GB |
|
SYS-A62-J | RAM Size=1GB RAM Configuration=4x256 MB |
|
RAM Size=2GB RAM Configuration=4x512 MB |
| |
RAM Size=512 MB RAM Configuration=2x256 MB |
| |
SYS-B08-7 | RAM Size=dynamic RAM Configuration=512MB and 1GB |
|
The u-boot.imx
file will be available in the U-Boot root directory.
Procedure for i.MX8-based boards
For i.MX8 CPUs, dynamic RAM management has been implemented at U-Boot level.
Choose the right defconfig
file from table below using the following command for BSP9:
cd u-boot-seco
make <board_defconfig_filename>
# eg: make seco_imx8mq_c12_defconfig
# compile u-boot
make
Choose the right defconfig
file from table below using the following command for BSP10:
mv uboot-seco-imx u-boot-seco-imx
cd u-boot-seco-imx
make <board_defconfig_filename>
# eg: make seco_imx8mm_c72_defconfig
# compile u-boot
make
Device | BSP | RAM Configuration |
|
---|---|---|---|
SM-C12 | BSP 9 | Dynamic RAM |
|
SM-D16 | BSP 10 | Dynamic RAM |
|
Q7-C25 | BSP 9 | Dynamic RAM |
|
Q7-C26 | BSP 9 | Dynamic RAM |
|
Q7-C58 | BSP 9 | To be defined |
|
μQ7-C72 | BSP 9 / BSP 10 | Dynamic RAM for i.MX8MM |
|
BSP 10 | Dynamic RAM for i.MX8MN |
| |
SBC-C20 | BSP 9 | Dynamic RAM |
|
SBC-C43 | BSP 9 | Dynamic RAM |
|
SBC-C57 | BSP 9 | Dynamic RAM |
|
SBC-C61 | BSP 9 | Dynamic RAM |
|
SM-D18 | BSP 10 | Dynamic RAM |
|
u-boot.bin
and spl/u-boot-spl.bin
will be available as outputs.
The following instructions only refer to i.MX8-based boards, for which the mkimage must be built to create a proper binary.
Now you are ready to combine U-boot with other firmware to build the final binary.
Go in the same folder level of U-Boot and execute following command:
For BSP 10 boards:
$ git clone https://git.seco.com/pub/i.mx/yocto/5.x/imx-mkimage.git -b seco/release/imx_5.4.70_2.3.0 --depth=1
For BSP 9 boards:
$ git clone https://git.seco.com/pub/i.mx/yocto/4.x/imx-mkimage.git
Move inside the imx-mkimage folder:
cd imx-mkimage/
You can build the binary flash.bin launching the script:
./mk_imximage <board> <options>
# eg: ./mk_imximage c12 or ./mk_imximage c20 dp..etc
The table below summarizes the eligible values to insert in the script, according to the device used.
Device | flash.bin eligible values |
---|---|
SM-C12 |
|
SBC-C20 with DP Video Output |
|
SBC-C20 with HDMI |
|
Q7-C25 with DP Video Output |
|
Q7-C25 with HDMI |
|
Q7-C26 |
|
SBC-C61 |
|
μQ7-C72 |
|
μQ7-C72n |
|
SBC-C57 |
|
SBC-C43 |
|
SM-D16 |
|
SM-D18 |
|
The flash.bin is now available inside the folder iMX8M, iMX8QM or iMX8QX, depending on the CPU type you are compiling for
Procedure for Rockchip RK3399 based boards
For Rockchip RK3399 based boards:
$ git clone https://git.seco.com/pub/rockchip/u-boot-seco-rk2017.09.git -b master
$ https://secostorage.blob.core.windows.net/secosoftware-public/rockchip/c31/seco-rk3399-c31_uboot-rkbin_4.19.111_v1-00-00_20211217.tar.gz
$ tar xzvpf seco-rk3399-c31_uboot-rkbin_4.19.111_v1-00-00_20211217.tar.gz -C ./
For Rockchip RK3399 Flexy boards:
$ git clone https://git.seco.com/pub/rockchip/u-boot-seco-rk2017.09.git -b flexy-c31
$ https://secostorage.blob.core.windows.net/secosoftware-public/rockchip/c31/seco-rk3399-c31_uboot-rkbin_4.19.111_v1-00-00_20211217.tar.gz
$ tar xzvpf seco-rk3399-c31_uboot-rkbin_4.19.111_v1-00-00_20211217.tar.gz -C ./
For Rockchip RK3399 IPC boards:
$ git clone https://git.seco.com/pub/rockchip/u-boot-seco-rk2017.09.git -b ipc-c31
$ https://secostorage.blob.core.windows.net/secosoftware-public/rockchip/c31/seco-rk3399-c31_uboot-rkbin_4.19.111_v1-00-00_20211217.tar.gz
$ tar xzvpf seco-rk3399-c31_uboot-rkbin_4.19.111_v1-00-00_20211217.tar.gz -C ./
Now jump inside u-boot folder and modify in make.sh script the TOOLCHAIN_ARM64 variable with the right toolchain path from this:
TOOLCHAIN_ARM64=../prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin
To this path if you use docker:
TOOLCHAIN_ARM64=/opt/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/
Then build it using the following command:
cd u-boot-seco-rk2017.09
./make.sh seco_rk3399_c31_linux
How can I build SECO Kernel?
First, clone SECO Kernel from SECO repository executing one of the following command:
for i.MX6 and i.MX8-based boards:
For BSP 10 boards:
$ git clone https://git.seco.com/pub/i.mx/yocto/5.x/linux-seco-imx.git -b seco/release/imx_5.4.70_2.3.0 --depth=1
For BSP 9 boards:
$ git clone https://git.seco.com/pub/i.mx/yocto/4.x/linux-seco.git
for Rockchip PX30 based boards:
$ git clone https://git.seco.com/arm/rockchip/linux-seco-rk4.4.git
for Rockchip RK3399 based boards:
$ git clone https://git.seco.com/pub/rockchip/linux-seco-rk4.19.111 -b master
for Rockchip RK3399 Flexy boards:
$ git clone https://git.seco.com/pub/rockchip/linux-seco-rk4.19.111 -b flexy-c31
for Rockchip RK3399 IPC boards:
$ git clone https://git.seco.com/pub/rockchip/linux-seco-rk4.19.111 -b ipc-c31
Now, depending on your device, choose the right defconfig
from Kernel configs folder and build it using the following command:
For Rockchip RK3399 based boards:
cd linux-seco
export CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64
make <defconfig>
make
make modules_install INSTALL_MOD_PATH=modules
For NXP i.MX6 based boards:
cd linux-seco
export ARCH=arm
make <defconfig>
make
make modules_install INSTALL_MOD_PATH=modules
For NXP i.MX8 based boards:
cd linux-seco
export ARCH=arm64
make <defconfig>
make
make modules_install INSTALL_MOD_PATH=modules
Device | BSP |
|
---|---|---|
i.MX6 | BSP 9 |
|
i.MX8 | BSP 9 |
|
BSP 10 |
| |
Rockchip PX30 | - |
|
Rockchip RK3399 | - |
|
The compiled files are inside of the following folder:
Device | Files & path |
---|---|
i.MX6 |
|
i.MX8 |
|
Rockchip |
|
How can I setup my BSP?
To setup the custom hardware configuration, please follow https://secospa.atlassian.net/wiki/spaces/SECOTech/blog/2021/09/20/770703361 .
How can I build Buildroot filesystem image for Rockchip RK3399?
To build Rockchip RK3399 Buildroot Image please follow these steps inside an ubuntu 18.04:
first fetch the rk_rockchip tarball and prepare the environment:
sudo apt-get update
sudo apt-get -y install git time aria2 wget make lsb-release openssh-client vim tree exfat-fuse exfat-utils u-boot-tools mediainfo \
libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libxcb-xinerama0 libxcb-xinerama0-dev \
libopenal-dev libalut-dev libpulse-dev libuv1-dev libmicrohttpd-dev libssl-dev bridge-utils ifplugd \
libbluetooth3-dev libjpeg8 libjpeg8-dev libjpeg-turbo8 libjpeg-turbo8-dev libvpx-dev \
libgtk2.0-dev libnss3 libgconf-2-4 gconf2 gconf2-common libx11-dev libxext-dev libxtst-dev \
libxrender-dev libxmu-dev libxmuu-dev libxfixes-dev libxfixes3 libpangocairo-1.0-0 \
libpangoft2-1.0-0 libdbus-1-dev libdbus-1-3 libusb-0.1-4 libusb-dev \
bison build-essential gperf flex ruby python libasound2-dev libbz2-dev libcap-dev \
libcups2-dev libdrm-dev libegl1-mesa-dev libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev \
libxtst-dev gyp ninja-build \
libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev \
libfontconfig1-dev libxss-dev libsrtp0-dev libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev \
libavutil-dev libavformat-dev libavcodec-dev libevent-dev libcups2-dev libpapi-dev \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
qemu-user-static debootstrap whiptail bsdtar bc device-tree-compiler \
swig python-dev python3-dev liblz4-tool expect-dev
sudo apt-get -y install kmod cpio rsync patchelf
wget https://azure.com/rk_rockchip_20201116.tar.gz
wget https://azure.com/seco_sdk_rockchip_package_20201116.tgz
wget https://azure.com/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tgz
mkdir /opt/rk3399
tar xzvpf gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tgz -C /opt/rk3399/
tar xzvpf rk_rockchip_20201116.tar.gz -C /<destination folder>
tar xzvpf seco_sdk_rockchip_package_20201116.tgz -C /<destination folder>/rk_rockchip/
cd /<destination folder>/
then cd into rk_rockchip folder and start the filesystem build:
cd /<destination folder>/rk_rockchip/
./build.sh rootfs
You're building on Linux
Lunch menu...pick a combo:
0. default BoardConfig.mk
1. BoardConfig-rk3399-evb-ind-lpddr4.mk
2. BoardConfig-rk3399-firefly.mk
3. BoardConfig-rk3399-sapphire-excavator-lp4.mk
4. BoardConfig-rk3399-sapphire-excavator.mk
5. BoardConfig.mk
Which would you like? [0]:4
How can I build Yocto image?
To build the Yocto Image, for i.MX soc based board please follow:
Build Yocto distribution for ARM i.MX products
To build the Yocto Image, for Rockchip soc based board please follow:
https://secogroup.atlassian.net/wiki/spaces/SECOTech/blog/2021/10/18/1403912774