5.6.5. Adding an Application Image
Complete the following steps to add an application image to flash memory:
- Set up exclusive access to the AS x4 interface and flash memory by running the QSPI_OPEN and QSPI_SET_CS commands in the Tcl Console window. You now have exclusive access to the AS x4 interface and flash until you relinquish access by running the QSPI_CLOSE command. Write the new application image to the flash memory using the QSPI_WRITE command.
- Alternatively, the rsu1.tcl script includes the program_flash function that programs a new application image into flash memory. The following command accomplishes this task:
program_flash new_application_image.rpd 0x03FF0000 1024
The program_flash function takes three arguments:
Figure 80. Program New Application Image
- The .rpd file to write to flash memory.
- The start address.
- Number of words to write for each QSPI_WRITE command. The QSPI_WRITE supports up to 1024 words per write instruction.
$ source rsu1.tcl /channels/local/top/master_1 $ program_flash new_application_image.rpd 0x03ff0000 1024 total number of words is 584704 total number of page is 571 total number of sector is 36 reading rpd is completed start writing flash writing flash is completed
- Write the new application image start address to a new image pointer entry in the configuration firmware pointer block (CPB) using the QSPI_WRITE command. Ensure that the new image pointer entry value is 0xFFFFFFFF before initiating the write.
Note: When using HPS to manage RSU, you must update both copies of the Configuration Pointer Block (CPB0 and CPB1) and the sub-partition table (SPT). In a non-HPS case, while updates to both copies of the pointer blocks are mandatory, the updates to the sub-partition table are not required. For more details about the SPT and CPB, refer to Sub-partition Table Layout for the sub-partition table layout and Pointer Block Layout for the pointer block layout.
- Start address
- Number of words to read
$ qspi_read 0x004a0020 1 0x004b0000 $ qspi_read 0x004a0028 1 0xffffffff % qspi_read 0x004a8020 1 0x004b0000 % qspi_read 0x004a8028 1 0xffffffff
- The value of the word
% qspi_write_one_word 0x004a0028 0x02000000 % qspi_write_one_word 0x004a8028 0x02000000
You can now do a QSPI_read function to the next image pointer entry to ensure that it is written with the start address of the desired new application image.
Verifying the Update to the New Image Pointer
% qspi_read 0x004a0028 1 0x02000000 % qspi_read 0x004a8028 1 0x02000000
Host software can now reconfigure the Intel® Agilex™ FPGA with the new application image by asserting the nCONFIG pin. Alternatively, you can power cycle the PCB. After reconfiguration, check the current image address. The expected address is 0x03ff0000. After adding a new image, your application image list includes the newly added application image and the old application image, which is now a secondary image. The newly added application image has the highest priority.
Did you find the information on this page useful?