zynq学习之程序固化SD卡和QSPI_FLASH

在进行zynq程序固话时需要注意的几点:

1. 在硬件中添加QSPI_FLASH模块

2. 修改QSPI的时钟到125M

3. 制作所要烧写的BOOT.bin文件,需要FSBL.elf、*.bit、*.elf三个文件

4. 创建新的工程FSBL_Loader;并生成fsbl_load.elf用于程序烧写。

选择模板:

注意:这里的fsbl_load.elf和制作BOOT.bin的FSBL.elf是不同的,不能混用。在main函数中需要增加代码:BootModeRegister = JTAG_MODE;

	/*
	 * Read bootmode register
	 */
	BootModeRegister = Xil_In32(BOOT_MODE_REG);
	BootModeRegister &= BOOT_MODES_MASK;

	/*
	 * add by zpy for boot
	 */
	BootModeRegister = JTAG_MODE;

5. 在使用2017.4版本时需要修改PC的环境变量:

计算机->属性->高级系统设置->高级->环境变量->新建环境变量

变量名:XIL_CSE_ZYNQ_UBOOT_QSPI_FREQ_HZ

变量值:10000000

6. 切换板子上的拨码开关到QSPI启动模式,连接仿真器进行烧写:

7. 烧写日志如下:(烧写的速度有点捉急)

****** Xilinx Program Flash
****** Program Flash v2017.4 (64-bit)
  **** SW Build 2086221 on Fri Dec 15 20:55:39 MST 2017
    ** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

Connecting to hw_server @ TCP:127.0.0.1:3121

WARNING: Failed to connect to hw_server at TCP:127.0.0.1:3121
Attempting to launch hw_server at TCP:127.0.0.1:3121

Connected to hw_server @ TCP:127.0.0.1:3121
Available targets and devices:
Target 0 : jsn-DLC9LP-00000000000000
	Device 0: jsn-DLC9LP-00000000000000-4ba00477-0

Retrieving Flash info...

Initialization done, programming the memory
BOOT_MODE REG = 0x00000001
WARNING: [Xicom 50-100] The current boot mode is QSPI.
If flash programming fails, configure device for JTAG boot mode and try again.
f probe 0 10000000 0


Performing Erase Operation...
Erase Operation successful.
INFO: [Xicom 50-44] Elapsed time = 11 sec.
Performing Blank Check Operation...
0%...10%...20%...40%...50%...60%...70%...90%...100%
INFO: [Xicom 50-44] Elapsed time = 98 sec.
Blank Check Operation successful. The part is blank.
Performing Program Operation...
0%...40%...50%...90%...100%
Program Operation successful.
INFO: [Xicom 50-44] Elapsed time = 85 sec.
Performing Verify Operation...
0%...10%...20%...40%...50%...60%...70%...90%...100%
INFO: [Xicom 50-44] Elapsed time = 97 sec.
Verify Operation successful.

Flash Operation Successful

cmd /C program_flash -f E:\vivado_demo\S05\zpy_DMA_LWIP_test_qspi\Image\BOOT.bin -offset 0 \
-flash_type qspi_single -fsbl \
E:\vivado_demo\S05\zpy_DMA_LWIP_test_qspi\Image\FSBL_load.elf -blank_check -verify -cable \
type xilinx_tcf url TCP:127.0.0.1:3121 

****** Xilinx Program Flash
****** Program Flash v2017.4 (64-bit)
  **** SW Build 2086221 on Fri Dec 15 20:55:39 MST 2017
    ** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

Connecting to hw_server @ TCP:127.0.0.1:3121

Connected to hw_server @ TCP:127.0.0.1:3121
Available targets and devices:
Target 0 : jsn-DLC9LP-00000000000000
	Device 0: jsn-DLC9LP-00000000000000-4ba00477-0

Retrieving Flash info...

Initialization done, programming the memory
BOOT_MODE REG = 0x00000001
WARNING: [Xicom 50-100] The current boot mode is QSPI.
If flash programming fails, configure device for JTAG boot mode and try again.
f probe 0 10000000 0


Performing Erase Operation...
Erase Operation successful.
INFO: [Xicom 50-44] Elapsed time = 11 sec.
Performing Blank Check Operation...
0%...10%...20%...40%...50%...60%...70%...90%...100%
INFO: [Xicom 50-44] Elapsed time = 101 sec.
Blank Check Operation successful. The part is blank.
Performing Program Operation...
0%...40%...50%...90%...100%
Program Operation successful.
INFO: [Xicom 50-44] Elapsed time = 87 sec.
Performing Verify Operation...
0%...10%...20%...40%...50%...60%...70%...90%...100%
INFO: [Xicom 50-44] Elapsed time = 100 sec.
Verify Operation successful.

Flash Operation Successful

cmd /C program_flash -f E:\vivado_demo\S05\zpy_DMA_LWIP_test_qspi\Image\BOOT.bin -offset 0 \
-flash_type qspi_single -fsbl \
E:\vivado_demo\S05\zpy_DMA_LWIP_test_qspi\Image\FSBL_load.elf -blank_check -verify -cable \
type xilinx_tcf url TCP:127.0.0.1:3121 

****** Xilinx Program Flash
****** Program Flash v2017.4 (64-bit)
  **** SW Build 2086221 on Fri Dec 15 20:55:39 MST 2017
    ** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

Connecting to hw_server @ TCP:127.0.0.1:3121

Connected to hw_server @ TCP:127.0.0.1:3121
Available targets and devices:
Target 0 : jsn-DLC9LP-00000000000000
	Device 0: jsn-DLC9LP-00000000000000-4ba00477-0

Retrieving Flash info...

Initialization done, programming the memory
BOOT_MODE REG = 0x00000001
WARNING: [Xicom 50-100] The current boot mode is QSPI.
If flash programming fails, configure device for JTAG boot mode and try again.
f probe 0 10000000 0


Performing Erase Operation...
Erase Operation successful.
INFO: [Xicom 50-44] Elapsed time = 12 sec.
Performing Blank Check Operation...
0%...10%...20%...40%...50%...60%...70%...90%...100%
INFO: [Xicom 50-44] Elapsed time = 100 sec.
Blank Check Operation successful. The part is blank.
Performing Program Operation...
0%...40%...50%...90%...100%
Program Operation successful.
INFO: [Xicom 50-44] Elapsed time = 87 sec.
Performing Verify Operation...
0%...10%...20%...40%...50%...60%...70%...90%...100%
INFO: [Xicom 50-44] Elapsed time = 101 sec.
Verify Operation successful.

Flash Operation Successful

 

  • 2
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值