Install Windows 7 Driver

If you are running Windows 7 you need to install this driver.

If you are on Mac, Win 10+ or Linux it is not required! Skip this step

Download Arduino IDE

You will need to use the Desktop IDE. Make sure you are running the latest version.

Install SoftDevice onto MicroBit

Arduino assumes there's a 'softdevice' radio already installed. If you used MicroPython with your microbit, that softdevice was erased.

Reinstalling it is easy, download this hex and 'drag' it to your MICROBIT drive to install a MakeCode bluetooth advertising example. That, for sure, will force you to have a softdevice on :)

Add NRF5x Board Support

The microbit uses the nRF51 which is not 'natively' supported. But its easy to add support!

In Arduino, go to Preferences and add https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json into the Additional Board Manager URL text box.

 

If this is not your first, make sure to separate URLs with a comma.

Open Tools>Board>Boards Manager from the menu bar, search for nRF5 and install "Nordic Semiconductor nRF5 Boards" by Sandeep Mistry

Select Board and Upload

Select BBC micro:bit from the Boards menu

Set SoftDevice to S110

And set the Port to the microbit

And create a new sketch with this blink demo

const int COL1 = 3;     // Column #1 control
const int LED = 26;     // 'row 1' led

void setup() {  
  Serial.begin(9600);
  
  Serial.println("microbit is ready!");

  // because the LEDs are multiplexed, we must ground the opposite side of the LED
  pinMode(COL1, OUTPUT);
  digitalWrite(COL1, LOW); 
   
  pinMode(LED, OUTPUT);   
}

void loop(){
  Serial.println("blink!");
  
  digitalWrite(LED, HIGH);
  delay(500);
  digitalWrite(LED, LOW);
  delay(500);
}

Click Upload!

If you get a warning about openocd - approve access so it can upload the code

You should see the top left LED blinking!

Linux Specific

The openocd build in the sandeepmistry package appears to be 32 bit. If you are running on a 64 bit linux install, you may get this error when trying to upload sketches:

{arduino folder}/packages/sandeepmistry/tools/openocd/0.10.0-dev.nrf5/bin/openocd: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory

To get around this, install the 32 bit version of the libudev library with:

sudo apt-get install libudev1:i386

You may also run into a permissions issue when trying to upload the sketch to the micro:bit. If you get an error message that ends with lines like this:

Error: unable to open CMSIS-DAP device 0xd28:0x204
Error: No Valid JTAG Interface Configured.
Error: No Valid JTAG Interface Configured.

Then you'll need to add a udev rule. Place the contents below in a file named /etc/udev/rules.d/99-microbit.rules

ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="664", GROUP="plugdev"

And then plug the micro:bit back in for the settings to take effect.

This guide was first published on Sep 27, 2017. It was last updated on Mar 08, 2024.

This page (Install board and blink!) was last updated on Mar 08, 2024.

Text editor powered by tinymce.