Skip to content

Instantly share code, notes, and snippets.

@bblodget
Last active May 31, 2025 19:08
Show Gist options
  • Select an option

  • Save bblodget/257ed2db1fc4b84aa72a1a444f1a3a09 to your computer and use it in GitHub Desktop.

Select an option

Save bblodget/257ed2db1fc4b84aa72a1a444f1a3a09 to your computer and use it in GitHub Desktop.
Installing tinyprog and iceprog on MSYS2 UCRT64 (Windows 11)

Installing tinyprog and iceprog on MSYS2 UCRT64 (Windows 11)

This guide shows how to install both tinyprog and iceprog in an MSYS2 UCRT64 environment on Windows 11 to program Lattice iCE40 FPGAs like the TinyFPGA BX and iCE40UL1K.


⚠️ DISCLAIMER

This guide is provided for educational purposes. The author is not responsible for any damage to your system, hardware, or data that may result from following these instructions. USB driver modifications and FPGA programming carry inherent risks. Always ensure you have backups and understand the commands before executing them. Use at your own risk.


🧰 Prerequisites

  • Windows 11
  • MSYS2 with the UCRT64 environment
  • Python 3 installed (pacman -S mingw-w64-ucrt-x86_64-python)
  • IceCube2 installed (optional, for Lattice UL1K builds)

🐍 Installing tinyprog

tinyprog is a Python-based tool to program TinyFPGA BX over USB.

  1. Launch MSYS2 UCRT64 shell

  2. (Optional but recommended) Create a virtualenv:

    python -m venv ~/.venvs/clitools
    source ~/.venvs/clitools/Scripts/activate
  3. Install tinyprog using pip:

    pip install tinyprog
  4. Verify it works:

    tinyprog --list

πŸ”§ Installing iceprog

iceprog is part of Project IceStorm and supports programming over FTDI (e.g., iCEstick, iCE40-HX8K, UL1K dev boards).

Step 1: Install dependencies

pacman -S mingw-w64-ucrt-x86_64-libftdi mingw-w64-ucrt-x86_64-libusb mingw-w64-ucrt-x86_64-make

Set up make alias: Add this to your ~/.bashrc file so make works properly:

echo "# Add alias for make" >> ~/.bashrc
echo "alias make='mingw32-make'" >> ~/.bashrc
source ~/.bashrc

Step 2: Clone and build IceStorm

git clone https://github.com/cliffordwolf/icestorm.git
cd icestorm/iceprog
make

Step 3: Install iceprog

install -m 755 iceprog /usr/local/bin/iceprog

Step 4: Verify iceprog works

iceprog -t -v

⚠️ Notes on USB Access

You may need to install a libusb driver for your FTDI-based board using Zadig. Scroll down to the Download section. At the time of this writing the latest version was Zadig 2.9 (5.1MB). I selected "Other versions", Closed the add via the "x" button, then selected zadig-2.9.exe 2024-06-13 13:56 5.1M for download.

Select your device (e.g., Dual RS232-HS or iCE40UL1K Eval Kit) and install the libusb-win32 or libusbK driver.

For example, the iCE40UL1K UltraLite breakout board showed up with two interfaces in Zadig:

Interface 0 β€” used by iceprog for programming the FPGA. We installed the libusbK driver on this interface.

Interface 1 β€” likely used as a serial COM port by applications. We left this interface untouched so Windows can manage it normally.

Make sure you only replace the driver on the interface used for programming.


βœ… Example Usage

With tinyprog (TinyFPGA BX)

tinyprog --program top.bin

With iceprog (iCE40 dev boards)

iceprog blinky_top_bitmap.bin

πŸ“š References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment