• 【全志T113-S3_100ask】1-编译buildroot初体验


    (1)100ask_T113-PRO 简介

    接触了一块新的开发板:
    在这里插入图片描述
    硬件资源配置如下:

    资源1资源2
    序号1:RESET复位按键,主要用于复位系统使用。序号2:用户按键,可自定义功能。
    序号3:TF卡卡槽,用于读取TF卡并支TF卡启动系统。序号4:XR829无线模组配套的ANT天线接口。
    序号5:Debug接口,用于串口输出,显示系统信息,调试登录等。序号6:OTG接口,主要用于烧写SPI-NAND系统使用,也可用于ADB调试。
    序号7:电源供电切换开关,用于切换供电方式是OTG口还是DC电源口。序号8:DC接口,用于接入专用电源适配器给开发板独立供电。
    序号9:eSIM卡接口,手机卡接口,用于4G模块拨号上网使用。序号10:TYPE-A USB2.0接口,用于连接常见USB设备。
    序号11:TYPE-A USB2.0接口,用于连接常见USB设备。序号12:TYPE-A USB2.0接口,用于连接常见USB设备。
    序号13:TV IN/OUT接口,用于连接老式AV电视机输出。序号14:多余排针信号引出 有一路I2C信号及4路 ADC信号。
    序号15:3.5MM耳机接口,用于播放声音。序号16:MIC咪头,专用于用于录音。
    序号17:LINE接口,用于播放声音。序号18:RGB LCD接口,用于驱动显示RGB屏幕。
    序号19:E-INK水墨屏接口,用于驱动类SPI水墨屏。序号20:DVP摄像头电压选择。
    序号21:DVP摄像头专用接口。序号22:DVP摄像头电压选择。
    序号23:DVP摄像头电压选择。序号24:RJ45网线接口,用于连接有线网络。
    序号25:T113主芯片,具体参数可看规格书。序号26:网卡与摄像头功能选择排针,根据排针连接方向选择合适的复用方式。
    序号27:RTL8201F网卡PHY芯片,用于有线上网。序号28:SPI-NAND FLASH,用于存储系统,系统支持SPI NAND启动。
    序号29:XR829模组,用于WiFi Bluetooth 无线通信支持。序号30:USB HUB芯片,用于扩展多路USB接口。
    序号31:USB串口芯片,用于支持TTL转USB信号输出。序号32:USB PCI-E接口,专用于4G模组连接使用。

    GitHub地址:
    https://github.com/DongshanPI/buildroot_100ask_t113-pro

    (2)开发环境

    1、开发板 :淘宝
    2、镜像:Ubuntu 18.04 (官方推荐)
    3、SD卡:8G以上 (烧写工具:Win32DiskImager.exe)
    4、为更好地开发,建议安装以下linux环境:

    sudo apt-get install -y sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc wget python cvs git mercurial rsync subversion android-tools-mkbootimg vim libssl-dev android-tools-fastboot

    sudo apt-get -y install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip lib32z1 lib32z1-dev lib32stdc++6 libstdc++6 libncurses-dev u-boot-tools

    root@znh-ubuntu:~# sudo apt-get install -y  sed make binutils build-essential  gcc g++ bash patch gzip bzip2 perl  tar cpio unzip rsync file  bc wget python  cvs git mercurial rsync  subversion android-tools-mkbootimg vim  libssl-dev  android-tools-fastboot
    正在读取软件包列表... 完成
    正在分析软件包的依赖关系树
    正在读取状态信息... 完成
    bc 已经是最新版 (1.07.1-2)。
    build-essential 已经是最新版 (12.4ubuntu1)make 已经是最新版 (4.1-9.1ubuntu1)。
    python 已经是最新版 (2.7.15~rc1-1)sed 已经是最新版 (4.4-2)。
    cvs 已经是最新版 (2:1.12.13+real-26)bash 已经是最新版 (4.4.18-2ubuntu1.3)。
    binutils 已经是最新版 (2.30-21ubuntu1~18.04.7)bzip2 已经是最新版 (1.0.6-8.1ubuntu0.2)。
    cpio 已经是最新版 (2.12+dfsg-6ubuntu0.18.04.4)file 已经是最新版 (1:5.32-2ubuntu0.4)。
    g++ 已经是最新版 (4:7.4.0-1ubuntu2.3)。
    gcc 已经是最新版 (4:7.4.0-1ubuntu2.3)git 已经是最新版 (1:2.17.1-1ubuntu0.12)gzip 已经是最新版 (1.6-5ubuntu1.2)。
    libssl-dev 已经是最新版 (1.1.1-1ubuntu2.1~18.04.20)。
    patch 已经是最新版 (2.7.6-2ubuntu1.1)。
    perl 已经是最新版 (5.26.1-6ubuntu0.5)rsync 已经是最新版 (3.1.2-2.1ubuntu1.4)tar 已经是最新版 (1.29b-2ubuntu0.3)unzip 已经是最新版 (6.0-21ubuntu1.1)vim 已经是最新版 (2:8.0.1453-1ubuntu1.8)wget 已经是最新版 (1.19.4-1ubuntu2.2)。
    android-tools-fastboot 已经是最新版 (1:8.1.0+r23-5~18.04)。
    android-tools-mkbootimg 已经是最新版 (1:8.1.0+r23-5~18.04)。
    mercurial 已经是最新版 (4.5.3-1ubuntu2.2)。
    subversion 已经是最新版 (1.9.7-4ubuntu1.1)。
    升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 6 个软件包未被升级。
    
    root@znh-ubuntu:~# sudo apt-get -y install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip lib32z1 lib32z1-dev lib32stdc++6 libstdc++6 libncurses-dev   u-boot-tools
    正在读取软件包列表... 完成
    正在分析软件包的依赖关系树
    正在读取状态信息... 完成
    注意,选中 'git' 而非 'git-core'
    注意,选中 'libncurses5-dev' 而非 'libncurses-dev'
    build-essential 已经是最新版 (12.4ubuntu1)。
    bzr 已经是最新版 (2.7.0+bzr6622-10)。
    flex 已经是最新版 (2.6.4-6)gawk 已经是最新版 (1:4.1.4+dfsg-1build1)。
    libxml-parser-perl 已经是最新版 (2.44-2build3)。
    cvs 已经是最新版 (2:1.12.13+real-26)。
    quilt 已经是最新版 (0.63-8.2)git 已经是最新版 (1:2.17.1-1ubuntu0.12)。
    lib32stdc++6 已经是最新版 (8.4.0-1ubuntu1~18.04)。
    lib32z1 已经是最新版 (1:1.2.11.dfsg-0ubuntu2.1)。
    lib32z1-dev 已经是最新版 (1:1.2.11.dfsg-0ubuntu2.1)。
    libncurses5-dev 已经是最新版 (6.1-1ubuntu1.18.04)。
    libssl-dev 已经是最新版 (1.1.1-1ubuntu2.1~18.04.20)。
    libstdc++6 已经是最新版 (8.4.0-1ubuntu1~18.04)。
    u-boot-tools 已经是最新版 (2020.10+dfsg-1ubuntu0~18.04.2)unzip 已经是最新版 (6.0-21ubuntu1.1)。
    xsltproc 已经是最新版 (1.1.29-5ubuntu0.2)。
    zlib1g-dev 已经是最新版 (1:1.2.11.dfsg-0ubuntu2.1)。
    ecj 已经是最新版 (3.16.0-1~18.04)。
    mercurial 已经是最新版 (4.5.3-1ubuntu2.2)。
    subversion 已经是最新版 (1.9.7-4ubuntu1.1)。
    升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 6 个软件包未被升级。
    root@znh-ubuntu:~#
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62

    5、SDK源码(以下为官方教程)2022-7-20:
    默认源码都存放在github仓库内,请使用如下命令获取

    book@100ask:~$ git clone  https://github.com/DongshanPI/buildroot-100ask_t113-pro
    book@100ask:~$ cd buildroot-100ask_t113-pro/
    book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --init --recursive
    book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --recursive --remote
    book@100ask:~/buildroot-100ask_t113-pro$ cd  buildroot/
    book@100ask:~/buildroot-100ask_t113-pro/buildroot$ git submodule update --init --recursive
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    对于国内无法访问github的同学,可以使用国内备用gitee站点, 如下命令。

    book@100ask:~$ git clone  https://gitee.com/weidongshan/buildroot-100ask_t113-pro
    book@100ask:~$ cd buildroot-100ask_t113-pro/
    book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --init --recursive
    book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --recursive --remote
    book@100ask:~/buildroot-100ask_t113-pro$ cd  buildroot/
    book@100ask:~/buildroot-100ask_t113-pro/buildroot$ git submodule update --init --recursive
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    (3)最小系统编译烧写

    1、sdcard

    1.1 编译sdcard 最小系统镜像

    book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make  BR2_EXTERNAL="../br2t113pro ../br2lvgl "  100ask_t113-pro_sdcard_core_defconfig
    book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make  V=1
    
    • 1
    • 2

    编译完成:

    Creating regular file /disk/buildroot-100ask_t113-pro/buildroot/output/images/rootfs.ext2
    64-bit filesystem support is not enabled.  The larger fields afforded by this feature enable full-strength checksumming.  Pass -O 64bit to rectify.
    Creating filesystem with 262144 1k blocks and 65536 inodes
    Filesystem UUID: 2227dcad-9607-4996-8d36-e5870d09c83f
    Superblock backups stored on blocks:
            8193, 24577, 40961, 57345, 73729, 204801, 221185
    
    Allocating group tables: done
    Writing inode tables: done
    Creating journal (8192 blocks): done
    Copying files into the device: done
    Writing superblocks and filesystem accounting information: done
    
    rm -rf /disk/buildroot-100ask_t113-pro/buildroot/output/build/buildroot-fs/ext2/target
    ln -sf rootfs.ext2 /disk/buildroot-100ask_t113-pro/buildroot/output/images/rootfs.ext4
    ln -snf /disk/buildroot-100ask_t113-pro/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot /disk/buildroot-100ask_t113-pro/buildroot/output/staging
    mkdir -p /disk/buildroot-100ask_t113-pro/buildroot/output/images
    >>>   Executing post-image script support/scripts/genimage.sh
    INFO: cmd: "mkdir -p "/disk/buildroot-100ask_t113-pro/buildroot/output/build/genimage.tmp"" (stderr):
    INFO: cmd: "rm -rf "/disk/buildroot-100ask_t113-pro/buildroot/output/build/genimage.tmp"/*" (stderr):
    INFO: cmd: "mkdir -p "/disk/buildroot-100ask_t113-pro/buildroot/output/build/genimage.tmp"" (stderr):
    INFO: cmd: "cp -a "/tmp/tmp.TzeMUTGJbs" "/disk/buildroot-100ask_t113-pro/buildroot/output/build/genimage.tmp/root"" (stderr):
    INFO: cmd: "find '/disk/buildroot-100ask_t113-pro/buildroot/output/build/genimage.tmp/root' -depth -type d -printf '%P\0' | xargs -0 -I {} touch -r '/tmp/tmp.                      TzeMUTGJbs/{}' '/disk/buildroot-100ask_t113-pro/buildroot/output/build/genimage.tmp/root/{}'" (stderr):
    INFO: cmd: "mkdir -p "/disk/buildroot-100ask_t113-pro/buildroot/output/images"" (stderr):
    INFO: vfat(boot.vfat): cmd: "dd if=/dev/zero of="/disk/buildroot-100ask_t113-pro/buildroot/output/images/boot.vfat" seek=33554432 count=0 bs=1 2>/dev/null" (s                      tderr):
    INFO: vfat(boot.vfat): cmd: "mkdosfs   '/disk/buildroot-100ask_t113-pro/buildroot/output/images/boot.vfat'" (stderr):
    INFO: vfat(boot.vfat): adding file 'boot.img' as 'boot.img' ...
    INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/disk/buildroot-100ask_t113-pro/buildroot/output/images/boot.vfat' '/disk/buildroot-100ask_t113                      -pro/buildroot/output/images/boot.img' '::'" (stderr):
    INFO: vfat(boot.vfat): adding file 'zImage' as 'zImage' ...
    INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/disk/buildroot-100ask_t113-pro/buildroot/output/images/boot.vfat' '/disk/buildroot-100ask_t113                      -pro/buildroot/output/images/zImage' '::'" (stderr):
    INFO: vfat(boot.vfat): adding file 'sun8iw20p1-t113-100ask-t113-pro.dtb' as 'sun8iw20p1-t113-100ask-t113-pro.dtb' ...
    INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/disk/buildroot-100ask_t113-pro/buildroot/output/images/boot.vfat' '/disk/buildroot-100ask_t113                      -pro/buildroot/output/images/sun8iw20p1-t113-100ask-t113-pro.dtb' '::'" (stderr):
    INFO: vfat(boot.vfat): adding file 'dsp0.fex' as 'dsp0.fex' ...
    INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/disk/buildroot-100ask_t113-pro/buildroot/output/images/boot.vfat' '/disk/buildroot-100ask_t113                      -pro/buildroot/output/images/dsp0.fex' '::'" (stderr):
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'boot0' from 'boot0_sdcard.fex' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'boot-packages' from 'boot_package.fex' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'boot-resource' (in MBR) from 'boot-resource.fex' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'env' (in MBR) from 'env.fex' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'env-redund' (in MBR) from 'env.fex' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'boot' (in MBR) from 'boot.vfat' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'rootfs' (in MBR) from 'rootfs.ext4' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition 'share' (in MBR) ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition '[MBR]' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition '[GPT header]' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition '[GPT array]' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): adding partition '[GPT backup]' ...
    INFO: hdimage(100ask-t113-pro_sdcard.img): writing GPT
    INFO: hdimage(100ask-t113-pro_sdcard.img): writing hybrid MBR
    root@znh-ubuntu:/disk/buildroot-100ask_t113-pro/buildroot#
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49

    1.2 烧写sdcard 最小系统镜像
    编译完成后会在 output/images目录下输出 sdcard.img(100ask-t113-pro_sdcard.img) 文件,将文件拷贝到Windows系统下使用 wind32diskimage烧写,或者使用dd if 烧录到tf卡内, 之后插到开发板上,即可启动。

    2、spi nand

    2.1 编译 spi nand最小系统镜像

    book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make   BR2_EXTERNAL="../br2t113pro  ../br2lvgl"  100ask_t113-pro_spinand_core_defconfig
    book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make  V=1
    
    • 1
    • 2

    2.2 烧写spi nand最小系统镜像
    编译完成后会在 output/images目录下输出 buildroot_linux_nand_uart3.img 文件,将文件拷贝到Windows系统下使用 使用 全志官方的 AllwinnertechPhoeniSuit 进行烧写

    (4)启动开发板

    [153]HELLO! BOOT0 is starting!
    [156]BOOT0 commit : 2c94b33
    [159]set pll start
    [165]periph0 has been enabled
    [168]set pll end
    [170][pmu]: bus read error
    [172]board init ok
    
    ......
    
    [245]sdcard 0 line count 4
    [248][mmc]: mmc driver ver 2021-03-22 20:20
    [257][mmc]: Wrong media type 0x0
    [260][mmc]: ***Try SD card 0***
    [279][mmc]: HSSDR52/SDR25 4 bit
    [282][mmc]: 50000000 Hz
    [285][mmc]: 30436 MB
    [286][mmc]: ***SD/MMC 0 init OK!!!***
    [382]Loading boot-pkg Succeed(index=0).
    [385]Entry_name        = u-boot
    [393]Entry_name        = optee
    [397]Entry_name        = logo
    [399]Entry_name        = dtb
    [402]mmc not para
    [404]Jump to second Boot.
    M/TC: OP-TEE version: 6aef7bb2-dirty (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)) #1 F
    
    
    U-Boot 2018.05 (Jun 30 2022 - 06:55:01 +0000) Allwinner Technology
    
    [00.459]CPU:   Allwinner Family
    [00.462]Model: sun8iw20
    [00.465]DRAM:  128 MiB
    [00.468]Relocation Offset is: 04ebd000
    [00.495]secure enable bit: 0
    [00.498]smc_tee_inform_fdt failed with: -65526[00.502]CPU=1008 MHz,PLL6=600 Mhz,AHB=200 Mhz, AP
    [00.508]gic: sec monitor mode
    
     ......
     
     261240 bytes read in 13 ms (19.2 MiB/s)
    4810752 bytes read in 202 ms (22.7 MiB/s)
    [06.431]no vendor_boot partition is found
    Android's image name: sun8iw20p1
    [06.443]Starting kernel ...
    
    [06.446][mmc]: MMC Device 2 not found
    [06.449][mmc]: mmc 2 not find, so not exit
    
    ......
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51

    账号为 root

    如果启动出现(后期可能会修复):

    [   21.044877] configfs-gadget 4100000.udc-controller: failed to start g1: -19
    Initializing random number generator: /etc/init.d/S11adb_server: line 14: echo: write error: No
    FAIL
    Starting network: OK
    Starting swupdate: OK
    
    Welcome to T113 Pro
    t113 login: 
    [   24.163699] configfs-gadget 4100000.udc-controller: failed to start g1: -19
    /etc/init.d/S11adb_server: line 14: echo: write error: No such device
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    开机后可将adb服务移除:

    rm  /etc/init.d/S11adb_server
    
    • 1

    或在 config 加上adb配置

    BR2_PACKAGE_ANDROID_TOOLS=y
    BR2_PACKAGE_ANDROID_TOOLS_ADB=y
    BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
    
    • 1
    • 2
    • 3
  • 相关阅读:
    冒泡排序(C语言详解)
    VI 使用技巧
    如何提高麻辣烫店利润?
    DevOps篇:Jenkins Pipeline流水线语法基础与进阶
    打牌的贝贝(卡特兰数+组合数学)
    Linux实现HTTP服务器
    C++ constexpr && consteval && constinit
    使用堆栈处理字符串
    46.全排列 | 51.N皇后
    MySQL修改表名:重命名RENAME
  • 原文地址:https://blog.csdn.net/qq_46079439/article/details/125896105