Adafruit Trinket M0

The Adafruit Trinket M0 is a tiny ARM development board based on the Atmel ATSAMD21E18 family of SoC.

Interfaces

InterfaceHardware SupportedTinyGo Support
GPIOYESYES
UARTYESYES
SPIYESYES
I2CYESYES
ADCYESYES
PWMYESYES

Machine Package Docs

Documentation for the machine package for the Adafruit Trinket M0

Flashing

UF2

The Trinket M0 comes with the UF2 bootloader already installed.

CLI Flashing on Linux

  • Plug your Trinket M0 into your computer’s USB port.
  • Flash your TinyGo program to the board using this command:
  1. tinygo flash -target=trinket-m0 [PATH TO YOUR PROGRAM]
  • The Trinket M0 board should restart and then begin running your program.

CLI Flashing on macOS

  • Plug your Trinket M0 into your computer’s USB port.
  • Flash your TinyGo program to the board using this command:
  1. tinygo flash -target=trinket-m0 [PATH TO YOUR PROGRAM]
  • The Trinket M0 board should restart and then begin running your program.

CLI Flashing on Windows

  • Plug your Trinket M0 into your computer’s USB port.
  • Double tap the “RESET” button on the board.
  • Wait until the Trinket M0 board appears as a flash drive.
  • Flash your TinyGo program to the board using this command:
  1. tinygo flash -target=trinket-m0 [PATH TO YOUR PROGRAM]
  • The Trinket M0 board should restart and then begin running your program.

Troubleshooting

If you have troubles getting your Trinket M0 board to receive code, try this:

  • Press the “RESET” button on the board two times to get the Trinket M0 board ready to receive code.
  • The Trinket M0 board will appear to your computer like a USB drive.
  • Now try running the tinygo flash command as above:
  1. tinygo flash -target=Trinket-m0 [PATH TO YOUR PROGRAM]

Once you have updated your Trinket M0 board the first time, after that you should be able to flash it entirely from the command line.

Notes

You can use the USB port to the Trinket M0 as a serial port. UART0 refers to this connection.