105 - How can I determine if a LatticeXP2 FPGA configured from internal flash or from an external SPI flash?
The LatticeXP2 can be setup to operate in dual boot mode. Dual boot mode permits the LatticeXP2 to attempt to load a "working" configuration bitstream, and if that bitstream fails to properly configure the FPGA for a "golden" or "failsafe" bitstream to be loaded, improving system reliability.
Each Lattice FPGA provides a 32-bit Usercode register. The Usercode register can be programmed with a unique value for each configuration bitstream to be loaded into the FPGA. The Usercode register value can be assigned using either the Pre-Map Design Planner (ispLever), Spreadsheet View (Diamond), or Universal File Writer (UFW, from ispVM System).
The Usercode can be read from the LatticeXP2 using JTAG accesses. This can be done using ispVM System in a development environment, or from ispVM Embedded (ispVME). ispVME is C source code that permits a microcontroller to control the JTAG pins on the FPGA to read the Usercode register.
For Example:
- The on die Flash bitstream has a Usercode value assigned to "PatA". 32 bits can only store 4 ASCII characters
- The bitstream for the external SPI Flash has a Usercode value assigned to "PatB".
- The Usercode is interrogated using JTAG, permitting you to determine the bitstream used to configure the LatticeXP2.
Related Articles
Radiant Programmer: What is Erase, Program, Verify Quad 1 operation used for?
Description: Erase, Program, Verify Quad 1 enables that QE bit to '1'. In general, there are two (2) requirements/steps to enable booting from external SPI Flash through x4 (QUAD Mode) Step 1 - Convert the bitstream file into hex (Quad I/O read mode) ...
3817 - LatticeXP2: Is the download/configuration time from Internal/External SPI Flash different while using Dual Boot Mode in LatticeXP2 device?
While using Dual Boot Mode, the configuration time (time required for the bitstream to get configured inside the device) from Internal Flash is less. Data transfer is faster because the Internal Flash interface with SRAM is parallel, whereas it is a ...
104 - Why does my LatticeXP/XP2 device get hot after programming from Flash?
The LatticeXP and LatticeXP2 internal flash cells program using looping algorithms in order to provide the correct erase or programming timing for flash accesses. This method is critical to providing correct programming of the flash fuses. They also ...
1663 - MachXO2: How can I force to boot from the “golden boot” image in the external SPI Flash when using the dual boot feature?
The MachXO2 has a dual boot feature that works in an automatic mode. If the image loaded from the internal flash is found to have an issue (CRC error), or if the internal flash is erased, then the part will automatically try to load the golden image ...
7315 - MACHXO3: Why I cannot perform SPI programming after enable dual boot to configure from external SPI flash
Description: MACHXO3 device share the same SPI SysConfig ports for both SSPI and MSPI configuration mode. The Configuration(CFG) MSPI is designed to be bus friendly, i.e. when it's not actively booting, all MSPI pins are tri-stated. It's possible to ...