赞
踩
Vivado 2018.3、xc7z015clg485-2、小梅哥FPGA开发板、BOOT.bin(这个文件包含了bitstream文件,工程.elf,和FSBL.elf)、正点原子领航者《41_qspi_update_tcp》例程。
学习了《小梅哥——ZYNQ程序固化》和《正点原子(领航者)——第四十二章 基于TCP协议的远程更新QSPI Flash实验》我想通过tcp对小梅哥的开发板进行远程更新,但是更新完无法启动。
1、移植了正点原子的例程,适配自己的程序,例程就是通过tcp把BOOT.bin文件发送到PS端,存在了一个16M的数组里面。“update”进行更新,例程的程序还包含了擦除FLASH,写入FLASH,将读和写FLASH的数据进行校验,这都没问题。在JTAG模式下,烧写程序,进行验证。
2、烧完程序后断电,将启动模式改为QSPI FLASH模式。发现任何打印都没有,而且正常情况下我的PL端D3(蓝色)是亮的,现在灯没亮。
3、分析了正常固化程序的“Console”信息。也没看出啥来。
3、怀疑可能是卡在了启动过程中。
4、查看手册UG585看了一下启动:
5、搜索文章发现可以通过FSBL的方式进行调试:
在xxxxxfsbl/src/fsbl_debug.h中添加#define FSBL_DEBUG_INFO,打开FSBL中所有的调试信息,启动过程中会打印各种调试信息,看看启动具体卡在哪里。
调试过程:左图为远程更新的;右图为正常固化程序的。
6、搜索打印发现DMA Done!在FSBL/src/pcap.c中:
- /*
- * Poll for the DMA done
- */
- Status = XDcfgPollDone(XDCFG_IXR_DMA_DONE_MASK, MAX_COUNT);
- if (Status != XST_SUCCESS) {
- fsbl_printf(DEBUG_INFO,"PCAP_DMA_DONE_FAIL \r\n");
- return XST_FAILURE;
- }
-
- fsbl_printf(DEBUG_INFO,"DMA Done ! \n\r");
-
- /*
- * Poll for FPGA Done
- */
- Status = XDcfgPollDone(XDCFG_IXR_PCFG_DONE_MASK, MAX_COUNT);
- if (Status != XST_SUCCESS) {
- fsbl_printf(DEBUG_INFO,"PCAP_FPGA_DONE_FAIL\r\n");
- return XST_FAILURE;
- }
-
- fsbl_printf(DEBUG_INFO,"FPGA Done ! \n\r");
-
- /*
- * Check for errors
- */
- IntrStsReg = XDcfg_IntrGetStatus(DcfgInstPtr);
- if (IntrStsReg & FSBL_XDCFG_IXR_ERROR_FLAGS_MASK) {
- fsbl_printf(DEBUG_INFO,"Errors in PCAP \r\n");
- return XST_FAILURE;
- }
也就是程序卡在了
Status = XDcfgPollDone(XDCFG_IXR_PCFG_DONE_MASK, MAX_COUNT);
但是这个也没有“PCAP_FPGA_DONE_FAIL”打印。
7、那也就是卡在了函数XDcfgPollDone内部。XDcfgPollDone
- /******************************************************************************/
- /**
- *
- * This function Polls for the DMA done or FPGA done.
- *
- * @param none
- *
- * @return
- * - XST_SUCCESS if polling for DMA/FPGA done is successful
- * - XST_FAILURE if polling for DMA/FPGA done fails
- *
- * @note none
- *
- ****************************************************************************/
- int XDcfgPollDone(u32 MaskValue, u32 MaxCount)
- {
- int Count = MaxCount;
- u32 IntrStsReg = 0;
-
- /*
- * poll for the DMA done
- */
- IntrStsReg = XDcfg_IntrGetStatus(DcfgInstPtr);
- while ((IntrStsReg & MaskValue) !=
- MaskValue) {
- IntrStsReg = XDcfg_IntrGetStatus(DcfgInstPtr);
- Count -=1;
-
- if (IntrStsReg & FSBL_XDCFG_IXR_ERROR_FLAGS_MASK) {
- fsbl_printf(DEBUG_INFO,"FATAL errors in PCAP %lx\r\n",
- IntrStsReg);
- PcapDumpRegisters();
- return XST_FAILURE;
- }
-
- if(!Count) {
- fsbl_printf(DEBUG_GENERAL,"PCAP transfer timed out \r\n");
- return XST_FAILURE;
- }
- if (Count > (MAX_COUNT-100)) {
- fsbl_printf(DEBUG_GENERAL,".");
- }
- }
-
- fsbl_printf(DEBUG_GENERAL,"\n\r");
-
- XDcfg_IntrClear(DcfgInstPtr, IntrStsReg & MaskValue);
-
- return XST_SUCCESS;
- }
看5中的图片,打印了一堆"..................",那也就是说读寄存器计数超次数了。
8、查了一下XDCFG_IXR_PCFG_DONE_MASK看看:
搜索发现跟PCAP有关系,然后搜索到了一篇文章跟我这个情况一样:
Zynq FSBL 在“DMA 完成”后卡住了! (xilinx.com)
但是答复没有效果。不过我有个想法是可以尝试一下SD启动模式,把这个BOOT.bin文件拷到SD卡里,然后试试。
9、又搜到另一个文章:Zynq MPSoC 更换GD25Q128/MX25L128/W25Q128等低容量SPI FLASH无法启动分析与解决_gd25q128烧录-CSDN博客
尝试通过xsct对BootROM Error Codes查询,查询寄存器CSU_BR_ERROR的[15:0],寄存器地址为0x00FFD80528。
这个寄存器访问不到。而且这个文章是因为QSPI的启动模式的问题。所以问题不在这
10、打开这个:
前半部分是JTAG模式下打印信息,后边是QSPI模式下打印信息。尝试跟9这个链接去做,做不到一样的,因为我这个是2018.3这个版本还是xilinx SDK,他那个是新版的,是vitis。遂感觉这个方式不行;查询寄存器值的方式不行。
- DESKTOP-OS9OCBQ 15:53:21
- Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0xffffff28 (Suspended)
- Info: ARM Cortex-A9 MPCore #1 (target 3) Stopped at 0xffffff34 (Suspended)
-
- initializing
- 0% 0MB 0.0MB/s ??:?? ETA
- 35% 1MB 2.3MB/s ??:?? ETA
- 64% 2MB 2.1MB/s ??:?? ETA
- 90% 3MB 2.0MB/s ??:?? ETA
- 100% 3MB 2.0MB/s 00:01
-
- Downloading Program -- C:/Users/jlny/Desktop/ads1605_tcp_ddr3_V4.5/ad9238_udp_ddr3.sdk/ad_ddr3_tcp/Debug/ad_ddr3_tcp.elf
- section, .text: 0x00100000 - 0x00125983
- section, .init: 0x00125984 - 0x0012599b
- section, .fini: 0x0012599c - 0x001259b3
- section, .rodata: 0x001259b8 - 0x00126d13
- section, .data: 0x00126d18 - 0x00127ad7
- section, .eh_frame: 0x00127ad8 - 0x00127adb
- section, .mmu_tbl: 0x00128000 - 0x0012bfff
- section, .ARM.exidx: 0x0012c000 - 0x0012c007
- section, .init_array: 0x0012c008 - 0x0012c00b
- section, .fini_array: 0x0012c00c - 0x0012c00f
- section, .bss: 0x00200000 - 0x0300812f
- section, .heap: 0x03008130 - 0x0300a12f
- section, .stack: 0x0300a130 - 0x0300d92f
-
- 0% 0MB 0.0MB/s ??:?? ETA
- 90% 0MB 0.3MB/s ??:?? ETA
- 100% 0MB 0.3MB/s 00:00
-
- Setting PC to Program Start Address 0x00100000
- Successfully downloaded C:/Users/jlny/Desktop/ads1605_tcp_ddr3_V4.5/ad9238_udp_ddr3.sdk/ad_ddr3_tcp/Debug/ad_ddr3_tcp.elf
- Info: ARM Cortex-A9 MPCore #0 (target 2) Running
- Info: tcfchan#5 closed
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xsct% connect
- attempting to launch hw_server
-
- ****** Xilinx hw_server v2018.3
- **** Build date : Dec 7 2018-00:40:27
- ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
-
- INFO: hw_server application started
- INFO: Use Ctrl-C to exit hw_server application
-
-
-
- ****** Xilinx hw_server v2018.3
-
- **** Build date : Dec 7 2018-00:40:27
-
- ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
-
-
-
- INFO: hw_server application started
-
- INFO: Use Ctrl-C to exit hw_server application
-
-
-
-
- INFO: To connect to this hw_server instance use url: TCP:127.0.0.1:3121
-
-
-
- tcfchan#6
- xsct% targets
- 1 APU
- 2* ARM Cortex-A9 MPCore #0 (Running)
- 3 ARM Cortex-A9 MPCore #1 (Running)
- 4 xc7z015
- xsct% targets -set -filter {name =~ "Cortex-A9 #0"}
- xsct% no targets found with "name =~ "Cortex-A9 #0"". available targets:
- 1 APU
- 2* ARM Cortex-A9 MPCore #0 (Running)
- 3 ARM Cortex-A9 MPCore #1 (Running)
- 4 xc7z015
-
- targets -set -filter {name =~ "Cortex-A9 MPCore #0"}
- xsct% no targets found with "name =~ "Cortex-A9 MPCore #0"". available targets:
- 1 APU
- 2* ARM Cortex-A9 MPCore #0 (Running)
- 3 ARM Cortex-A9 MPCore #1 (Running)
- 4 xc7z015
-
- targets -set -filter {name =~ "ARM Cortex-A9 MPCore #0"}
- xsct% rst -processor
- Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0x0 (Vector Catch)
- xsct% mrd -force 0x00FFD80528
- xsct% Memory read error at 0xFFD80528. AP transaction timeout
-
- Info: ARM Cortex-A9 MPCore #0 (target 2) Running
- xsct% targets -set -filter {name =~ "*A9 MPCore #1"}
- no targets found with "name =~ "*A9 MPCore #1"". available targets:
- 5 whole scan chain (incomplete IR length definition)
-
- xsct% rst -processor
- xsct% unsupported reset
-
- targets -set -filter {name =~ "ARM Cortex-A9 MPCore #1"}
- xsct% no targets found with "name =~ "ARM Cortex-A9 MPCore #1"". available targets:
- 5 whole scan chain (incomplete IR length definition)
-
- targets -set -filter {name =~ "ARM Cortex-A9 MPCore #1"}
- xsct% no targets found with "name =~ "ARM Cortex-A9 MPCore #1"". available targets:
- 5 whole scan chain (incomplete IR length definition)
-
11、问题查找卡到了第10步,然后11想尝试一下SD卡启动模式。把BOOT.bin通过读卡器拷贝到SD里,切换到SD卡启动,确实好使,但是不是我想要的啊!!!!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。