flash烧写uboot举例

烧写uboot到QSPIFLASH

简述:主要是讲ZYNQ7000系列的烧写文件方法,衔接上文链接: Petalinux工具编译生成boot和kernel等流程

JTAG下载全部镜像到内存运行

以下操作在XSDK环境下运行

cd  C:/zedboard/zynq_hw/jtag-load
conn
targets -set -filter {name =~ "ARM* #0"}
rst
source ps7_init.tcl
ps7_init
dow  u-boot.elf
con

在串口上按下enter,停下

Stop
dow -data zImage 0x8000
dow -data uramdisk.image.gz 0x800000
dow -data devicetree.dtb 0x1000000
con

在终端输入运行:go 0x8000

烧写BOOT.bin到qspiflash

制作BOOT.bin(非petalinux环境需要通过XSDK制作BOOT.bin)
在这里插入图片描述
在XSDK的命令行中输入:

cd E:/images/V0.01/201702_hw_platform_0
conn
targets -set -filter {name =~ "ARM* #0"}
rst
source ps7_init.tcl
ps7_init
cd E:/images/V0.01
dow  u-boot.elf
dow -data BOOT.bin 0x1000000
con
sf probe 0 0 0
sf erase 0x0 0x00100000
sf write 0x1000000 0x0 0x00100000
//uboot+kernel生成的BOOT.BIN
sf probe 0 0 0
sf erase 0x0 0xC00000
sf write 0x1000000 0x0 0xC00000

直接烧写到qspiflash

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

u-boot下载kernel、设备树、文件系统到内存运行

在内存中运行时,必须要设备树和文件系统,否则提示错误。Uboot的运行地址是 0x4000000;fpga bit地址 0x100000;环境变量地址0x2000000 。

 setenv ipaddr 192.169.10.200
setenv serverip 192.169.10.105

tftpboot 0x2080000 uImage
tftpboot 0x2000000 devicetree.dtb
tftpboot 0x4000000 uramdisk.image.gz

/*启动程序地址,第一个为uImage,ramdisk地址,设备树地址,顺序不能反。*/
bootm 0x2080000 0x4000000 0x2000000 

制作文件系统(非petalinux环境需要制作文件系统)

$dd if=/dev/zero of=arm_ramdisk.image bs=1024 count=8192
$mke2fs -F arm_ramdisk.image -L "arm_ramdisk" -b 1024 -m 0
$tune2fs arm_ramdisk.image -i 0
$chmod a+rwx arm_ramdisk.image
$gzip arm_ramdisk.image
//包含uboot头文件
$ mkimage -A arm -T ramdisk -C gzip -d arm_ramdisk.image.gz uramdisk.image.gz

u-boot 烧写软件

通过tftp烧写整机软件

首先制作好整机烧写软件,通过tftp工具统一烧写,以生成的BOOT.BIN为例来说明烧写过程。

sf probe 0 50000000 0
sf erase 0x0 0xC00000       //擦除空间大小根据实际烧写软件大小决定;
tftpboot 0x1000000 BOOT.bin 
sf write 0x1000000 0x0 0xC00000

通过tftp烧写模块软件

qspiflash中镜像的地址规划,按照自身的规划来填写地址。

1、烧写u-boot.bin
sf probe 0 50000000 0
tftpboot 0x1000000 u-boot.bin
sf erase 0x0 0xc0000
sf write 0x1000000 0x0 0xc0000

2、烧写uImage
sf probe 0 50000000 0
tftpboot 0x1000000 uImage
sf erase 0x100000 0xf00000
sf write 0x100000 0x100000 0xf00000
sf write 0x100000 0x520000 0xa80000
device 0 offset 0x520000, size 0xa80000

3、烧写设备树
$ sf erase 0x600000 0x20000
$ sf read 0x2000000 0x00620000 0x20000
$ tftpboot 0x2000000 devicetree.dtb
$ sf write 0x2000000 0x00600000 0x20000

4、 烧写文件系统
$ sf erase 0x00620000 0x5e0000
$ sf read 0x4000000 0x00620000 0x5e0000
$ tftpboot 0x4000000 uramdisk.image.gz
$ sf write 0x4000000 0x00620000 0x5e0000

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

茶包不是trouble

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值