Cubietruck制作可启动SD卡(只测试uboot)

手上有个128M的sd卡,所以就只测试uboot

#---------------------------------------------------------------------------------------------------------------------------------#

下载uboot代码https://github.com/linux-sunxi/u-boot-sunxi.git,版本号v2014.04-rc2

#---------------------------------------------------------------------------------------------------------------------------------#

编译uboot

laptop:~$make Cubietruck_config

laptop:~$make CROSS_COMPILE=arm-linux-gnueabi- -j4

注意:

1.Cubietruck首字母大写

2.make CROSS_COMPILE=arm-linux-gnueabi- -j4中-j4表示job4(四核)

#---------------------------------------------------------------------------------------------------------------------------------#

启动代码写入SD卡

uboot父目录创建shell脚本writesdcard

#! /bin/sh
export card=/dev/sdb
export p=""
#To be on safe side erase the first part of your SD Card.
dd if=/dev/zero of=${card} bs=1M count=1
#Bootloader
dd if=u-boot-sunxi/spl/sunxi-spl.bin of=${card} bs=1024 seek=8
dd if=u-boot-sunxi/u-boot.img of=${card} bs=1024 seek=40

保存之后添加权限并(sudo)执行脚本

注意:

1.

export card=/dev/sdb
export p=""

是对应于USB插入的读卡器,详细内容参见http://linux-sunxi.org/Bootable_SD_card

#---------------------------------------------------------------------------------------------------------------------------------#

测试

1

SD卡插入Cubietruck

正确连接usb-ttl数据线——(黑接GND)(绿接RX)(白接TX)

2

打开虚拟窗口

laptop:~screen /dev/ttyUSB0 115200

3

连接Cubietruck电源

U-Boot SPL 2014.04-rc2-10390-g96510e1 (Apr 07 2014 - 21:24:32)
Board: Cubietruck
DRAM: 2048 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600

U-Boot 2014.04-rc2-10390-g96510e1 (Apr 07 2014 - 21:24:32) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: Cubietruck
I2C:   ready
DRAM:  2 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **

sun7i#

测试命令led all toggle

sun7i#led all toggle

观察led


成功!

参考:

http://linux-sunxi.org/Bootable_SD_card

http://linux-sunxi.org/Cubieboard/TTL

http://linux-sunxi.org/Toolchain

http://linux-sunxi.org/U-Boot#Compilation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值