YosysHQ / icestorm

Project IceStorm - Lattice iCE40 FPGAs Bitstream Documentation (Reverse Engineered)
ISC License
963 stars 224 forks source link

icenvcm: Program the iCE40 NVCM #286

Open osresearch opened 2 years ago

osresearch commented 2 years ago

programming jig for the nvcm testing

icenvcm will write a bitstream into an iCE40 device with one-time-programmable non-volatile configuration memory (NVCM) and optionally set the security lock bits to prevent read out.

This is a dangerous operation and can result in bricked devices. Since it is OTP, you must be sure that your design is good enough to permanently burn into the chip. It is still possible to use the iceprog -S to reconfigure the SRAM, although the FPGA will no longer boot from an attached SPI flash.

Note that the NVCM requires a 2.5V power supply, which the Lattice devboard (and many other third party boards) do not include. A schematic is included for a ZIF programming jig to burn the chips before they are soldered to their final boards.

This implements #268 and obsoletes or replaces #271 and #272, both of which were very helpful in figuring out how to format the NVCM programming commands.

Signed-off-by: Trammell Hudson hudson@trmm.net Co-authored-by: Matt Mets matt@blinkinlabs.com Co-authored-by: Peter Lawrence 12226419+majbthrd@users.noreply.github.com

Mecrisp commented 1 year ago

That is interesting! How does the SB_WARMBOOT primitive behave after writing a permanent bitstream into the OTP area? Is it still possible to trigger loading a bitstream out of external SPI flash from the inside? That would be very handy for a permanent USB bootloader on the FOMU and similiar boards!

mithro commented 1 year ago

@Mecrisp - Sadly, as far as my investigations have turned up, the SB_WARMBOOT does not allow booting from SPI flash after the NVCM has been programed.

mithro commented 1 year ago

BTW - I would love to be proven wrong! As you mention, it would be super awesome for things like the Fomu.

mithro commented 1 year ago

PS - The my sources around the SB_WARMBOOT / NVCM interactions where Lattice employees who tried to figure out a workaround and potentially even considered a new silicon revision that could potentially enable they but couldn't find a solution. The open source hardware community tends to be a little more imaginative...

donnie-j commented 1 year ago

@mithro is there still anyone left there from Silicon Blue? Regardless, emphatically +1 for merge, please.