Adafruit Circuit Playground Bluefruit

The Adafruit Circuit Playground Bluefruit is small ARM development board based on the Nordic Semiconductor nrf52840 processor. It has several built-in devices such as WS2812 “NeoPixel” LEDs, buttons, an accelerometer, and some other sensors.

Interfaces

InterfaceHardware SupportedTinyGo Support
GPIOYESYES
UARTYESYES
SPIYESYES
I2CYESYES
ADCYESYES
PWMYESYES
USBDeviceYESYES
BluetoothYESYES

Pins

PinHardware pinAlternative names
D0P0_30A6, UART_RX_PIN
D1P0_14A7, UART_TX_PIN
D2P0_05A5, SDA_PIN
D3P0_04A4, SCL_PIN
D4P1_02BUTTONA, BUTTON
D5P1_15BUTTONB, BUTTON1
D6P0_02A1
D7P1_06SLIDER
D8P0_13NEOPIXELS, WS2812
D9P0_29A2
D10P0_03A3
D11P1_04
D12P0_26
D13P1_14LED
A8P0_28LIGHTSENSOR
A9P0_31TEMPSENSOR
SDA1_PINP1_10
SCL1_PINP1_12
SPI0_SCK_PINP0_19
SPI0_SDO_PINP0_21
SPI0_SDI_PINP0_23
PDM_CLK_PINP0_17
PDM_DIN_PINP0_16

Machine Package Docs

Documentation for the machine package for the Circuit Playground Bluefruit

Flashing

UF2

The Circuit Playground Bluefruit comes with the UF2 bootloader already installed.

PLEASE NOTE that for a good experience using TinyGo on your board you must be running version 0.4.1 or above of the UF2 bootloader on the board. For more information, see below

CLI Flashing

  • Plug your Circuit Playground Bluefruit into your computer’s USB port.

  • Flash your TinyGo program to the board using this command:

    tinygo flash -target=circuitplay-bluefruit [PATH TO YOUR PROGRAM]
    
  • The Circuit Playground Bluefruit board should restart and then begin running your program.

Troubleshooting

If you have troubles getting your Circuit Playground Bluefruit board to receive code, try this:

  • Press the “RESET” button on the board two times to get the Circuit Playground Bluefruit board ready to receive code.

  • The Circuit Playground Bluefruit board will appear to your computer like a USB drive.

  • Now try running the command:

    tinygo flash -target=circuitplay-bluefruit [PATH TO YOUR PROGRAM]
    

Once you have updated your Circuit Playground Bluefruit 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 Circuit Playground Bluefruit as a serial port. UART0 refers to this connection.

The Neopixel LED on the Circuit Playground Bluefruit can be accessed using the WS2812 driver via the D8 pin.

For an example that uses the built-in Neopixel LEDs, take a look at the TinyGo drivers repository located at https://.com/tinygo-org/drivers/tree/release/examples

Bluetooth support is now available for the Circuit Playground Bluefruit board. See https://.com/tinygo-org/bluetooth for more information.

Updating the UF2 bootloader

This board uses a UF2 bootloader created by Adafruit: https://.com/adafruit/Adafruit_nRF52_Bootloader

We recommend bootloader version 0.4.1 or above. You can check what version is installed on your board by double-clicking the button on the board to launch the bootloader. When you do this, a USB volume that should automatically be mounted on your computer. Check the file named “INFO_UF2.TXT” on that drive. The bootloader firmware version should be listed in that file, for example:

UF2 Bootloader 0.4.1 lib/nrfx (v2.0.0) lib/tinyusb (0.6.0-272-g4e6aa0d8) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Adafruit Circuit Playground nRF52840
Board-ID: nRF52840-CircuitPlayground-revD
SoftDevice: S140 version 6.1.1
Date: Jan 19 2021

To update the bootloader, you will need to install the adafruit-nrfutil program.

You can install it by running:

pip3 install --user adafruit-nrfutil

Once you have installed the adafruit-nrfutil program, download the firmware here: https://.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.4.1/circuitplayground_nrf52840_bootloader-0.4.1.zip

Unzip the files in this zip file and save them to a convenient location.

Plug in your Circuit Playground Bluefruit board to your computer’s USB port.

Now we are ready to update the firmware. Run a command something like the following, adjusting for any difference based on where you have saved the files, and what your serial port is named:

 adafruit-nrfutil --verbose dfu serial --package circuitplayground_nrf52840_bootloader-0.4.1_s140_6.1.1.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200

Note that you should be flashing the board using the zip file that was contained within the zip file that you downloaded, NOT the file that you downloaded.

Once you have flashed the board with the adafruit-nrfutil it should restart the board with the new bootloader. You only need to do this update once, and then from that point on the new bootloader will be active.