Python script for programming the iCEBlink40 development board under linux
Switch branches/tags
Nothing to show
Clone or download
Failed to load latest commit information.
.gitignore A few more packaging fixes for release Jun 29, 2018

Lattice iCEBlink40 Programming Tool

The Lattice iCEBlink40 is a low-cost FPGA board (currently $50 cad) supporting the iCE40 LP/HX families. While the iCEcube programming software on linux supports the chips, it doesn't ship with a port of iceutil.exe to program the board itself. This is an open-source tool, licensed under GPL2, to allow for programming of the FPGA board from linux.

This script has only been tested by the author with the iCEblink40-LP1K board, with the M25P10VP flash. Other users have reported that it works with the HX1K flavour boards.

This tool was created from black-box inspection of the USB datastream between a VM running iceutil and the iCEblink40-LP1K evaluation board. No binary analysis, binary reverse engineering or disassembly was used during the creation of this tool; all information in this file was derived from black-box analysis.

The iCEBlink boards only support programming of the flash memory used to boot the FPGA. Direct SPI programming of the FPGA does not appear to be possible.


  • python 3 or newer
  • pyusb 1.0 or newer


The main flash programming tool is It supports two operation flags, -e for erase, and -w for write. The most common usage is:

./ -ew path\_to\_build.bin

Regtool is an example test script to poke at registers via the FPGA data link. The argument

-r 0xAB

will do a read of register 0xAB and print the result to the console. The argument

-w 0xAB:0xCD

will write register 0xAB with value and print the result to the console. With the stock FPGA firmware

./ -w 5:0x48

will stop the scrolling pattern and fix LED3 on.

Regtool is primarily intended as an example of API usage, and not as a production grade tool.


  • If using old versions of pyUSB, you may get an error:

    AttributeError: "'NoneType' object has no attribute 'libusb_exit'"

This is a bug in pyusb.


  • Add additional flash devices