Visible to Intel only — GUID: ylc1521916204389
Ixiasoft
Visible to Intel only — GUID: ylc1521916204389
Ixiasoft
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:
- 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.
Figure 83. Program New Application Image$ source rsu1.tcl /channels/local/top/master_1 $ program_flash new_application_image.rpd 0x03ff0000 1024 total number of words is 458752 total number of page is 448 total number of sector is 28 reading rpd is completed start erasing flash erasing flash 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 Table 1 for the sub-partition table layout and Table 1 for the pointer block layout.
CPB Start Address + 0x20 | Content | Value |
---|---|---|
CPB0 + 0x20 = 0x002E4020 | Current application image pointer entry (highest priority) | 0x002F4000 |
CPB0 + 0x28 = 0x002E4028 | Next image pointer entry | 0xFFFFFFFF |
CPB1 + 0x20 = 0x002EC020 | Current application image pointer entry (highest priority) | 0x002F4000 |
CPB1 + 0x28 = 0x002EC028 | Next image pointer entry | 0xFFFFFFFF |
CPB Start Address + 0x20 | Content | Value |
---|---|---|
CPB0 + 0x20 = 0x004A0020 | Current application image pointer entry (highest priority) | 0x004B0000 |
CPB0 + 0x28 = 0x004A0028 | Next image pointer entry | 0xFFFFFFFF |
CPB1 + 0x20 = 0x004A8020 | Current application image pointer entry (highest priority) | 0x004B0000 |
CPB1 + 0x28 = 0x002EC028 | Next image pointer entry | 0xFFFFFFFF |
- Start address
- Number of words to read
$ qspi_read 0x002e4020 1
0x002f4000
$ qspi_read 0x002e4028 1
0xffffffff
% qspi_read 0x002ec020 1
ISR is empty
0x002f40000
% qspi_read 0x002ec028 1
0xffffffff
- Address
- The value of the word
% qspi_write_one_word 0x002e4028 0x03ff0000
% qspi_write_one_word 0x002ec028 0x03ff
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 0x002e4028 1
0x03ff0000
% qspi_read 0x002ec028 1
0x03ff0000
Host software can now reconfigure the Intel® Stratix® 10 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.