全志V3S学习笔记(一)sd卡制作

全志V3S学习笔记(一)sd卡制作


准备工作

VMwave15.5 PRO
Ubuntu16.04LTS
SD卡
SD卡读卡器
linux-zero-5.2.y.zip
u-boot-v3s-current.zip
buildroot-2017.08.tar.gz
gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz
Gparted
链接:
VMwave15.5 PRO和Ubuntu16.04LTS 自己网上下吧,版本不同应该不影响
链接:https://pan.baidu.com/s/1dSB9ZGjThztQ2xucConoCA
提取码:vzg9
Gparted 在linux app里面有,可以直接下

一、交叉编译器安装

参考正点原子的安装方法。
sudo cp gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz /opt/ -f
sudo tar -vxf gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz
sudo vi /etc/profile		//修改环境变量
文件最后添加
export PATH=$PATH:/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin

在这里插入图片描述

reboot
arm-linux-gnueabihf-gcc -v   查看编译器

在这里插入图片描述

二、uboot安装

unzip u-boot-v3s-current.zip	//解压
cd u-boot						//进入文件

添加下面代码到 include/configs/sun8i.h

#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"
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero_defconfig    
// make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero_800x480LCD_defconfig    //可选
//make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LicheePi_Zero480x272LCD_defconfig     //可选

make ARCH=arm menuconfig (需要先安装ncurses)//默认不修改 ESC推出就好
/* ncurses安装
sudo apt-get install build-essential
sudo apt-get install libncurses5-dev
*/
time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 2>&1 | tee build.log
编译生成u-boot-sunxi-with-spl.bin文件

三. kernel内核

unzip linux-zero-5.2.y.zip
cd linux-zero-5.2.y
make ARCH=arm licheepi_zero_defconfig
make ARCH=arm menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j2
//make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -jx(x=linux系统的处理器个数,也可以删掉-jx,但编译速度慢)

在这里插入图片描述

四、根文件系统

tar xvf buildroot-2017.08.tar.gz
cd buildroot-2017.08 
make menuconfig

配置如下
Targe options
在这里插入图片描述
Toolchain
在这里插入图片描述
按上图配置好,用户名默认是root,密码默认没有,要改自己研究

make clean
make

五、SD卡制作

先把SD卡连接到linux上,再打开GParted
不要把磁盘删了
在这里插入图片描述
SD卡解锁
在这里插入图片描述
删除磁盘分区
在这里插入图片描述
添加SD卡分盘
在这里插入图片描述
创建第一个分区,16M大小
在这里插入图片描述
创建第二个分区,剩下的全部空间都给这个分区
在这里插入图片描述
保存应用
在这里插入图片描述

六、整合

内核拷贝

cd linux-zero-5.2.y
cp arch/arm/boot/zImage /media/用户名/BOOT
cp arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dtb /media/用户名/BOOT
cp arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dtb /media/用户名/BOOT

在这里插入图片描述

根文件系统解压

cd buildroot-2017.08/output/images
sudo tar xvf rootfs.tar -C /media/用户名/fs

uboot写入

cd uboot
ls /dev/sd*  //查看sd卡的盘符

我这里是sdb,不确定的话,拔了看一次,插入看一次,看多了哪个,有的可能是sdc,sdd
在这里插入图片描述
其中sdX为SD卡的盘符

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

有没有成功可以看速度,如果速度大于100MB/S,那就是不成功
在这里插入图片描述

参考

荔枝派zero指南.

挖坑网SD卡制作.

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值