MachXO3L has three ways of programming:
- External SPI Flash
- NVCM (Non-Volatile Configration Memory)
SRAM is volatile and should only be used for prototyping, where as NVCM can only be written 2 times in its life-time (reference: Innovative Non-Volatile Configuration Memory Technology Enables Low-cost, Multi-time Programmable ULD FPGAs, White Paper, and also MachXO3 Programming and Configuration Usage Guide). THEREFORE, AVOID USING NVCM BY ALL MEANS.
Problems with SPI Flash
At first when I try to program through SPI Flash, due to benefit that it is non-volatile, the new program does not reflect on the physical board. It does not show up after reboot as well.
After quite a bit of Internet searching, the reason is that, the default boot sequence have NVCM over the external SPI. The way to change that is to modify Boot Select, residing in the Feature Row memory space in MachXO3L. However, Feature Row can only be modified 8 times (MachXO3 Programming and Configuration Usage Guide). EXTRA CAUTION need to be taken here.
To modify Feature Row, it is done through the programmer in Lattice Diamond:
Change the Boot Select [2:1] and MSPI bit to , according to
This will allow “EXTERNAL” configuration (not really sure what it means). After this change, the program in the SPI flash fires up!
SPI Programming Mode Setting
The following SPI Flash Setting must be used for MachXO3L.