Scaling an IoT deployment? Join our webinar on May 28th where we dive into real-world scaling pain points and how to overcome them.

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Sign In
Sign In
Docs Home
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Feather MCUs
Cygnet
Cygnet Introduction
Cygnet Quickstart
Cygnet Datasheet
Using Arduino IDE with Cygnet
Using STM32CubeIDE with Cygnet
Swan
Swan Introduction
Swan Quickstart
Swan Datasheet
Using Arduino IDE with Swan
Using CircuitPython with Swan
Using STM32CubeIDE with Swan
Recovering the STM32L4R5
homechevron_rightDocschevron_rightFeather MCUschevron_rightSwanchevron_rightUsing CircuitPython with Swan

Using CircuitPython with Swan

CircuitPython is an open-source derivative of the MicroPython programming language and is primarily supported by Adafruit .

Prerequisites

  1. Download the latest version of the Swan's UF2 bootloader from the adafruit/tinyuf2 repository releases page . Expand the full list of assets under the current release and search for "swan" to find the appropriate file.

    Swan bootloader location

  2. Download the latest version of CircuitPython from Adafruit's CircuitPython page for Swan . (You only need the .uf2 file.)

    Swan CircuitPython location

  3. If you haven't already, install the device firmware upgrade utility: dfu-util .

Installation

  1. Connect the Swan's Micro USB port to your computer with a USB cable.

  2. Put your Swan into "boot" mode by holding down the BOOT button, pressing and releasing the RESET button, then releasing the BOOT button.

    boot and reset buttons on swan

  3. Unzip your tiny-uf2-swan_r5-[version].zip file. You'll need the extracted .bin file for the next step.

  4. In a terminal window, run the following command to flash the bootloader files to your Swan. Note that you may to need to navigate directories first, and you will likely need to change the file name at the end of the command to include the appropriate version number.

    dfu-util -s 0x8000000:leave -a 0 -D tinyuf2-swan_r5.bin
  5. In a few seconds, a new drive called SWANBOOT will appear.

    note

    If you have previously installed the bootloader but don't see the SWANBOOT drive appear, press the RESET button twice (fairly quickly) to mount the drive.

  6. Drag-and-drop the previously downloaded adafruit-circuitpython-swan_r5.uf2 file onto the SWANBOOT drive. Your Swan will quickly reset and the CIRCUITPY drive will appear.

Choosing an IDE

The beauty of working with CircuitPython on the Swan is that you interact directly with the source Python files on the CIRCUITPY drive. Virtually any IDE or text editor can be used to add, edit, and delete these files.

However, if you want to interact with the on-device REPL or view terminal output, you'll want to use a tool specific to CircuitPython development. Traditional Python editors such as Mu and Thonny are great for programming CircuitPython on the Swan. Likewise, VS Code with the CircuitPython extension is another popular option.

Blink the Onboard LED

  1. Open the code.py file in the CIRCUITPY drive using your preferred editor.

  2. Paste in the following code and save the updated code.py file.

    import board
    import digitalio
    import time
    
    led = digitalio.DigitalInOut(board.LED)
    led.direction = digitalio.Direction.OUTPUT
    
    while True:
        led.value = True
        time.sleep(0.5)
        led.value = False
        time.sleep(0.5)
  3. Depending on your IDE or editor, you may have to reset the device to see the changes. Enjoy your blinking LED!

Can we improve this page? Send us feedback
© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up