专栏首页hankUpgrade Zynq-7000 XIP reference design to Xilinx SDK 2018.3

Upgrade Zynq-7000 XIP reference design to Xilinx SDK 2018.3

付汉杰

1. Introduction

Xilinx provided reference design Zynq-7000 AP SoC Boot - Booting and Running Without External Memory that is helpful to run application in OCM for embedded system without DDR. It was upgraded to Vivado/SDK 2017.3.

Many customers use Xilinx 2018.x/2019.x tools now. So, I upgrade it to 2018.3. Its portability is also improved by reorganizing the source code.

  • The new design does not modify the source code in the BSP project.
  • All files including customized code are in the application project.
  • All modifications are encompassed by one Macro 'DDRLESS_XIP_SYSTEM'.

It would be much easy to port it to latest Xilinx tools and other boards.

2. Vivado project

We can use any Vivado project that disables PS DDR controller of Zynq-7000. One AXI timer with name is 'axi_timer_0' should be added in order to run the C application project in the reference design Zynq-7000 AP SoC Boot - Booting and Running Without External Memory.

The reference design, Zynq-7000 AP SoC Boot - Booting and Running Without External Memory, also provided TCL script files 'project.tcl' and 'system_top.tcl' to recreate the hardware project. The string '2017.3' should be replaced with '2018.3' in the script file before we recreate the hardware project Because it is created by Vivado 2017.3 and Vivado 2018.3 is used now.

It is easy to create project for Xilinx Dev. Kit by applying board preset setting. Then we enable GP0 AXI master port, add one PL AXI timer to the block design, and connect its interrupt line to 'IRQ_F2P[0:0]'. Finally, we leverage Vivado's 'run connection automation' to connect the AXI timer to GP0 port. Please check that the AXI timer's name is 'axi_timer_0'.

MicroZed project

We need disable its DDR controller in Vivado project, generate the output products for the block design and export HDF file.

One HDF file is provided for MicroZed 7010 board in the attached files. It can also work with MicroZed 7020 board. Its hardware project can be recreated by executing its TCL script in Vivado console.

3. FSBL

The following files are modified for FSBL of XIP reference design.

fsbl.h
fsbl_handoff.S
fsbl_hooks.c
fsbl_hooks.h
image_mover.c
image_mover.h
lscript.ld
main.c
pcap.c
pcap.h
qspi.c
qspi.h
translation_table.S
xil_exception.c

They are in the directory 'src' of FSBL project. Please note that the FSBL use normal FSBL BSP project now. Create one new FSBL project and copy aforementioned files from directory "ddrless_xip_package\fsbl_xip\src" to the directory 'src' of FSBL project. Click 'Yes' when SDK asks whether to overwrite existing files. And add macros 'FSBL_DEBUG_INFO' and 'DDRLESS_XIP_SYSTEM' in the project settings.

Add macro definition

4. C Application

The following files are created or modified for C Application of XIP reference design.

Application.c
lscript.ld
startup.s
TimerApp.c
xil_exception.c

They are in the directory 'src' of C Application project. Please note that the C Application use normal C/C++ Application BSP project now. Create one new empty C Application project, remove file 'lscript.ld', then copy aforementioned files from directory "ddrless_xip_package\Application\src" to the directory 'src' of C Application project. Overwrite existing files if original files are not deleted.

5. C++ Application

The following files are created or modified for C++ Application of XIP reference design.

app.cc
copyRO.cc
cpu_init.S
lscript.ld
startup.s
xil_exception.c

They are in the directory 'src' of C++ Application project. Please note that the C++ Application use normal C/C++ Application BSP project now. Please create one new empty C++ Application project, remove source code files and linker script files, and copy aforementioned files from directory "ddrless_xip_package\Application_Cpp\src" to the directory 'src' of C++ Application project.

6. Create boot file

When we create boot file, we must declare that FSBL works in XIP mode, specify each components's flash address that must match the flash address used by linker script. FSBL's Flash address starts at 0x2000, Application's Flash address starts at 0x700000 in this example. So we declare them in the 'bootgen.bif'.

6.1. Example of bootgen.bif

//arch = zynq; split = false; format = BIN
the_ROM_image:
{
	[bootloader, xip_mode, offset = 0x2000]C:\prj\fsbl_xip_v183.elf
	[offset = 0x200000]C:\prj\design_noddr_wrapper.bit
	[offset = 0x700000]C:\prj\Application.elf
}

One example bootgen.bif is provided for both C/C++ applications. Please check it if you encounter problem about booting.

7. Tips

7.1. Add 'xip_mode' manually.

SDK 2018.3 bootimage wizard removes 'xip_mode' after one new file is specified for the boot file. We must add 'xip_mode' to the '.bif' file manually before we create boot file. Otherwise the boot file fails to boot. There may not be any string printed out by FSBL in the UART console.

7.2. Debugging

We cannot debug the XIP code in single-step mode.

Please debug the application in DDR and make it works well in advance. You can also refer to project "ddrless_xip_package\Application_normal" that has same functionality of the project 'Application'. We can debug it in single-step mode because it runs in DDR.

7.3. FSBL compilation error

We get the following error when we compile FSBL. It can be ignored.

ld.exe: FSBL_XIP.elf: section `.data' can't be allocated in segment 0

7.4. C++ Application compilation error

We get the following error when we compile C++ Application. It can be ignored.

ld.exe: Application_Cpp.elf: section `.data' can't be allocated in segment 0

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • ZCU106使用VCU TRD的MIPI的例子

    在ZCU106上,使用VCU TRD的MIPI的例子,可以从MIPI摄像头采取图像数据,并使用GStreamer推送到HDMI显示器上。

    hankfu
  • 【分享】MPSoC SWDT在Standalone下的应用

    Hank Fu (付汉杰) Staff FAE embedded, Xilinx, Inc. hankf@xilinx.com

    hankfu
  • 【分享】MPSoC UBoot下SD/eMMC卡的验证

    使用eMMC启动时,可以参考Xilinx的AR 67157烧写,也可以直接使用Vitis烧写。Vitis 2020.2 可以直接烧写eMMC设备。 烧写完成后...

    hankfu
  • ACDER:增强好奇心驱动的体验重播(RO AI)

    在稀疏反馈的环境中进行探索仍然是强化学习(RL)中一个具有挑战性的研究问题。当RL代理随机探索环境时,会导致探索效率低下,尤其是在具有高维连续状态和动作空间的机...

    田冠宇
  • 使用xtrabackup完成远程备份 转

    (adsbygoogle = window.adsbygoogle || []).push({});

    阿dai学长
  • Python中文社区开源项目计划:forward

    Python中文社区
  • The Big Shift In Blockchain Technology And Its Consequences

    After a successful year of Blockchain campaign in 2019, what more should we expe...

    用户4822892
  • 【译】助你成功搭建云应用的12条方法

    原文作者:Rafael Benevides 原文地址:https://dzone.com/articles/12-factors-to-cloud-succes...

    李郑
  • Dozer数据对象转换神器

    首先,为什么要进行数据转换? 在一个分层的体系结构中,经常会使用DTO、PO、VO等封装数据,封装数据到特定的数据对象中,然而在很多情况下,某层内部的数据是不允...

    JavaQ
  • Ubuntu 16.04安装 cuda 9.2

    drunkdream

扫码关注云+社区

领取腾讯云代金券