nrf51 dongle, Mac OSX and programming

English: a bluetooth dongle
English: a bluetooth dongle (Photo credit: Wikipedia)

Since I need to work on very small form factor device I searched for a tiny microcontroller with BLE and found Nordic Semiconductor with their nRF1822 and it is a perfect thing for my needs.


Since the customer will order the elements I ordered a nRF51 dongle so I can play with programming it before starting “proper” work on it.


The device came today and I tried to flash a blinky example which is more or less an easy thing… on Windows. But I wanted to do it on Mac OSX so … here are the findings:


1. Download the J-Link software from SEGGER webpage – Mac OSX version, obviously.


2. Under developer on Nordic web page download latest SDK (you might need to create an account there – by using My Page on their home page).


3. Go to <SDK directory>/components/toolchain/gcc and correct links in Makefile.posix (if needed).


4. Go to <SDK directory>/examples/peripheral/blinky/pca10028/blank/armgcc and compile the code with make command


5. The easiest way to upload the code to the dongle is to use the script and the syntax is ./ –flash <hex code>. You might need to reset it before that with ./ –reset.


6. Voila – it should work 🙂


Arduino and spi

Arduino Mega2560
Arduino Mega2560 (Photo credit: Wikipedia)

I wanted to use SPI on Arduino Uno and after reading some documentation I used SPI.beginTransaction() command to start the SPI communication, but nothing.


After banging my head against the wall I decided to start older (not recommended) version of


SPI.begin()… and voila. It worked.




Go figure.