Debugging - XAPP1372

Host Programming of QSPI Flash Host Programming of QSPI Flash (XAPP1372)

Document ID
XAPP1372
Release Date
2022-10-04
Revision
1.1 English

Hardware Environment Setup

  1. Some PCs might require Above 4G Memory Assignment and Resizable BAR Support to be set in the BIOS Configuration tab.

  2. Build the VCK190 project (refer to the readme.txt file in the reference design to build the VCK190 project). Download the PDI file through the Vivado hardware manager and check the PCIe link status.

  3. On the host side, use the lspci command to get the BAR address. Then use the devmem command to try to read and write the BAR spaces successfully.

Software Debugging

To compile the host application, select a directory and launch the application source code to this directory. Then compile the application by running the Makefile on an X86 host.

> make

Three objects are generated, as shown in the following table.

Table 1. Objects Generated by Running Makefile
Object Description
main This executable file programs and verifies the 128 Mb flash.
program_only This executable file programs the 128 Mb flash.
debug This executable file programs the 128 Mb flash. At the same time, it opens the debug switch and prints all the debug logs.

Then run the executable files on the host. The following figure shows the log for the programming and verification of the 128 MB flash.

Figure 1. Programming and Verification of 128 MB Flash

The following figure shows the log from programming the 128 MB flash.

Figure 2. Programming of 128 MB Flash

Performance

Programming the 128 MB image takes 193 seconds, which is 3 minutes 13 seconds. Comparing the two sets of performance results shown in the following table, it can be determined that there is a linear relation between time and programming size. For example, 48s x 4 = 192s, which is almost 193s.

Thus, 128 MB flash programming takes four times as long as 32 MB flash programming.

Programming + verify takes more time during this process. It is obvious that the verify time increases in a linear manner with the programming size.

Table 2. Host Programming Performance
Operation Size (MB) Time (s) Description
Programming only 32 48 Read Flash ID, Erase Flash, and Write Flash
Programming only 64 97
Programming only 128 193
Programming + Verify 32 99

Read Flash ID, Erase Flash, and Write Flash

Then Read Flash content and Compare

Programming + Verify 64 197
Programming + Verify 128 394