ZU+ Example - PM Hello World (for Vitis 2019.2 onward)

Table of Contents

Prerequisites

  1. You have a ZCU102 development board.

  2. You have used the Vitis to build.

PM Hello World

This is an empty application that does PM initialization and prints "Hello World!" to the UART. Please use this as a starting point for creating new PM applications for other design examples provided here.

Steps to create and build this example

  1. Download these source files: hello_source_2019.2.zip

  2. Extract the zip file. The source directory contains application main.c file and other required files.

  3. Start Xilinx Vitis Software.

  4. Create application project from project menu.

  5. Click on next if welcome page is displayed

  6. Create platform from fixed XSA file by selecting “Create a new platform from hardware (XSA)“

  7. Give XSA file path as below:

    • <Vitis installation path>/Vitis/2020.1/data/embeddedsw/lib/fixed_hwplatforms/zcu102.xsa

  8. Click on next to add application project details.

  9. Give an application project name Ex. hello_world.

  10. Select appropriate target processor (e.g., psu_cortexr5_0) from processor list. Then click on next.

  11. Select empty application from the template then select finish to create project.

  12. Now from hello_world.prj file click on “Navigate to BSP Settings“ to change BSP settings.

  13. Click on “Modify BSP Settings…“

  14. Select “xilpm” library from Board Support Package Settings dialog box and click OK. Re-generate BSP Sources.

  15. Now right click on hello-world from Project Explorer window, select “Properties” from drop-down menu and go to “Resource”. A location of the project will be displayed.

  16. Go to that location, a folder named “src” will be present. Copy all the files extracted from source.zip file into “src” folder. Refresh the project by right clicking on hello-world from Project Explorer and selecting refresh option.

  17. From the Project Explorer window, right click on hello-world, select Properties, expand C/C++ General, and go to Paths and Symbols.

  18. Add “/hello-world/src” path in includes section. Click OK.

  19. To build project right click on hello-world from Project Explorer window, select “Build Project“ to build project.

     

Configuration Object

Configuration Object file Generated by PetaLinux tool chain and Vivado is attached below.
pm_cfg_obj.c

Note: Add this file in the src folder of the application in order to use configuration object.

Subsystems -

Linux Subsystem

Master -

  1. APU

Slaves -

  1. DDR

  2. L2 Cache

  3. OCM Bank 0, 1, 2 and 3

  4. I2C0

  5. I2C1

  6. SD1

  7. QSPI

  8. PL

R5-0 Subsystem

Master -

  1. RPU0

Slaves -

  1. TCM Bank 0 - A

  2. TCM Bank 0 - B

R5-1 Subsystem

Master -

  1. RPU1

Slaves -

  1. TCM Bank 1 - A

  2. TCM Bank 1 - B

RPU to run from TCM

By default, RPU applications are compiled to run from the DDR memory. In many cases, it may be desirable to run RPU applications from the TCM. For example, when the APU is not running, the RPU may run from the TCM so that the DDR can be powered down or put into retention mode to save power.

Steps to modify code memory

  1. Open lscript.ld file.

  2. Navigate to "Section to Memory Region Mapping" and select "psu_r5_0_atcm_MEM_0" memory region for all sections as shown below.
    (Default HDF has split mode, So RPU will run in split mode. If RPU running in split mode than user has to select "psu_r5_0_atcm_MEM_0" or "psu_r5_0_btcm_MEM_0". If RPU running in lock step mode than user has to select "psu_r5_tcm_ram_0_MEM_0".)

  3. If RPU is running in split mode, it may happen that application doesn't fit into default memory region. For that user may need to divide the sections for ATCM and BTCM memory regions in lscript.ld file. For more information please see Table 4-5: TCM Address Map in TRM. When running in split mode, each R5 processor has 64KB ATCM and 64KB BTCM. So user has to divide sections across ATCM and BTCM as per below snapshot (vectors and text sections are in ATCM and other sections are in BTCM)

  4. Save lscript.ld file and clean build the project.

Note: To run this example on board, FSBL and PMU needs to be run along with application elf.