Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

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

    其它全志芯片讨论区
    百问网全志t113-s3
    1
    1
    2063
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      giao LV 6 last edited by q1215200171

      (1)100ask_T113-PRO 简介

      接触了一块新的开发板:

      硬件资源配置如下:

      cd21cf0fd30140fda46960e847e4b3d8.png DFA578CD-CDD9-4869-88D3-B9BF65BF3EF3.png

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

      (2)开发环境

      • 开发板 :淘宝
      • 镜像:Ubuntu 18.04 (官方推荐)
      • SD卡:8G以上 (烧写工具:Win32DiskImager.exe)
      • 为更好地开发,建议安装以下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:~#
      
      • 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
      

      对于国内无法访问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
      

      (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
      

      编译完成:

      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 烧写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
      

      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
      
      ......
      

      账号为 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
      

      开机后可将adb服务移除:

      rm  /etc/init.d/S11adb_server
      

      或在 config 加上adb配置

      BR2_PACKAGE_ANDROID_TOOLS=y
      BR2_PACKAGE_ANDROID_TOOLS_ADB=y
      BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
      

      转载自:https://blog.csdn.net/qq_46079439/article/details/125896105?spm=1001.2014.3001.5502

      1 Reply Last reply Reply Quote Share 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策