Since the u2if firmware uses standard HID and CDC interfaces for communicating with the host PC, it can potentially run on any Raspberry Pi RP2040 based board, not just the Pico. The main code changes needed are:

  • Provide appropriate USB PID and VID.
  • Change pin mappings to specific RP2040 based board.

We've done that for several Adafruit RP2040 based boards. Details for each are provided below. For each, install the provided UF2 firmware, set the environment variable:

BLINKA_U2IF=1

and then launch Python. The board will be auto detected based on USB PID and VID.

Make sure you've also updated to the latest versions of Adafruit Blinka and PlatformDetect.

Feather RP2040

Angle shot of Feather RP2040 prototype
A new chip means a new Feather, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the Feather...
$11.95
In Stock

Here is the firmware:

Pico Firmware USB IDs:

  • USB_VID = 0x239A
  • USB_PID = 0x80F2

Example check-if-found test code:

import hid
device = hid.device()
device.open(0x239A, 0x80F2)

Here is what you should see if you list the board pins:

$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> dir(board)
['A0', 'A1', 'A2', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D24', 'D25', 'D4', 'D5', 'D6', 'D9', 'I2C', 'MISO', 'MOSI', 'SCK', 'SCL', 'SCLK', 'SDA', 'SPI', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'ap_board', 'board_id', 'detector', 'pin', 'sys']
>>>

Here is an example that scans for connected I2C devices. Make sure something is actually connected to the SCL/SDA pins or the STEMMA QT connector.

import board

i2c = board.I2C()

i2c.try_lock()
i2c.scan()
i2c.unlock()

ItsyBitsy RP2040

Video of hand holding an ItsyBitsy PCB. An on-board LED glows rainbow colors.
A new chip means a new ItsyBitsy, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the ItsyBitsy...
$9.95
In Stock

Here is the firmware:

Pico Firmware USB IDs:

  • USB_VID = 0x239A
  • USB_PID = 0x00FD

Example check-if-found test code:

import hid
device = hid.device()
device.open(0x239A, 0x00FD)

Here is what you should see if you list the board pins:

$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board          
>>> dir(board)
['A0', 'A1', 'A2', 'BUTTON', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D2', 'D24', 'D25', 'D3', 'D4', 'D5', 'D7', 'D9', 'I2C', 'MISO', 'MOSI', 'NEOPIXEL', 'NEOPIXEL_POWER', 'SCK', 'SCL', 'SCLK', 'SDA', 'SPI', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'ap_board', 'board_id', 'detector', 'pin', 'sys']
>>>

Here is a simple example program that reads the state of the BOOT button.

import time
import board
import digitalio

button = digitalio.DigitalInOut(board.BUTTON)
button.direction = digitalio.Direction.INPUT

while True:
    # value is False when button is pressed
    if not button.value:
        print("Button pressed!")
        time.sleep(0.1)

QT Py RP2040

Video of hand holding a QT Py PCB in their hand. An LED glows rainbow colors.
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with one of our new favorite chip, the RP2040. It's been made famous in the new
$9.95
In Stock

Here is the firmware:

Pico Firmware USB IDs:

  • USB_VID = 0x239A
  • USB_PID = 0x00F7

Example check-if-found test code:

import hid
device = hid.device()
device.open(0x239A, 0x00FD)

Here is what you should see if you list the board pins:

$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> dir(board)
['A1', 'A2', 'A3', 'BUTTON', 'D0', 'D1', 'D10', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'I2C', 'MISO', 'MOSI', 'NEOPIXEL', 'NEOPIXEL_POWER', 'SCK', 'SCL', 'SCL1', 'SCLK', 'SDA', 'SDA1', 'SPI', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'ap_board', 'board_id', 'detector', 'pin', 'sys']
>>>

And here is a simple example to light the onboard NeoPixel:

import board
import digitalio
import neopixel

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)

neopwr = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
neopwr.direction = digitalio.Direction.OUTPUT
neopwr.value = True

pixel.fill(0xADAF00)

Trinkey QT2040

Video of Trinkey RP2040 plugged into a laptop. An OLED display is connected and shows a graphic keyboard cat animation.
It's half USB Key, half Adafruit QT Py, and a lotta RP2040...it's Trinkey QT2040, the circuit board with an RP2040 heart and Stemma QT legs....
$7.50
In Stock

Here is the firmware:

Pico Firmware USB IDs:

  • USB_VID = 0x239A
  • USB_PID = 0x0109

Example check-if-found test code:

import hid
device = hid.device()
device.open(0x239A, 0x0109)

Here is what you should see if you list the board pins:

$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> dir(board)
['BUTTON', 'I2C', 'NEOPIXEL', 'SCL', 'SDA', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'ap_board', 'board_id', 'detector', 'pin', 'sys']
>>>

Here is a simple example program that reads the state of the BOOT button.

import time
import board
import digitalio

button = digitalio.DigitalInOut(board.BUTTON)
button.direction = digitalio.Direction.INPUT

while True:
    # value is False when button is pressed
    if not button.value:
        print("Button pressed!")
        time.sleep(0.1)
Note: For the Trinkey QT2040: Vendor ID is 0x239A and Product ID is 0x0109

This guide was first published on May 01, 2021. It was last updated on 2021-05-26 15:05:43 -0400.

This page (Other RP2040 Boards) was last updated on May 24, 2022.

Text editor powered by tinymce.