Follow these steps to generate a reference design project.
- Go to c:\xapp1280_quad_spi. Double-click
run_kcu105.bat to run the batch file.
This batch file generates the Vivado IPI hardware project (project_1.xpr) and exports the created hardware to Vitis (project_1.vitis) under the project_1 directory. The following figure shows the project directory addition.
Tip: The project build takes approximately 90 minutes depending on host computer.
- Run the Vitis 2022.2 Integrated Design
Environment (IDE) launcher from the AMD Design
Tools. Ensure the workspace is selected as shown in the following figure and
click Launch.
- Create an application for the Quad SPI flash memory read and write access:
- Select Create Application Project.
- In the Create a New Application Project window, click Next.
- Select the Create a new platform from
hardware (XSA) tab and browse to select the
design_1_wrapper.xsa as shown
in the following figure.
- Click Next to open the applications project details window.
- Under Applications project name enter quad_spi_rw as shown in the
following figure.
- Click Next to select the domain for your project.
- Click Next on the Domain window
with settings as shown in the following figure.
- Select Empty Application (C) as
shown in the following figure.
- Click Finish.
- Right-click src and select
Import Sources as shown in
the following figure.
- Browse to the C:\xapp1280_quad_spi\source directory, select folder.
Then select the flash_qspi_rw.c and
lscript.ld.
- Click Finish to add both files to the project and then click Yes when asked to Overwrite the lscript.ld in the quad_spi_rw\src folder.
- Under the Vitis Explorer navigation pane right-click quad_spi_fw and select .
- (Optional Step) Review the MicroBlaze code:
In the Vitis project explorer double-click
flash_qspi_rw.c to open the file and
review the MicroBlaze code. This code controls
the UART/Tera Term command menu, defines the parameters of the SPI flash memory
and controls reads and writes to memory:
- The SPI flash memory commands and their definitions are located near the top of the code listing. The parameters and commands should match the targeted SPI flash memory device data sheet. The command sequences are described in Software System Details.
- Flash-sizing information is located under “Number of bytes per page in the flash device.” This information includes definitions for the flash memory page size, number of sectors, bytes per sector and other information. These parameters should match the data sheet values for the targeted SPI flash memory device.
- Descriptions of the functions that are used to build
each menu operation are located under ”Function Prototypes“. The low
level functions can be examined in detail by searching on the function
name in the file. At the lowest level, all the operations that are
needed for the flash memory can be created using six functions:
SpiFlashWriteEnable()
,SpiFlashWrite()
,SpiFlashRead()
,SpiFlashBulkErase()
,SpiFlashGetStatus()
, andSpiFlashQuadEnable()
.