2021年3月15日星期一

Zynq Program the SPI Flash

Prerequisite

1) In Vivado, enable the UART component in "Zynq7 Processing System" to output the UART message

2) Ensure the DDR memory interface is setup correctly

3) Ensure the "Processor System Reset" Component is also included in the block design

4) Verify the wire connection in the block design


Export Hardware and Bitstream

1) In Vivado 2020, Select File > Export > Export Hardware...

2) Select 'Include bitstream'

3) Select 'Tools' > 'Launch Vitis IDE'

4) It will generates XSA file and bitstream file


Create Application Project FSBL (Optional)

1) In Vitis, Select 'File' > 'New' >'Application Project'

2) Select the XSA file

3) Named 'fsbl', select as standalone project, and choose FSBL

project example


Create Application Project Hello World

1) In Vitis, Select 'File' > 'New' > 'Application Project'

2) Select the XSA file

3) Named 'hello_world', select as standalone project, and choose Hello World project example


Build and Run the Hello World Project Example

1) Run the hello world project to ensure the UART message is shown correctly


Create Boot Image

1) Select 'Xilinx' > 'Create Boot Image'

2) Specify a destination folder in order to export the merged boot image file (.bin)

3) Select (Bootloader) and the fsbl file (.elf). The default fsbl is located at (application_project)/(project_name)/zynq_fsbl/fsbl.elf

4) Select (datafile) and the bit stream file (.bit) which is located at (xsa_dir)/.runs/impl_1/

5) Select (datafile) and the generated hello_world file (.elf)

Both in sequential order (FSBL -> bit stream -> hello_world)

6) Select 'Create Image'


Program Flash

1) Make sure all debugger breakpoints are removed because Vitis will switch to debug perspective to program the Flash

2) Select 'Xilinx' > 'Program Flash'

3) Select the boot image file (.bin)

4) Ensure the flash type is selected correctly (my evaluation board: qspi-x4-single)

5) Ensure the JTAG mode (jumper) is selected on board

6) Check 'Verify after flash' if necessary

7) Select 'Program'


Verify the program is running correctly

1) Ensure the SPI Flash jumper is selected

2) Press the reset button / Perform cold reset

3) The UART message should be shown in the serial console terminal




沒有留言:

發佈留言