This template provides a simple, browser based way to write and synthesize code for Lattice iCE40 FPGAs—including boards like the iCEBreaker, iCESugar, and more.
By creating a GitHub Codespace from this public template, you can get up and running with your FPGA projects in just minutes. No installation required!
Welcome! Follow these quick steps to get started:
- Click “Use this template” at the top of the repository.
- Select “Open in a codespace.”
That's it—your Codespace will launch with a pre-configured online VS Code environment!
- In your Codespace, open the
Examplesfolder. - Modify
apio.inito match your specific board. - Update the
io.pcffile to reflect your board's LED pin configuration. - Follow the build instructions in the next section to compile and flash your example.
All changes within the Codespace are saved inside the Codespace, but not pushed to GitHub by default.
To keep your work:
- Fork this repository first (if you haven’t already).
- Commit and push your changes from within the Codespace.
⚠️ Note: Codespaces may be automatically deleted after a period of inactivity. Be sure to disable auto-deletion in your Codespaces settings if needed, and always keep backups of your important work!
GitHub Codespaces is used for writing code and generating programming files. It’s pre-configured to make development easy and consistent across platforms—no installation required.
- Open the Codespace in the browser to launch the online VS Code instance.
- Modify an existing Verilog file directly, or duplicate and rename a folder to create a new project.
- In the vscode terminal, navigate to the folder containing your Verilog file (e.g.,
cd folder1/folder2), or right-click the folder in the Explorer panel and select "Open in Integrated Terminal." - Run
apio build. This will generate or overwrite the programming filehardware.bin, ready for flashing onto your FPGA board. Download this file and follow the below instructions to get it onto your FPGA.
- Install icestorm tools (includes
iceprog) on your machine. For example:If this doesn’t work, follow the official guide: https://prjicestorm.readthedocs.io/en/latest/overview.html#where-are-the-tools-how-to-installsudo apt update && sudo apt upgrade -y && sudo apt install fpga-icestorm -y - Verify the FTDI chip is detected with:
lsusb - Navigate to the directory containing
hardware.bin, then run:sudo iceprog hardware.bin - Done!
- Install and configure WSL (Ubuntu 24.04.1 LTS is recommended).
- In the Ubuntu terminal:
If that fails, follow this guide: https://prjicestorm.readthedocs.io/en/latest/overview.html#where-are-the-tools-how-to-install
sudo apt update && sudo apt upgrade -y && sudo apt install fpga-icestorm -y - Verify installation in WSL:
iceprog --help - Install
usbipd-winto allow WSL to connect to USB devices. In powershell (opened as admin):winget install --interactive --exact dorssel.usbipd-win - After installing, verify in powershell with:
Learn more: https://learn.microsoft.com/en-us/windows/wsl/connect-usb
usbipd list
- Open PowerShell as administrator:
Note the BUSID of the FTDI device.
usbipd list - Bind it to WSL:
usbipd bind --force --busid <BUSID>
- Open PowerShell and run:
Confirm the FTDI device is shared. If not, see the previous section.
usbipd list - Attach it to WSL:
usbipd attach --wsl --busid <BUSID> - In your WSL terminal, verify:
lsusb - Navigate to the folder with
hardware.bin, then flash:sudo iceprog hardware.bin - All done!