• 全志R528代码编译和烧录以及测试


    代表编译

    代码存在如下目录中:/home/workspace/tina-r528-v1.2
    在这里插入图片描述
    在这里插入图片描述
    这里输入如下指令进行编译:

    su root
    source build/envsetup.sh
    lunch r528_evb2-tina
    make & pack
    
    • 1
    • 2
    • 3
    • 4
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# source build/envsetup.sh
    Setup env done! Please run lunch next.
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# lunch r528_evb2-tina
    ============================================
    TINA_BUILD_TOP=/home/workspace/tina-r528-v1.2
    TINA_TARGET_ARCH=arm
    TARGET_PRODUCT=r528_evb2
    TARGET_PLATFORM=r528
    TARGET_BOARD=r528-evb2
    TARGET_PLAN=evb2
    TARGET_BUILD_VARIANT=tina
    TARGET_BUILD_TYPE=release
    TARGET_KERNEL_VERSION=5.4
    TARGET_UBOOT=u-boot-2018
    TARGET_CHIP=sun8iw20p1
    ============================================
    no buildserver to clean
    [1] 59144
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# 
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    开始编译显示如下log:

    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# make & pack
    [2] 59147
    ===This's tina environment.===
    find: ‘/home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl’: No such file or directory
    r528_evb2 r528 r528-evb2
    build_boot platform:sun8iw20p1 o_option:spl-pub
    grep: /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl/Makefile: No such file or directory
    Prepare toolchain ...
    --------build for mode:all board:r528-------------------
    platform set to sun8iw20p1
    make -C /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/fes fes
      CHK     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/include/config.h
      CHK     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/autoconf.mk
      UPD     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/include/config.h
      UPD     /home/workspace/tina-r528-v1.2/lichee/brandy-2.0/spl-pub/autoconf.mk
    --==========--
    PACK_CHIP         sun8iw20p1
    PACK_PLATFORM     tina
    PACK_BOARD        r528-evb2
    PACK_KERN        
    PACK_DEBUG        uart0
    PACK_SIG          none
    PACK_SECURE       none
    PACK_MODE         normal
    PACK_FUNC         android
    PACK_PROGRAMMER   none
    PACK_TAR_IMAGE    none
    PACK_TOPDIR       /home/workspace/tina-r528-v1.2
    --==========--
    
    • 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

    编译完成后log如下:

    Number of fragments 90
    Number of symbolic links  266
    Number of device nodes 1
    Number of fifo nodes 0
    Number of socket nodes 0
    Number of directories 119
    Number of ids (unique uids + gids) 1
    Number of uids 1
    	root (0)
    Number of gids 1
    	root (0)
    rm -f /home/workspace/tina-r528-v1.2/out/r528-evb2/rootfs.img
    rm -f /home/workspace/tina-r528-v1.2/out/r528-evb2/usr.img
    dd if=/home/workspace/tina-r528-v1.2/out/r528-evb2/compile_dir/target/linux-r528-evb2/root.squashfs of=/home/workspace/tina-r528-v1.2/out/r528-evb2/rootfs.img bs=128k conv=sync
    112+1 records in
    113+0 records out
    14811136 bytes (15 MB, 14 MiB) copied, 0.0124715 s, 1.2 GB/s
    ( cd /home/workspace/tina-r528-v1.2/out/r528-evb2 ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs md5sum --binary > md5sums )
    ( cd /home/workspace/tina-r528-v1.2/out/r528-evb2 ; find -maxdepth 1 -type f \! -name 'md5sums'  -printf "%P\n" | sort | xargs openssl dgst -sha256 > sha256sums )
    make[5]: Leaving directory '/home/workspace/tina-r528-v1.2/target/allwinner/generic/image'
    make[4]: Leaving directory '/home/workspace/tina-r528-v1.2/target/allwinner/r528-evb2'
    make[3]: Leaving directory '/home/workspace/tina-r528-v1.2/target/allwinner'
    make[2]: Leaving directory '/home/workspace/tina-r528-v1.2'
    export MAKEFLAGS= ;make -w -r package/index
    make[2]: Entering directory '/home/workspace/tina-r528-v1.2'
    Generating package index...
    Signing key has not been configured
    make[2]: Leaving directory '/home/workspace/tina-r528-v1.2'
    make[1]: Leaving directory '/home/workspace/tina-r528-v1.2'
    
    #### make completed successfully (02:42 (mm:ss)) ####
    
    
    [2]+  Done                    make
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# 
    
    
    • 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

    编译完成后如果没有意外将会在out的如下目录生成一个"tina_r528-evb2_uart0.img"的镜像
    在这里插入图片描述

    固件烧录

    这里打开烧录工具PhoenixSuit,切换到一键烧录界面加在好镜像,
    在这里插入图片描述
    板子再未上单状态短路flash的1和2管脚:
    在这里插入图片描述
    给板子上电然后就断开flash的1和2管脚:
    在这里插入图片描述
    在这里插入图片描述
    烧录完成后代码就会正常运行

    测试

    这里使用如下命令看log:

    adb shell进去
    然后dmesg
    
    • 1
    • 2

    在这里插入图片描述
    这里想修改一下启动的log,比如这里想把上面的感叹号改为一个字母:

    "Tina is Based on OpenWrt!"  改为"Tina is Based on OpenWrtX"
    
    • 1

    输入如下命令看看这个字符串都在哪里出现:

    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# grep -rl "Tina is Based on OpenWrt" ./
     
    ./package/busybox-init-base-files/busybox-init-base-files_ramfs/etc/banner
    ./package/busybox-init-base-files/files/etc/banner
    ./package/base-files/files/etc/banner
    ./out/r528-evb2/compile_dir/target/rootfs-tmp/etc/banner
    ./out/r528-evb2/compile_dir/target/rootfs/etc/banner
    ./out/r528-evb2/compile_dir/target/linux-r528-evb2/base-files/ipkg-sunxi/base-files/etc/banner
    ./out/r528-evb2/staging_dir/target/rootfs/etc/banner
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    这里可以确定基本就是"package/"目录下的内容决定的,"out/r528-evb2/"下面的内容是编译出来的结果,如下如下方式修改:

    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# cat ./package/busybox-init-base-files/busybox-init-base-files_ramfs/etc/banner
     _____  _              __     _
    |_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
      | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
      | |  | || | || _ |  |_____||_||_|_||___||_,_|
      |_|  |_||_|_||_|_|  Tina is Based on OpenWrtC
     ----------------------------------------------
     Tina Linux (%C, %R)
     ----------------------------------------------
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# cat ./package/busybox-init-base-files/files/etc/banner
     _____  _              __     _
    |_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
      | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
      | |  | || | || _ |  |_____||_||_|_||___||_,_|
      |_|  |_||_|_||_|_|  Tina is Based on OpenWrtD
     ----------------------------------------------
     Tina Linux (%C, %R)
     ----------------------------------------------
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# cat ./package/base-files/files/etc/banner
     _____  _              __     _
    |_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
      | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
      | |  | || | || _ |  |_____||_||_|_||___||_,_|
      |_|  |_||_|_||_|_|  Tina is Based on OpenWrtE
     ----------------------------------------------
     Tina Linux (%C, %R)
     ----------------------------------------------
    root@tina-virtual-machine:/home/workspace/tina-r528-v1.2# 
    
    
    • 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

    编译好代码后从新运行可以看到log如下:

    PS E:\Documentation\Desktop\20221010> adb shell
    
    
    BusyBox v1.27.2 () built-in shell (ash)
    
     _____  _              __     _
    |_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _
      | |   _ |   ||   |  |  |__ | ||   || | ||_'_|
      | |  | || | || _ |  |_____||_||_|_||___||_,_|
      |_|  |_||_|_||_|_|  Tina is Based on OpenWrtE
     ----------------------------------------------
     Tina Linux (Neptune, 6191F77D)
     ----------------------------------------------
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    有此可见决定输出的log的是"package/base-files/files/etc/banner"文件
    注意编译的时候要把"out/r528-evb2/compile_dir/target/"目录删除掉,否则不会覆盖的
    本文生成的镜像从如下地址下载:https://download.csdn.net/download/chengdong1314/88477701

  • 相关阅读:
    原生AJAX
    算法学习笔记(29):分块
    【JavaWeb学习】—iframe标签(四)
    go | 切片的长度和容量
    动态库工程链接动态库的Makefile
    SpringBoot 多模块 多环境 项目 单元测试
    【Python 实战基础】什么是PyQt6? 简单介绍一下PyQt6
    OOM和频繁GC预防方案
    Eureka服务注册与发现
    MySQL中的SHOW FULL PROCESSLIST命令
  • 原文地址:https://blog.csdn.net/chengdong1314/article/details/134068345