Install CircuitPython on an Adafruit Trinket M0


Checking your firmware version

The first thing you should do is to check which version CircuitPython is installed. You simply don't know how long your board was stored at the factory and/or shop.

Connect the Trinket to your computer USB port and log in via the serial port. With Putty in my case.
Stop any running program with CRTL-C, and hit CTRL-C untill you see the Python command prompt (>>>).

Now you see which version CircuitPython is used. This is the output of my, unmodified, Trinket M0: Adafruit CircuitPython 3.1.1 on 2018-11-02; Adafruit Trinket M0 with samd21e18 At the time of writing (2 sep 2019), the latest CircuitPython version is 4.1.0. Which means I will definitely update the Trinket, because it is a major version behind.


Download the latest CircuitPython version

Go to the Trinket M0 download area on CircuitPython.org
I've downloaded the latest stable release.


Installing the new firmware

Plug your Trinket into your computer using an USB DATA cable.
Double-click the small Reset button next to the Trinket M0 name printed on your board, and you will see the Dotstar RGB LED turn green. If it turns red, check the USB cable, try another USB port, etc. Note: The little LED below the USB connector will be red - this is ok!

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

  • You will see a new disk drive appear called TRINKETBOOT
  • Copy the adafruit_circuitpython_etc.uf2 file to TRINKETBOOT
  • The red LED will flash. Then, the TRINKETBOOT drive will disappear and a new disk drive called CIRCUITPY will appear
  • That's it, you're done!
And the end result: Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit Trinket M0 with samd21e18 The latest (at time of writing) firmware is installed on the Trinket M0


CircuitPython Libraries

By default, at least that is how it seems, the lib folder in the root of your Trinket is empty or doesn't exist. Some of the libraries are part of the firmware itself. But some have to be installed by the user. And that is simply because the libraries are constantly updated. So if you need a specific one for your project you have to download it yourself.
Note: Match up the bundle version with the major version of CircuitPython you are running.

Installing the CircuitPython Library Bundle

The latest CircuitPython Libray Bundle Release from the CircuitPython.org site.

Unzip the file, open the resulting folder and find the lib folder. Open the lib folder and find the library files you need to load. Create a lib folder on your CIRCUITPY drive (if you don't have one already). Copy the library files, with .mpy extension, to the lib folder on your CIRCUITPY drive.

Bundle Examples

Every CircuitPython library has examples to go along with it. This bundle contains every library example. This bundle will have examples that require the latest version of CircuitPython, and therefore contains files that may not work with all versions. You can find these on the same page as the The latest CircuitPython Libray Bundle Release.