My pmods are now
0 Z 1 SPI; on failure, USB Boot is enabled
I assume it is possible to write to SPI flash from firmware.
If i succeed in breaking the firmware on spi flash, my boot will fail after a reset, triggering the USB boot and enabling me from writing a new firmware into the flash.
Is this possible?
If so, it makes it easy for me as I don't even have to dabble with the PMODs, they can just stay the way they are!
Is there an obvious reason why i should NOT do it like this?
For controlling the PMODE pins:
The FPGA can be used to control the PMODE pins. If an High Impedance (Z) is required on any PMODE pin, the corresponding FPGA pin which is attached to it can be configured as input on FPGA. Similar for high and low. Please note that the FPGA should be configured before the FX3/FX3S starts booting.
You can use the cold reset method, here the firmware will start from the bootloader and samples the PMODE lines, then loads the firmware from the selected boot source.
Please refer to this KBA on how to perform a cold reset: Cold Reset in FX3 - KBA225773
SPI flash write:
Yes, the SPI flash can written from the firmware. Please refer to the UsbSpiDmaMode example from the FX3 SDK.
You can refer to the ReadMe document in the project.
path: <installation directory>\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbspidmamode