In-Application Programming Using PCIe Interface
DG0584 Demo Guide Revision 5.0 6
• pcie_iap_top.spi: This is the .spi file format version of the pcie_iap_top.stp file provided in
<download_folder>\sf2_iap_using_interface_demo_df\stapl_programming_file.
Note: For more information on generating .spi programming files, see Appendix: Generating .spi Programming
File using Libero, page 25.
2.3.2 IAP Execution Flow
Browse to the .spi programming file and click WRITE in the GUI. The GUI application running on the host
PC starts communicating with the SmartFusion2 device using the PCIe interface. On connecting with the
SmartFusion2 device, the GUI sends the programming file size to the Cortex-M3 processor user
application and requests to erase the external SPI Flash contents available on the SmartFusion2
Security Evaluation Kit for storing the bitstream data. The Cortex-M3 processor user application receives
the bitstream data from the GUI through the PCIe interface and stores the data into the SPI Flash. The
GUI application copies 2 KB bitstream data from the programming file to the host PC buffer. The Cortex-
M3 processor user application reads the bitstream data from the host PC buffer through the PCIe
interface and copies the data to LSRAM 2 KB temporary buffer. The Cortex-M3 processor writes the SPI
Flash memory with the data bitstream stored in the LSRAM. The Cortex-M3 processor user application
sends the acknowledgment to the GUI for every 2 KB block of bitstream data and requests the GUI for
the next block of 2 KB data. The GUI sends the bitstream data in 2 KB blocks until the entire
programming file is transferred from the host PC to the external SPI Flash.
The IAP services can be executed using the GUI. If the Authenticate or Verify option is selected from the
GUI, the Cortex-M3 processor user application initiates the IAP service with the requested IAP Operation
mode and notifies the GUI with a status code indicating the completion of the authentication or
verification service. For Program mode, the Cortex-M3 user application does not notify the GUI with any
status code as the Flash components of the device are programmed with new bitstream data. On
successful IAP program operation, an internal device reset is generated for the new design to take effect.
Note: You can modify/edit the programming file (*.spi) contents and run the authenticate operation to get the
authentication fail message with the corresponding error code. For information about error codes, see
Appendix: Error Codes, page 24.