荔枝派 zero(全志V3S)-编译及SD烧录

之前买了个荔枝派,全志的A3S芯片。折腾了两天,写一下编译和SD烧录的过程。

目录

1.直接烧录镜像文件

2.uboot编译

3.kernel编译

4.rootfs编译

5.烧录

6.串口登录


1.直接烧录镜像文件

百度到了一堆的资料,下面是网盘链接

链接:https://pan.baidu.com/s/1x75Uqnxl6bmBCYDN3NUdJg
提取码:ohzx
复制这段内容后打开百度网盘手机App,操作更方便哦

这里面有现成的镜像文件,想直接体验的,可以用这个玩玩

下载之后,将压缩包解压;

还要下载两个软件

首先是格式化软件,用来格式化U盘的

https://www.sdcard.org/downloads/formatter/

然后是镜像烧录软件

http://www.onlinedown.net/soft/110173.htm

打开第一个软件

然后就可以使用这个镜像了。

这里演示一个debian系统

后面不细说了,和本文关系不大

2.uboot编译

可以用下面的方式,也可以加群,去群文件找我下载好的东西。

安装交叉编译器

网盘地址:http://pan.baidu.com/s/1hsf22fq

国外用户:https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/

wget https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xvf gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
mv gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf /opt/
vim /etc/bash.bashrc
# add: PATH="$PATH:/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin"
source /etc/bash.bashrc
arm-linux-gnueabihf-gcc -v
sudo apt-get install device-tree-compiler

下载编译Uboot

git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-current
#or git clone https://github.com/Lichee-Pi/u-boot.git -b v3s-spi-experimental
cd u-boot
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero_800x480LCD_defconfig
#or make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero480x272LCD_defconfig
#or make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero_defconfig
make ARCH=arm menuconfig
time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 2>&1 | tee build.log

修改 include/configs/sun8i.h, 使u-boot可以直接从tf卡启动:

#define CONFIG_BOOTCOMMAND "setenv bootm_boot_mode sec; " \
"load mmc 0:1 0x41000000 zImage; " \
"load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb; " \
"bootz 0x41000000 - 0x41800000;"

#define CONFIG_BOOTARGS "console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0"

编译完成后,在当前目录下生成了u-boot-sunxi-with-spl.bin,可以烧录到8K偏移处启动。

3.kernel编译

网盘地址:http://pan.baidu.com/s/1hsf22fq

国外用户:https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/

wget https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xvf gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
mv gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf /opt/
vim /etc/bash.bashrc
# add: PATH="$PATH:/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin"
arm-linux-gnueabihf-gcc -v

下载编译linux源码

(默认是zero-4.10.y分支):

git clone https://github.com/Lichee-Pi/linux.git
cd linux
make ARCH=arm licheepi_zero_defconfig
make ARCH=arm menuconfig   #add bluethooth, etc.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 INSTALL_MOD_PATH=out modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 INSTALL_MOD_PATH=out modules_install

编译完成后,zImage在arch/arm/boot/下,驱动模块在out/下

4.rootfs编译

make menuconfig

make

5.烧录

将SD卡挂载到虚拟机

重新分区

注意别把自己硬盘格式化了

卸载并且删除所有分区

写Uboot:sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8

我把编译出来东西全放一起了,懒得再次去编译,文件系统搞一次要好久,截图的时候文件系统还在编译中

直接拷贝kernel

解压文件系统

弹出 sd卡

6.串口登录

这里要留意下,板子用的是串口0,不是串口I1,板子上串口1和串口2放在一起,之前一直忽略了串口0,导致一直以为设备没启动

  •                     <li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#csdnc-thumbsup"></use>
                        </svg><span class="name">点赞</span>
                        <span class="count"></span>
                        </a></li>
                        <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click='{"mod":"popu_824"}'><svg class="icon" aria-hidden="true">
    
  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值