Today I managed to get the FleaFPGA Ohm board running some custom P1V boot code to read images from its onboard SPI flash chip and also allowing the normal flashing of persistent images serially via standard Propeller tools (actually PropellerIDE was tested). :smile:
This is good because this particular FPGA board does not have any I2C EEPROM but it does have a 1MB SPI flash chip that holds the FPGA configuration data. This 1MB chip is not fully used by the ~600kB configuration data so it can also be shared after FPGA initialization by dedicating the top 32kB block of the chip for storage of a typical P1 EEPROM image.
Little bit of mucking about but I finally got it going:
- had to learn the W25Q80 FLASH chip SPI command sequences for read/write/erase etc
- had to modify the boot ROM to use flash ROM instead of I2C EEPROM and recreate 4 ROM image byte lane files for my P1V Diamond project - I've created a handy Makefile to assist this
- had to modify the Lattice project preference files to enable SPI port on ECP5 FPGA in user mode
- had to map FPGA IO pins to this SPI port and make them accessible to the P1V code
Thankfully there was only one slightly tricky bug in my SPI flash mods to track down. I had inadvertently used a “test ina, spimaskmiso wc” instead of “test spimaskmiso, ina wc, nr” and was wondering why all my SPI data read was zeroes. DOH! :blush:
If anyone is interested I have attached a zip file with this ROM code and a Makefile for users on MAC / Linux systems to generate either the original 4k boot ROM image or my custom flash enabled boot ROM image for this board. It could probably be further customized as required for other FPGA systems that use similar SPI flash.
You can build the custom ROMs using
or rebuild the original ROMs using