STK-T536产品特性:
  • 采用Allwinner公司Cortex-A55四核T356处理器,运行最高速度为1.8GHZ;
  • 支持4K/25fps H.264视频编码,支持4K/15fps MJPEG编码;
  • 支持单通道LVDS显示或者HDMI 1.4(两接口复用),LVDS分辨率最高1280x800@60fps;HDMI显示分辨率最高1080p@60fps;
  • 支持1-4G  Bytes LPDDR4X SDRAM;
  • 支持SPI NAND(4Gb MAX)启动或者EMMC 8G-64G大容量电子盘,可启动;
  • 支持3路USB2.0 HOST和一路OTG(TYPE-C接口);
  • 支持CTP电容式触摸屏接口(I2C信号,支持掉电唤醒);支持RTP触摸屏接口;
  • 支持双路千兆以太网;
  • 支持4G通信或5G通信;
  • 支持MIPI CSI - 1*4-lane,可连接OV1385X摄像头;1*2-lane可连接OV5645摄像头;
  • 支持M.2 KEY_B接口(PCIE X1信号),支持5G模块或者SSD固态存储;
  • 通过扩展SPI接口扩展可支持最多8路CAN FD;
  • 通过扩展可支持最多17路UART;
  • 操作系统的支持,可预装Linux5.10/Linux5.10_rt/Ubuntu20.04/Openwrt/Debian;
  • 尺寸为130X108MM
     
STK-T536的功能图:

2、SDK的配置及系统镜像编译、生成

LinuxSDK准备好之后,接下来重点介绍一次性全部编译和部分编译的过程。编译完成后,可通过打包指令生成最终的img(该img文件可通过烧写工具烧写到开发板)。既然介绍编译,首先少不了编译用的指令,每个SDK的编译指令估计都有略微的差别,以下介绍全志T536的SDK中都支持哪些编译指令,通过如下指令进行查看:

Host#  source build/envsetup.sh

备注:进入LinuxSDK源码的根目录执行该命令。

embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$source build/envsetup.sh
NOTE: The SDK(/home/embfly/T536/T536_Tina5.0_AIOT_V1.1) was successfully loaded
load buildroot,bsp...ok
Invoke . build/quick.sh from your shell to add the following functions to your environment:
    croot / cl                     - Changes directory to the top of the tree
    cbrandy                        - Changes directory to the brandy
    cspl / cboot0                  - Changes directory to the spl
    csbi[10|14] / copensbi[10|14]  - Changes directory to the opensbi
    cu / cuboot / cboot            - Changes directory to the uboot
    cubsp / cubootbsp / cbootbsp   - Changes directory to the uboot-bsp
    carisc                         - Changes directory to the arisc
    ck / ckernel                   - Changes directory to the kernel
    cbsp                           - Changes directory to the bsp
    cbsptest                       - Changes directory to the bsptest
    cdts                           - Changes directory to the kernel's dts
    cchip / cchips                 - Changes directory to the chip
    cbin                           - Changes directory to the chip's bin
    cboard / cconfigs / cbd        - Changes directory to the board
    crootfs                        - Changes directory to the rootfs
    cdsp                           - Changes directory to the dsp
    crtos                          - Changes directory to the rtos
    crtoshal / crtos-hal           - Changes directory to the rtos-hal
    cbuild                         - Changes directory to the build
    cbr                            - Changes directory to the buildroot
    copenssl                       - Changes directory to the product's openssl-1.0.0
    cout                           - Changes directory to the product's output
    ckout / ckernelout             - Changes directory to the kernel output
    ctarget                        - Changes directory to the target
    chostbin                       - Changes directory to the hostbin
    cplat                          - Changes directory to the platform
    ccommon                        - Changes directory to the common
Usage: build.sh [args]
    build.sh                       - default build all
    build.sh bootloader            - only build bootloader
    build.sh kernel                - only build kernel
    build.sh buildroot_rootfs      - only build buildroot
    build.sh uboot_menuconfig       - edit uboot menuconfig
    build.sh uboot_saveconfig       - save uboot menuconfig
    build.sh menuconfig            - edit kernel menuconfig
    build.sh saveconfig            - save kernel menuconfig
    build.sh recovery_menuconfig   - edit recovery menuconfig
    build.sh recovery_saveconfig   - save recovery menuconfig
    build.sh buildroot_menuconfig  - edit buildroot menuconfig
    build.sh buildroot_saveconfig  - save buildroot menuconfig
    build.sh clean                 - clean all
    build.sh distclean             - distclean all
    build.sh pack                  - pack firmware
    build.sh pack_debug            - pack firmware with debug info output to card0
    build.sh pack_secure           - pack firmware with secureboot
Usage: pack [args]
    pack                           - pack firmware
    pack -d                        - pack firmware with debug info output to card0
    pack -s                        - pack firmware with secureboot
    pack -sd                       - pack firmware with secureboot and debug info output to card0
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$

执行source build/envsetup.sh指令后,信息中展示了相关指令,以下是对这些指令的介绍:

备注:

1)croot/ctarget等是快速切换目录的指令。例如:croot是直接切换到SDK根目录。其他指令用户可自行摸索。

2)通常不执行source build/envsetup.sh指令,这样的话,切换目录的快捷指令如croot/ctarget等等无法使用。另外执行表中指令时要加上./,例如:./build.sh menuconfig。

3)最快编译出固件的几条指令:

Host#  ./build.sh config

Host#  /build.sh

Host#  /build.sh pack

2.1、配置SDK生成配置文件

进入LinuxSDK源码目录执行如下命令,配置内核版本、处理器型号、评估板型号、显示方式、编译器等信息。

Host#  cd T536/T536_Tina5.0_AIOT_V1.1/

Host#  ./build.sh config

备注:

  1. 首次执行上述命令会出现官方阅读说明,在等待倒计时结束后输入"Y",按回车确认即可。
  2. 如需配置Linux内核,Config配置选项"All available kern_name"请选择"linux-5.10- origin";如需配置Linux-RT内核,Config配置选项"All available kern_name"请选择"linux-5.10-rt"。
embfly@embfly-virtual-machine:S cd T536/T536 Tina5.0 AIOT V1.1/
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$./build.sh config
Before using this files, please make sure that you note the following important information
***********************************************************************************
Copyright (c) 2019-2022 Allwinner Technology Co. Ltd. ALL rights reserved.
Allwinner is a trademark of Allwinner Technology Co. Ltd., registered in 
the the People's Republic of China and other countries.
All Allwinner Technology Co. Ltd. trademarks are used with permission.
DISCLAIMER
THIRD PARTY LICENCES MAY BE REOUIRED TO IMPLEMENT THE SOLUTION/PRODUCT.
IF YOU NEED TO INTEGRATE THIRD PARTY'S TECHNOLOGY (SONY DTS. DOLBY. AVS OR MPEGLA. ETC.
IN ALLWINNERS'SDK OR PRODUCTS, YOU SHALL BE SOLELY RESPONSIBLE TO OBTAIN
ALL APPROPRIATELY REOUIRED THIRD PARTY LICENCES.
ALLWINNER SHALL HAVE NO WARRANTY. INDEMNITY OR OTHER OBLIGATIONS WITH RESPECT TO MATTERS COVERED UNDER ANY REOUIRED THIRD PARTY LICENSE.
YOU ARE SOLELY RESPONSIBLE FOR YOUR USAGE OF THIRD PARTY'S TECHNOLOGY.

THIS SOFTWARE IS PROVIDED BY ALLWINNER"AS IS" AND TO THE MAXIMUM EXTENT 
PERMITTED BY LAW. ALLWINNER EXPRESSLY DISCLAIMS ALL WARRANTIES OF ANY KIND 
WHETHER EXPRESS. IMPLIED OR STATUTORY. INCLUDING WITHOUT LIMITATION REGARDING 
THE TITLE, NON-INFRINGEMENT, ACCURACY, CONDITION, COMPLETENESS, PERFORMANCE 
OR MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL ALLWINNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEOUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE. DATA. OR PROFITS. OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
DAMAGE.
***********************************************************************************
You can read /home/embfly/T536/T536_Tina5.0_AIOT_V1.1/build/disclaimer/Allwinnertech Disclaime r(Cn En) 20181122.md for detailed information.
You read time left 8 seconds....
I have already read, understood and accepted the above terms?[Y/N]Y

Config具体配置如下:

========ACTION List: mk_config ;========

All available platform:

0. android

1. linux

Choice [linux]: 1

All available linux_dev:

0. bsp

1. buildroot //我们编译的是buildroot linux

Choice [bsp]: 1

All available ic:

0. t536

Choice [t536]: 0

All available board: //每个产品下面都包括相关目录,目录下是各种dts等文件

0. demo

1. demo_amp

2. demo_kylo

3. demo_nand

4. demo_nor

5. demo_raw_nand

6. stk-t536      //选择评估板名字为stk-t536

Choice [demo]: 6

All available output_configs: //根据需要输出的显示器作选择,对应各自的dts

0. hdmi

1. lvds-lcd

2. dual-lvds-lcd

3. mipi-lcd

Choice [hdmi]: 0

All available flash: //default一般针对emmc或者nand

0. default

1. nor

Choice [default]: 0

All available kern_name:

0. linux-5.10-euler

1. linux-5.10-origin //如需配置为 Linux 内核请选择此项

2. linux-5.10-rt    //如需配置为 Linux-RT 内核请选择此项

3. linux-5.10-xenomai

4. linux-5.15-origin

Choice [linux-5.10-euler]: 1

05-12 17:25:57.626 36167 D mkcommon: make: Entering directory '/home/embfly/T536/
T536_Tina5.0_AIOT_V1.1/kernel/linux-5.10-origin
05-12  17:25:57.647   36167 D  mkcommon: make[1]: Entering directory '/home/embfly/T5 36/T536_Tina5.0_AIOT_V1.1/out/t536/kernel/build'
05-12 17:25:57.736 36167 D mkcommon: GEN       Makefile
05-12 17:25:57.747 36167 D mkcommon  HOSTCC   scripts/basic/fixdep 
05-12 17:25:59. 217 36167 D mkcommon  HOSTCC  scripts/kconfig/conf.o 
05-12 17:25:59.412 36167  D mkcommon  HOSTCC  scripts/kconfig/confdata.o 
05-12 17:25:59.582  36167 D mkcommon  HOSTCC  scripts/kconfig/expr.o 
05-12 17:25:59.717  36167 D mkcommon  LEX     scripts/kconfig/lexer.lex.c 
05-12 17:25:59.792 36167  D mkcommon YACC     scripts/kconfig/parser.tab.[ch]
05-12 17:26:00.037 36167  D mkcommon HOSTCC   scripts/kconfig/lexer.lex.o 
05-12 17:26:00.204 36167  D mkcommon HOSTCC   scripts/kconfig/parser.tab.o 
05-12 17:26:00.441 36167  D mkcommon: HOSTCC  scripts/kconfig/preprocess.o 
05-12 17:26:00.531 36167  D mkcommon HOSTCC   scripts/kconfig/symbol.o 
05-12 17:26:00.723 36167  D mkcommon HOSTCC    scripts/kconfig/util.o 
05-12 17:26:00.767 36167  D mkcommon: HOSTLD   scripts/kconfig/conf
05-12 17:26:00.778 36167 D mkcommon: ** Default configuration is based on '.././.././../device/config/chips/t536/configs/stk-t536/linux-5.10-origin/buildroot_linux_d efconfig'
05-12 17:26:09.543 36167 D  mkcommon:
05-12 17:26:09.544 36167 D  mkcommon: #configuration written to.config 
05-12 17:26:09.545 36167 D  mkcommon:# 
05-12 17:26:09.546 36167 D mkcommon: make[1]: Leaving directory '/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/out/t536/kernel/build'
05-12 17:26:09.547 36167 D  mkcommon: make: Leaving directory '/home/embfly/T536/T 536_Tina5.0_AIOT_V1.1/kernel/linux-5.10-origin'
05-12 17:26:09.766 36167  I mkcommon: clean buildserver 
05-12 17:26:09.767 36167 I mkcommon: prepare buildserver 
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$

配置完成后,我们可以查看sdk的配置文件来判断配置是否正确,该配置文件是位于SDK根目录下的.buildconfig(只有通过ls -al指令才能看到该文件)。以我们刚刚生成的配置文件为例,.buildconfig内容如下:

export LICHEE_PLATFORM=linux
export LICHEE_LINUX_DEV=buildroot
export LICHEE_IC=t536
export LICHEE_BOARD=stk-t536
export LICHEE_OUTPUT_CONFIGS=hdmi
export LICHEE_FLASH=default
export LICHEE_KERN_NAME=linux-5.10-origin
export LICHEE_KERNEL_ARCH=arm64
export LICHEE_ARCH=arm64
export LICHEE_KERN_VER=linux-5.10-origin
export LICHEE_KERNEL_VERSION=5.10.198
export LICHEE_KERN_DEFCONF=buildroot_linux_defconfig
export LICHEE_KERN_DEFCONF_RT=
export LICHEE_BUILDING_SYSTEM=buildroot
export LICHEE_BR_VER=202205
export LICHEE_BR_DEFCONF=sun55iw6p1_aiot_t536_defconfig
export LICHEE_DEFCONFIG_FRAGMENT=
export LICHEE_PRODUCT=
export LICHEE_BRANDY_VER=2.0
export LICHEE_BRANDY_DEFCONF=sun55iw6p1_t536_defconfig
export LICHEE_BRANDY_UBOOT_VER=2023
export LICHEE_BRANDY_BUILD_OPTION=
export LICHEE_COMPILER_TAR=aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz
export LICHEE_ROOTFS=target-arm64-10.3
export LICHEE_RAMFS=
export LICHEE_BUSSINESS=
export LICHEE_BR_RAMFS_CONF=
export LICHEE_CHIP=sun55iw6p1
export LICHEE_RTOS_PROJECT_NAME=t536_e907_demo
export LICHEE_DSP_PROJECT_NAME=
export LICHEE_PACK_HOOK=
export LICHEE_PACK_SECURE_TYPE=
export LICHEE_REDUNDANT_ENV_SIZE=
export LICHEE_ONE_ENV_SIZE=
export LICHEE_BRANDY_SPL=
export LICHEE_COMPRESS=
export LICHEE_NO_RAMDISK_NEEDED=y
export LICHEE_RAMDISK_PATH=
export LICHEE_KERN_DEFCONF_RECOVERY=
export LICHEE_USE_INDEPENDENT_BSP=true
export LICHEE_INDEPENDENT_PACK=
export LICHEE_BOOT0_BIN_NAME=
export LICHEE_EFEX_BIN_NAME=efex
export LICHEE_EFEX_DEFCONF=sun55iw6p1_t536_efex_defconfig
export LICHEE_UPDATE_BOOTIMG=
export LICHEE_EXT_MODULES=
export ANDROID_TOP_PATH=
export ANDROID_CLANG_PATH=
export ANDROID_TOOLCHAIN_PATH=
export ANDROID_CLANG_ARGS=
export ANDROID_GKI_VERSION=
export LICHEE_BSP_STAGING=
export LICHEE_GEN_BOOT0_DTS_INFO=
export LICHEE_SPL_BOARD_MK=
export LICHEE_KERN_SYSTEM=

从以上信息可以获得LICHEE_BOARD=stk-t536,编译的固件是针对主板stk-t536,该主板的相关配置信息都保存在SDK根/device/config/chips/t536/configs/stk-t536目录,该目录中的内容如下:

embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$ cd device/config/chips/t536/configs/stk-t536
embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$ cd device/config/chips/t536/configs/stk-t536$ tree -L 1
.
├── arisc.config
├── BoardConfig.mk
├── board.dts -> linux-5.10-origin/board.dts
├── board-lvds-lcd.dts -> linux-5.10-origin/board-lvds-lcd.dts
├── bsp
├── buildroot
├── linux-5.10-euler
├── linux-5.10-origin
├── linux-5.10-rt
├── linux-5.10-xenomai
├── linux-5.15-origin
├── sys_config.fex
├── uboot-2023
└── ubuntu

因本次选择编译buildroot,那么在stk-t536配置文件夹下的buildroot目录中就可以找到BoardConfig.mk文件,该文件确认了LICHEE_BR_DEFCONF(buildroot的默认配置文件)为sun55iw6p1_aiot_t536_defconfig,同时该文件还明确了编译内核时的配置文件为LICHEE_KERN_DEFCONF=buildroot_linux_defconfig,BoardConfig.mk内容如下:

LICHEE_BUILDING_SYSTEM:=buildroot
LICHEE_BR_VER:=202205
LICHEE_BR_DEFCONF:=sun55iw6p1_aiot_t536_defconfig
LICHEE_KERN_DEFCONF:=buildroot_linux_defconfig
LICHEE_NO_RAMDISK_NEEDED:=y

我们本次选择内核是linux-5.10-origin,那么在stk-t536配置文件夹下的linux-5.10-origin目录,我们可以找到buildroot_linux_defconfig。

├── board_20251223_backup.dts
├── board.dts
├── board-dual-lvds-lcd.dts
├── board-lbc.dts
├── board-lvds-lcd.dts
├── board-mipi-lcd.dts
├── board_stk_t536.dts
├── bsp_defconfig
└── buildroot_linux_defconfig

如果期望编译的固件内核是实时内核,那么在执行.build.sh config时,要选择linux-5.10-rt,那么在stk-t536配置文件夹下的linux-5.10-rt目录,我们可以找到实时内核的配置buildroot_linux_defconfig。

通过以上信息可以判断生成的.buildconfig文件是正确的。接下来即可进行固件的编译。

2.2、编译 LinuxSDK

2.2.1、配置内核选项

我司默认配置的是Linux内核(推荐使用),如对系统实时性要求较高,则需配置编

译Linux-RT内核。如需修改内核编译选项配置,请继续执行"./build.sh menuconfig"命令打开图形配置界面。此命令通过读取.buildconfig中LICHEE_KERN_DEFCONF指定的内核配置文件,以图形界面的方式提供内核编译配置查看和修改方法。如无需修改内核编译选项配置,可跳过此步骤。

menuconfig是一套图形化的配置工具,需要ncurses库支持。ncurses库提供了一系列的API函数供调用者生成基于文本的图形界面,因此需要先参考“安装依赖环境”章节安装ncurses库。ncurses库安装完成后,执行如下命令打开图形配置界面。

Host#  cd /home/embfly/T536/T536_Tina5.0_AIOT_V1.1/

Host#  ./build.sh menuconfig

embfly@embfly-virtual-machine: ~$ cd /home/embfly/T536/T536_Tina5.0_AIOT_V1.1/
embfly@embfly-virtual-machine:/T536/T536 Tina5.0 AIOT V1.1$ ./build.sh menuconfig

可通过键盘的方向键选中对应菜单栏。在<Select>被选中的情况下,可按Enter键进入子菜单。菜单选项中蓝色高亮的字母代表此菜单选项的快捷键,可在键盘上按下对应的字母快速选中对应的菜单选项。

每个菜单选项前的括号内容表示当前菜单选项的配置状态。选中对应的菜单选项后,按下Y键,会将相应的选项配置编译到内核中,同时菜单选项前面变为<*>。按下N键,不会将相应的选项配置编译到内核中。按下M键,会将相应的选项配置编译为内核模块,菜单选项前面变为<M>。如需搜索,可按下/键打开搜索框,然后输入要搜索的内容。

2.2.2、保存内核配置

内核配置完成后,可以进行编译并生效。如果要把当前的内核配置保留下来后续使用,务必执行如下命令,保存配置的选项。Linux内核配置保存在"device/config/chips/t536/co nfigs/stk-t536/linux-5.10-origin/buildroot_linux_defconfig";Linux-RT内核配置保存在"device/config/chips/t536/configs/stk-t536/linux-5.10-rt/buildroot_linux_defconfig"。

Host#  ./build.sh saveconfig

embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$./build.sh saveconfig 
05-12 17:54:25.476 129924 D mkcommon: ========ACTION List: handle_defconfig saveconfig;=======
05-12 17:54:25.477 129924 D mkcommon: options:
05-12 17:54:25.478 129924 I mkcommon: Prepare toolchain..
05-12 17:54:25.496 129924 D mkcommon: make: Entering directory '/home/embfly/T536/T536_Tina5.0_AIOT V1.1/kernel/linux-5.10-origin'
05-12 17:54:25.499 129924 D mkcommon: make[1]: Entering directory '/home/embfly/T536/T536_Tina5.0 AIOT V1.1/out/t536/kernel/build'
05-12 17:54:25.561 129924 D mkcommon: GEN Makefile
05-12 17:54:26.214 129924 D mkcommon: make[1]: Leaving directory '/home/embfly/T536/T536_Tina5.0 AIOT V1.1/out/t536/kernel/build'
05-12 17:54:26.215 129924 D mkcommon: make: Leaving directory '/home/embfly/T536/T536_Tina5.0_AI OT_V1.1/kernel/linux-5.10-origin'
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$

2.2.3、配置 Buildroot

如需修改 Buildroot 配置,请执行如下命令打开 Buildroot 配置界面,通过读取

"out/t536/stk-t536/buildroot/buildroot/"目录下的.config 文件,以图形界面的方式提供文件系统编译配置查看和修改。如无需修改 Buildroot 配置,可跳过此步骤。

Host# cd /home/embfly/T536/T536_Tina5.0_AIOT_V1.1/

Host# ./build.sh buildroot_menuconfig

可通过键盘的方向键选中对应菜单栏。在<Select>被选中的情况下,可按 Enter 键进入子菜单。菜单选项中蓝色高亮的字母代表此菜单选项的快捷键,可在键盘上按下对应的字母快速选中对应的菜单选项。

每个菜单选项前的括号内容表示当前菜单选项的配置状态。选中对应的菜单选项后,按下 Y 键,会将相应的选项配置编译到 Buildroot 中,同时菜单选项前面变为< * >。按下N 键,不会将相应的选项配置编译到 Buildroot 中。如需搜索,可按下/键打开搜索框,然后输入要搜索的内容。

配置完成后,选中<Save>,按Enter键保存配置选项。然后选中<Exit>,按 Enter 键退出。退出后,即可进行buildroot根文件系统的编译。

2.2.4、保存buildroot的配置

为了保留buildroot的配置下次使用,需要执行如下命令,保存buildroot配置选项。配置选项将自动保存至"/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/buildroot

/buildroot-202205/configs/sun55iw6p1_t536_defconfig"。这个配置是在SDK的配置文件.buildconfig中指定。指令如下:

Host# ./build.sh buildroot_saveconfig

2.2.5、编译 LinuxSDK

在LinuxSDK源码目录下执行如下命令,一键编译SPL、U-Boot、Linux内核和Buildroot根文件系统。

Host#   ./build.sh

embfly@embfly-virtual-machine:-/T536/T536_Tinas.0_AIOT_V1.1$./build.sh 
05-12 17:38:50.387 38986 D mkcommon :=========ACTION list:build_linuxdev;======
05-12 17:38:50.388 38986 D mkcommon :options
05-12 17:38:50.389 38986 I mkcommon :---------------------------------------
05-12 17:38:50.390 38986 I mkcommon :build linuxdev..
05-12 17:38:50.390 38986 I mkcommon :chip: sun55iw6p1 
05-12 17:38:50.391 38986 I mkcommon :platform: linux 
05-12 17:38:50.392 38986 I mkcommon :kernel: linux-5.10-origin 
05-12 17:38:50.392 38986 I mkcommon :board: stk-t536
05-12 17:38:50.393 38986 I mkcommon :output: /home/embfly/T536/T536 Tina5.0 AIOT V1.1/out/t536/stk-t536/ubuntu
05-12 17:38:50.394 38986 I mkcommon :---------------------------------------
05-12 17:38:50.400 38986 I mkcommon :build rtos..
05-12 17:38:50.440 38986 D mkcommon :Setup env done!
05-12 17:38:50.441 38986 D mkcommon :Run lunch_rtos to select project 
05-12 17:38:50.445 38986 D mkcommon :last=
05-12 17:38:50.445 38986 D mkcommon :select=t536_e907_demo..
05-12 17:38:50.446 38986 D mkcommon :t536_e907/demo
05-12 17:38:50.456 38986 D mkcommon'/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/rtos/lichee/rtos/projects/t536_e907/demo/defconfig'->'/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/rtos/lichee/rtos/.config'

备注:若修改内核、Qt模块等配置,需重新执行"./build.sh"命令,再打包生成 Buildroot Linux系统镜像文件。

预计耗时约30min(时间取决编译主机的配置)编译完成后,生成 SPL、U-Boot、Linux内核和Buildroot文件系统镜像文件,镜像文件需转化为.fex格式后使用。

05-12 17:45:33.190 38986 D mkcommon :PARTITION_FEX=/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/dev ice/config/chips/t536/configs/stk-t536/ubuntu/sys_partition.fex
05-12 17:45:33.205 38986 D mkcommon :ROOTFS_FEX_LINE=64
05-12 17:45:33.207 38986 D mkcommon :ROOTFS FEX STR=size=12582912
05-12 17:45:33.212 38986 D mkcommon :ROOTFS_FEX_SIZE= 12582912
05-12 17:45:33.214 38986 D mkcommon :EXT4_SIZE=6442450944(6442450944/1024/1024)
05-12 17:45:33.215 38986 D mkcommon :/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/device/config/chis/stk-t536/ubuntu/sys_partition. fex rootfs.fex size is 12582912
05-12 17:45:33.216 38986 D mkcommon :EXT4_SIZE= 12582912*512=6442450944
05-12 17:47:58.695 38986 D mkcommon :Creating filesystem with parameters:
05-12 17:47:58.697 38986 D mkcommon :Size: 6442450944
05-12 17:47:58.698 38986 D mkcommon :Block size:4096
05-12 17:47:58.700 38986 D mkcommon :Blocks per group: 32768
05-12 17:47:58.701 38986 D mkcommon :Inodes per group: 8192
05-12 17:47:58.703 38986 D mkcommon :Inode size: 256
05-12 17:47:58.704 38986 D mkcommon :Journal blocks: 24576
05-12 17:47:58.706 38986 D mkcommon :Label:
05-12 17:47:58.708 38986 D mkcommon :Blocks: 1572864
05-12 17:47:58.709 38986 D mkcommon :Block groups: 48
05-12 17:47:58.711 38986 D mkcommon :Reserved block group size: 383
05-12 17:47:58.712 38986 D mkcommon :Created filesystem with 122306/393216 inodes and 1273738/157 2864 blocks
05-12 17:47:58.713 38986D mkcommon :/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/build/bin/make_ex t4fs-s-l 6442450944 /home/embfly/T536/T536_Tina5.0_AIOT_V1.1/out/t536/stk-t536/ubuntu/rootfs.ex t4 /home/embfly/T536/T536_Tina5.0_AIOT_V1.1/buildroot/ubuntu
05-12 17:47:58.714 38986 I mkcommon :pack rootfs ok..
05-12 17:47:58.715 38986 I mkcommon :---------------------------------------
05-12 17:47:58.716 38986 I mkcommon :build OK.
05-12 17:47:58.717 38986 I mkcommon :---------------------------------------
embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$
  • 生成SPL镜像文件为"out/t536/stk-t536/buildroot/"目录下的boot0_nand_sun55iw6p1.bin、boot0_sdcard_sun55iw6p1.bin和boot0_spinor_sun55iw6p1.bin。
embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$ ls out/t536/stk-t536/buildroot/
all modules                 buildroot    ramfs. cpio.gz       u-boot-nodtb.fex 
arisc                        dist        rootfs.ext4          u-boot-sun55iw6p1.binbImage                         dtbo.img       sboot_sun55iw6p1.bin      vmlinux
boot0_nand_sun55iw6p1.bin  dtc           sunxi.dtb            vmlinux.tar.bz2 
boot0_sdcard sun55iw6p1.bin dts dep         System. map
boot0_spinor sun55iw6p1.bin fes1_sun55iw6p1.bin      u-boot-dtb.fex 
boot.img                     lib                     u-boot-efex.bin
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$
  • 生成U-Boot镜像文件为"out/t536/stk-t536/buildroot/u-boot-sun55iw6p1.bin"。
embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$ ls out/t536/stk-t536/buildroot/
all modules                 buildroot        ramfs. cpio.gz       u-boot-nodtb.fex 
arisc                        dist              rootfs.ext4         u-boot-sun55iw6p1.binbImage                      dtbo.img       sboot_sun55iw6p1.bin     vmlinux
boot0_nand_sun55iw6p1.bin  dtc              sunxi.dtb              vmlinux. tar.bz2 
booto_sdcard sun55iw6p1.bin dts dep         System. map
booto_spinor sun55iw6p1.bin fes1_sun55iw6p1.bin   u-boot-dtb.fex 
boot.img                     lib                     u-boot-efex.bin
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$
  • 生成Linux内核镜像文件为"out/t536/stk-t536/buildroot/boot.img"。
embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$ ls out/t536/stk-t536/buildroot/
all modules                 buildroot        ramfs. cpio.gz       u-boot-nodtb.fex 
arisc                        dist              rootfs.ext4         u-boot-sun55iw6p1.binbImage                      dtbo.img       sboot_sun55iw6p1.bin     vmlinux
boot0_nand_sun55iw6p1.bin  dtc              sunxi.dtb              vmlinux. tar.bz2 
boot0_sdcard sun55iw6p1.bin dts dep         System. map
boot0_spinor sun55iw6p1.bin fes1_sun55iw6p1.bin   u-boot-dtb.fex 
boot.img                     lib                     u-boot-efex.bin
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$
  • 生成文件系统镜像文件"out/t536/stk-t536/buildroot/rootfs.ext4"。
embfly@embfly-virtual-machine: ~/T536/T536_Tina5.0_AIOT_V1.1$ ls out/t536/stk-t536/buildroot/
all modules                 buildroot        ramfs. cpio.gz       u-boot-nodtb.fex 
arisc                        dist              rootfs.ext4         u-boot-sun55iw6p1.binbImage                      dtbo.img       sboot_sun55iw6p1.bin     vmlinux
boot0_nand_sun55iw6p1.bin  dtc              sunxi.dtb              vmlinux. tar.bz2 
boot0_sdcard sun55iw6p1.bin dts dep         System. map
boot0_spinor sun55iw6p1.bin fes1_sun55iw6p1.bin   u-boot-dtb.fex 
boot.img                     lib                     u-boot-efex.bin
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$

2.3、编译生成buildroot系统镜像

执行如下命令,打包生成buildroot系统镜像文件。

Host#  ./build.sh pack

embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$ ./build.sh pack
05-12 18:34: 31.005 130494 D mkcommon: ========ACTION List: mk_pack;========
05-12 18:34: 31.005 130494 D mkcommon: options:
05-12 18:34: 31.006 130494 I mkcommon:packing firmware..
05-12 18:34: 31.160 130542 I pack    :/home/embfly/T536/T536 Tina5.0 AIOT V1.1/out/t536/common/keys
05-12 18:34: 31.567 130542 D pack     :copying tools file 
05-12 18:34: 31.631 130542 D pack     :copying configs file 
05-12 18:34: 31.739 130542 D pack     :copying product configs file
05-12 18:34: 31.743 130542 D pack     :linux copying boardt&linux kernel _version configs file 
05-12 18:34: 31.745 130542 D pack     :Use u-boot env file: /home/embfly/T536/T536_Tina5.0_AIOT_V 1.1/device/config/chips/t536/configs/stk-t536/ubuntu/env.cfg
05-12 18:34: 31.749 130542 D pack/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/out/t536/tlt536-e vm/pack_out/amp-baremetal.fex
05-12 18:34:31.750 130542 D pack       :/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/out/t536/tlt536-e vm/pack out/aultls32.fex
05-12 18:34:31.751 130542 D pack       :/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/out/t536/stk-t536/pack out/aultools.fex
……
05-12 18:35:04.482 130542 D pack :/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/tools/pack/pctools/linux/eDragonEx/
05-12 18:35:04.484 130542 D pack :/home/embfly/T536/T536_Tina5.0_AIOT_V1.1/out/t536/tlt536-e vm/pack_out
05-12 18:35:04.485 130542 D pack :Begin Parse sys_partion.fex 05-1218:35:04.486 130542 D pack
05-12 18:35:04.487 130542 D pack :AddPartion boot-resource.fex BOOT-RESOURCE_FEX 
05-12 18:35:04.487 130542 D pack :AddPartion very boot-resource.fex BOOT-RESOURCE_FEX 
05-12 18:35:04.488 130542 D pack :FilePath: boot-resource.fex
05-12 18:35:04.489 130542 D pack :FileLength=593c00
05-12 18:35:04.490 130542 D pack :AddPartion env. fex ENV_FEX000000000 
05-12 18:35:04.491 130542 D pack :AddPartion very env. fex ENV FEX000000000 
05-12 18:35:04.492 130542 D pack :FilePath: env.fex
05-12 18:35:04.493 130542 D pack :FileLength=20000
05-12 18:35:04.493 130542 D pack :AddPartion boot. fex BOOT FEX00000000
05-12 18:35:04.495 130542 D pack :AddPartion very boot. fex BOOT_FEX00000000
05-12 18:35:04.496 130542 D pack :FilePath: boot.fex
05-12 18:35:04.498 130542 D pack :FileLength=15a3000
05-12 18:35:04.499 130542 D pack :AddPartion rootfs.fex ROOTFS_FEX000000
05-12 18:35:04.500 130542 D pack :AddPartion very rootfs.fex ROOTFS_FEX000000
05-12 18:35:04.501 130542 D pack :FilePath: rootfs.fex
05-12 18:35:04.502 130542 D pack :FileLength=32427da0
05-12 18:35:04.503 130542 D pack :BuildImg
05-12 18:35:04.504 130542 D pack :Dragon execute image.cfg SUCCESS
05-12 18:35:04.545 130542 D pack :image is at
05-12 18:35:04.546 130542 I pack :5.0G/home/embfly/T536/T536 Tina5.0 AIOT V1.1/out/t536_linux_stk-t536_uart0.img
05-12 18:35:04.546 130542 D pack :pack finish
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$

本次操作会将SPL镜像(boot0_nand_sun55iw6p1.bin、boot0_sdcard_sun55iw6p1.bin 和boot0_spinor_sun55iw6p1.bin)转化为boot0_sdcard.fex、boot0_nand.fex、boot0_spin or.fex文件;将U-Boot镜像(u-boot-sun55iw6p1.bin)、U-Boot设备树镜像、sys_config配置文件合并生成boot_package.fex文件;将内核镜像(boot.img)、内核设备树镜像转化为boot.fex文件;将文件系统镜像文件转化为rootfs.fex文件。

最后将boot0_sdcard.fex、boot0_nand.fex、boot0_spinor.fex、boot_package.fex、boot.fex、rootfs.fex等文件,打包生成"out/t536_linux_stk-t536_uart0.img"buildroot系统镜像文件。

embfly@embfly-virtual-machine:~/T536/T536_Tinas.0_AIOT_V1.1$ ls out/pack_out 
amp-baremetal.fex   boot package.fex        image_nor.cfg     sys_partition.bin 
amp_rv0.bin          boot_package_nor.cfg   kernel.fex        sys_partition_dump.fex 
amp_rv0.fex          boot-resource           mkdtimg           sys_partition.fex 
arisc.fex            boot-resource.fex       monitor.fex     sys_partition_private.fex aultls32.fex         boot-resource.ini      optee.fex         sysrecovery.fex 
aultools.fex         cardscript.fex   optee_sun5siw6p1. bin    toce.fex 
autobuild.mk         cardscript secure.fex   parameter.fex      toco_ft.fex 
battery_charge.bmp   cardtool.fex        rootfs.fex        toce nand.fex 
battery_charge.bmp.lzma  cnf base.cnf       rootfs nor. Fex     toce sdcard.fex       bempty. Bmp               config.fex         rootfs-ubifs.fex      toce_ufs.fex 
bempty.bmp.lzma      default.awlic           sboot.bin             toc1.fex 
bl31.bin             diskfs.fex               sboot_sun55iw6p1.bin  u-boot-crash.fex 
board_config.bin     dlinfo.fex              scp.Bin               u-boot-dtb.fex 
board_config.fex     dragon_toc.cfg          scp.fex                u-boot-efex.bin 
BoardConfig.mk       dragon toc.fex         split_xxxx.fex         u-boot-efex.fex 
board.fex             dtbo.fex               sunxi_board1.dtbo      u-boot.fex 
booto_nand.fex       dtboimg.cfg            sunxi_board1.dts       u-boot-nodtb.fex 
boot0_nand_sun55iw6p1.bin    dtco          sunxi_board2.dtbo     u-boot-sun55iw6p1.binboot0_sdcard.fex     env_ab.cfg            sunxi_board2.dts      usbtool_crash.fex 
boot0_sdcard_sun55iwóp1.bin  env_burn.cfg sunxi_board3.dtbo     usbtool.fex 
boot0_spinor.fex     env.cfg               sunxi_board3.dts       usbtool test.fex 
boot0_spinor_sun55iw6p1.bin  env.fex      sunxi.fex               Vboot.fex 
boot.fex             esm.fex                sunxi gpt.fex          Vboot-resource.fex 
bootlogo.bmp        fes1.fex                sunxi mbr.fex          Venv.fex 
bootlogo.bmp.lzma  fes1_sun55iw6p1.bin    sunxi version.fex      verity_block.fex 
bootlogo.bmp.lzma.head   image.cfg         sys_config.bin         version_base.mk 
bootlogo.fex              image_crashdump.  cfg sys_config.fex    vmlinux.fex 
boot_package.cfg         image_linux.cfg    sys_partition_ab.fex Vrootfs.fex 
embfly@embfly-virtual-machine:-/T536/T536_Tina5.0_AIOT_V1.1$
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$ ls out/
kernel pack_out serversocket t536 t536_linux_stk-t536_uart0.img toolchain
embfly@embfly-virtual-machine:~/T536/T536_Tina5.0_AIOT_V1.1$

请参考《系统启动卡制作及系统固化》文档,将Ubuntu系统镜像文件固化至MicroSD卡、eMMC即可。

更多推荐