pico-ice
RaspberryPi Pico with an iCE40 FPGA
Getting Started

Once you receive the board, you would be able to plug via USB and see the RGB LED blinking. You might want to update the default firmware to make sure to have the latest bugfixes:

Default Firmware

source - download

To provide the various USB programming methods and allow to boot the FPGA, a default firmware is loaded onto the RP2040 (Pico part of the pico-ice).

It provides:

  • A first USB-serial (#0) is used for the and a REPL command line interface for now only showing help message and version information.
  • A second USB-serial (#1) is used for mirroring everything between this USB interface UART TX on RP0 with ICE27, UART RX on RP1 with ICE25.
  • A third USB-serial (#2) is exchanging data with the main SPI bus onboard (doc).
  • A 12 MHz clock is exported from the RP2040 pin 24 toward the iCE40 pin 35.
  • An USB DFU interface allows programming through dfu-utils as shipped with oss-cad-suite.
  • An USB MSC interface allows programming the board by copying a file to an USB device (doc).

See Programming the RP2040 for how to load this firmware file.

Soldering the Pmods

In case you ordered the board without the Pmod connectors soldered, you would need to solder them in to plug something onto the board. For instance like this:

Using the SDK

The RP2040 on the pico-ice can be programmed with either custom C firmware, or languages such as MicroPython, CircuitPython, Go, Rust, JavaScript, ZeptoForth, Mecrisp Forth, ...

Currently C/C++ programming is best suported through the pico-ice-sdk: a Raspberry Pi pico-sdk library.

This is a guide for how to build application running on the RP2040 microcontroller.

The pico-ice-sdk provides an API for communicating with the pico-ice hardware, also allowing to use the Raspberry Pi pico-sdk directly.

The pico-ice-sdk is organised as a normal pico-sdk project with pico_ice custom board.

The examples show how everything can be to get started.

Here is how to turn an example into a new project:

# copy the whole example directory
cp -r pico-ice-sdk/examples/pico_usb_uart my-new-pico-ice-firmware
cd my-new-pico-ice-firmware

# turn it into a git repository
git init
git remote add origin git@github.com:your-username/my-new-pico-ice-firmware

# replace the two symlinks by git submodules
rm pico-sdk pico-ice-sdk
git submodule add https://github.com/raspberrypi/pico-sdk
git submodule add https://github.com/tinyvision-ai-inc/pico-ice-sdk

# fetch the submodules (using --recursive is very slow)
git -C pico-ice-sdk submodule update --init
git -C pico-sdk submodule update --init lib/tinyusb

# you can now build it as a CMake project
mkdir build && cd build
cmake .. && make

You can now edit the name of the project in the CMakeLists.txt, add new sources, and change the code.

Troubleshooting

Feel free to join the chat server to ask for help.

Using some RP2040 peripheral cause various bugs.

In order to power the FPGA, some peripherals and GPIO pins are in use by the pico-ice-sdk. In case both the firmware and SDK use the same peripheral, it is possible to use another free peripheral instance, or if none left, disable the feature of the SDK The ice_init() is responsible for setting-up all peripherals used by the SDK. Instead, calling manually each ice_init_<feature>() of interest permits to select what to enable or not in the board, and therefore keeping some more peripherals for the user.

Error: C++ compiler not installed on this system

The pico-sdk is written in C, but uses a single C++ file to enable C++ support in the SDK. This means you need a working C++ cross compiler, often named arm-none-eabi-g++.

Even if this binary is present in your system, it might not be a full C++ installation. If you do not need C++ and want to work around this bug, you can disable the C++ support in the pico-sdk. From your project repo:

$ cd build
$ cmake .. # download the SDK if not yet done
$ sed -i '/new_delete.cpp/ d' _deps/pico-sdk-src/src/rp2_common/pico_standard_link/CMakeLists.txt
$ cmake .. # rebuild the Makefile with the fix