May 2007 Introduction Technical Note TN1144 Complementing its internal Flash configuration memory, the LatticeXP2 also provides support for inexpensive SPI Flash devices. This provides the ability to use an alternate or backup bitstream, referred to as the golden image. The device always attempts to load the primary image from the selected source. Should any unexpected interrupts occur during configuration of the primary image, the LatticeXP2 device will automatically switch sources and configure from the golden image location. Dual Boot Mode The LatticeXP2 Dual Boot sysconfig mode is selected using CFG pin settings. Table 17-1 lists the syscon- FIG modes supported by the LatticeXP2 device family. Figure 17-1 illustrates the SPI Flash hardware connections. Table 17-1. LatticeXP2 sysconfig Modes CFG1 CFG0 Configuration Mode Primary Boot Source Secondary Boot Source Figure 17-1. LatticeXP2 Hardware Connections to SPI Flash LatticeXP2 Dual Boot Usage Guide 0 0 External SPI Flash Internal Flash Dual Boot 1 0 Internal Flash External SPI Flash X 1 Self Download Mode (SDM) Internal Flash None LatticeXP2 SPI Serial Flash Primary or Golden Image CSSPIN SISPI SOSPI CCLK Internal Flash Memory Internal logic is used to detect a configuration failure from the primary source and provides the ability to reattempt configuration from the secondary source. This sequence is used when the LatticeXP2 is set to dual boot mode and configuration is initiated. Configuration initiates in dual boot mode when any of the following events occur: The device is powered-up with all supplies reaching their required minimum values The PROGRAMN pin is toggled The REFRESH command is issued via the ispjtag port Should configuration from both primary and golden images in dual boot mode fail, the INITN pin will be driven low and the configuration process will halt. 2007 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal. All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice. www.latticesemi.com 17-1 tn1144_01.1
Dual Boot Flash Programming In order to use dual configuration images, the data must be programmed for storage within the corresponding Flash locations separately. ispvm System software provides the ability to program both LatticeXP2 internal Flash and supported external SPI Flash memory devices. Note: To allow programming of the external SPI Flash device, the LatticeXP2 CFG0 pin should be low. Procedure Note: This procedure assumes basic familiarity with ispvm System. For more information on using ispvm System, refer to the tutorials and contents within the help system. 1. Using isplever, create JEDEC files for the LatticeXP2 device to be used as primary and golden images. To preserve the sysconfig port, the PERSISTENT option in the isplever Design Planner must be set to ON. 2. Open ispvm System. 3. Scan the chain or manually insert the devices representing the JTAG chain. An example chain is shown in Figure Figure 17-2. ispvm System 4. Double-click the LatticeXP2 device to open the Device Information Window, as shown in Figure 17-3, and select Flash Programming Mode from Device Access Options. 17-2
Figure 17-3. Device Information Window 5. Under Data File, browse to the appropriate JEDEC file to be programmed into the internal Flash memory. 6. Set the Operation field to Flash Erase, Program, Verify. 7. Press OK to return to the main ispvm System window. 8. Press the green GO button to download the data file into the LatticeXP2 internal Flash memory. 9. To prepare a data file to program the SPI Flash, open the Universal File Writer tool by clicking the UFW button from the ispvm System toolbar. A window will appear, as shown in Figure 17-4. Figure 17-4. Universal File Writer 17-3
10. Specify a bitstream file output by pulling down the selector from the toolbar. 11. Double-click Input Data File in the left-hand windowpane. Browse to the appropriate isplever-created JEDEC file. 12. Double-click Output Data File in the left-hand windowpane. Select the desired path and name of the file to be created. The UFW window should appear similar to Figure 17-5. Figure 17-5. UFW Settings for JEDEC to Bitstream Conversion 13. Press the Generate button or choose Project->Generate. The bitstream file will then be created. 14. Close the UFW tool and return to ispvm System. 15. Double-click the device in ispvm System to bring up the device settings dialog. 16. Change the Device Access Options to SPI Flash Programming. This will bring up another dialog, as shown in Figure 17-6. 17-4
Figure 17-6. SPI Serial Flash Device Selection 17. Press Select to choose from a list of supported SPI Flash devices. 18. Under Data File, browse to the appropriate bitstream file to be programmed into the external SPI Flash memory. The results should be similar to Figure 17-7. Figure 17-7. Completed SPI Serial Flash Device Settings 19. Press OK to exit the SPI Serial Flash Device setup window. 20. At the main ispvm System window, the LatticeXP2 device is now ready to program the SPI Flash device. Click the green GO button on the toolbar to execute this process. Provided the LatticeXP2 CFG pins are set to one of the dual boot modes, the device is now configured to use the corresponding dual boot capability. Upon toggling the PROGRAMN pin or power cycling, the device will load the primary image. 17-5
Technical Support Assistance Hotline: 1-800-LATTICE (North America) +1-503-268-8001 (Outside North America) e-mail: techsupport@latticesemi.com Internet: www.latticesemi.com Revision History Date Version Change Summary February 2007 01.0 Initial release. May 2007 01.1 Added note to Dual Boot Flash Programming section. Updated step 1 in the Procedure section. 17-6