BBC micro:bit

Support for the BBC micro:bit. More...

Detailed Description

Support for the BBC micro:bit.

Overview

The micro:bit was designed by the BBC and released in 2015. The boards was distributed to all 11-12 year old children throughout the UK.

The board is based on the Nordic nRF51822 SoC, featuring 16KiB of RAM, 256KiB of ROM, and a 2.4GHz radio, that supports Bluetooth Low Energy (BLE) as well as a Nordic proprietary radio mode.

Additionally the boards features 2 buttons, a 5x5 LED matrix, a MAG3110 3-axis magnetometer, and a MMA8653 3-axis accelerometer.

Hardware

micro:bit

MCU NRF51822QFAA
Family ARM Cortex-M0
Vendor Nordic Semiconductor
RAM 16KiB
Flash 256KiB
Frequency 16MHz
FPU no
Timers 3 (2x 16-bit, 1x 32-bit [TIMER0])
ADCs 1x 10-bit (8 channels)
UARTs 1
SPIs 2
I2Cs 2
Vcc 1.8V - 3.6V
Reference Manual Reference Manual

Flashing and Debugging

There are two possibilities to flash the board: using the default ARM DAPLink or you can flash the board using Segger's JLink.

DAPLink

The DAPLink interface is the default way to flash the board and works out of the box. When you plug the board to your host computer, it shows up as a flash drive. To flash the board, you can simply copy your compiled .hex file onto the board, and that's it.

The micro:bit port comes with a little script that does this automatically, so you can flash the board as usual with

BOARD=microbit make flash

The DAPLink interface provides however not means for debugging the board.

JLink

Recently, Segger released a JLink firmware for the interface MCU on the micro:bit. You have to follow these instructions to flash the JLink firmware on your micro:bit. Don't worry, the process is very simple and you can revert the firmware back to the DAPLink default anytime (as described here).

Once you have flashed the JLink firmware, you can flash the board like this:

BOARD=microbit FLASHTOOL=jlink make flash

With the JLink firmware, you can now also do in-circuit debugging etc.

Note: The current version of the JLink firmware (JLink_OB_BBC_microbit_16-07-29.hex) does not support any serial port over USB, so you can not use the RIOT shell with this firmware.**

QEMU emulation

The microbit can be partly emulated by QEMU.

This requires at least QEMU 4.0 with ARM platform support enabled.

NOTE*: not all peripherals are emulated. See this page for an overview. E.g., there's no emulation for the radio, thus applications using that will fail.

Use it like this:

$ cd examples/hello-world
$ BOARD=microbit make clean all -j4
$ BOARD=microbit make emulate

Files

file  board.h
 Board specific configuration for the BBC micro:bit.
 
file  gpio_params.h
 Board specific configuration of direct mapped GPIOs.
 
file  microbit.h
 BBC micro:bit specific LED handling.
 
file  periph_conf.h
 Peripheral configuration for the BBC micro:bit.