I decided to write this tutorial because the manufacturer's website contains some errors regarding the use of this board with Circuitpython. Although the site contains the information that the firmware for the board is the same as that of the Raspberry Pi Pico, I noticed that some features were not present. Especially when we use the expansion board. The examples on the Seeed Wiki are mostly suitable for use with the Arduino IDE. But the examples for Circuitpython are not well documented.


  1. Seeeduino XIAO Rp2040
  2. Seeeduino XIAO Expansion Board
  3. Circuitpython Source

Step 1: Unboxing... I2C Not Working?

As soon as the card arrived, I installed the firmware version for Raspberry Pi Pico, according to the manufacturer's guidelines. As I had already acquired the expansion card before, I started my tests trying to display text on the Oled display (I wrote another tutorial about it). When I made the call to the I2C bus, I received an error message informing me of the absence of Pullups on the SDA and SCL lines. I tested several resistor values, going from 4K7 to 47k and none of them worked. It was then that I visited the Seeed support forum and found a user commenting on the same issues with the I2C bus, but this time using the Arduino IDE. The user's message informed them that they had changed the native pinouts for I2C and this had allowed them to use the bus. The same user commented in another post about the board-specific Circuitpython firmware.

I ended up putting the two ideas together and did a search on Circuitpython's Github to check for a Port for the board. For some reason, the Port for Xiao RP2040 is ready in the source code, but has not yet been made available for download on the site. So to get the firmware for the card, you'll need to compile from scratch (if you don't want to venture into this step, I made the firmware compiled on my Github available).

Step 2: Compiling the Firmware

The Adafruit team has already made an excellent tutorial on this step.


You'll just need to adapt a few things:

In the Adafruit tutorial, in the Build Circuitpython step, you'll need to go to the correct port folder.

In our case, instead of

cd ports/atmel-samd make BOARD=circuitplayground_express 

you must type:

cd ports/raspberrypi
make BOARD=seeeduino_xiao_rp2040

The later steps are basically the same. The compiled firmware will stay in the folder ports/raspberrypi/build-seeeduino_xiao_rp2040/firmware.uf2

Simply reset XIAO RP2040 with the BOOT button pressed and then upload the firmware.

Now is the time to run some tests on the board. First the OLED display.

Step 3: Oled Display

The OLED display is accessed via the I2C bus, at the 0x3C, just like in my other tutorial.

First, download the circuitpython-specific libraries in https://circuitpython.org/libraries

You will need to copy some libraries (adafruit_displayio_ssd1306, adafruit_bus_device, adafruit_bitmap_font, adafruit_display_text, adafruit_display_notification, adafruit_display_shapes, adafruit_displayio_layouts) to your card's lib folder.

import board
import busio
import displayio
import terminalio
import adafruit_displayio_ssd1306
from adafruit_display_text import label

i2c = busio.I2C (scl=board.SCL, sda=board.SDA)

display_bus = displayio.I2CDisplay (i2c, device_address = 0x3C) # The address of my Board

display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)
splash = displayio.Group() # no max_size needed

color_bitmap = displayio.Bitmap(128, 64, 1) # Full screen white
color_palette = displayio.Palette(1)
color_palette[0] = 0xFFFFFF  # White bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite) # Draw a smaller inner rectangle
inner_bitmap = displayio.Bitmap(118, 54, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0x000000...
Read more »