Recently I suffered a hardware failure on my laptop, so I had the pleasure of verifying my backups as well as setting up the development environment again.

As we get questions every now and the about how to develop firmware, I’ll write down the steps here.
My computer is running Debian 8 (Wheezy), 64 bit, nothing special in hardware.
First, I downloaded the arm-gcc toolchain version 4.9-2015q3, while the compiler has had plenty of updates since then this is the version Nordic SDK 12.3 has been tested with. To run the binaries on 64 bit computer you might have to install some libraries. I placed the toolchain into /usr/local/, so I don’t need to adjust makefiles later on.
I already had the usual build tools installed, but you might need to install build-essentials etc for make, curl etc.
To actually flash the hexes on boards, Nordic Command Line Tools are required. If you want to create DFU packages which are sent over Bluetooth, you’ll need nRF utils. If you’re going to use wired connection to RuuviTag via Dev Shield, you’ll need JLink Segger software.
Then, I cloned the RuuviTag firmware from the official git repository and ran make. The script downloads Nordic SDK and builds the bootloader and example programs.
The development environment is now set up, next post in the series will discuss on how to flash and debug the programs using JLink.
Pssst…
Get the RuuviTag Development kit to complete your set-up!
RuuviTag Development Kit
99,00€
Ruuvi on suomalainen yritys. Mikäli olet EU-maassa asuva kuluttaja-asiakas, ALV sisältyy hintaan. Mikäli tilaat EU:n ulkopuolelta, ALV ei sisälly. Mikäli tilaat EU-maassa sijaitsevalle yritykselle, anna ALV-tunnus kassalla.
Varastossa
Kehityskitti on suunniteltu erityisesti firmware-ohjelmistokehittäjiä varten. Sen avulla voit helposti flashata uuden firmwaren ja debugata ohjelmaasi SWD-väylän (Serial-Wire-Debug) kautta. Voit myös kytkeytyä kaikkiin RuuviTagin IO-pinneihin, jotka on tuotu saataville levyn pohjaan.
Paketti sisältää:
- 1 x Nordic Semiconductor nRF52-DK -kehitysalusta
- 1 x Piirilevy, jonka jousipinnit luovat kontaktin RuuviTagiin
Kehityskitin edut
- Voit käyttää muita kommunikointiprotokollia kuin Bluetooth (esimerkiksi Wirepas) ja ohjelmoida RuuviTagin muistin uudelleen alusta saakka
- Debuggaa ohjelmistoasi SWD-yhteyden avulla (nRF52-DK-alustassa on integroitu Segger J-Link -ohjelmointilaite)
- Luo helposti yhteys kaikkiin RuuviTagin pohjassa oleviin testipisteisiin
- Tyhjennä muisti täysin ja ohjelmoi RuuviTagin ohjelmisto uudelleen
- Testaa turvallisesti uusia firmware-ohjelmistoja
- Kehityskitti antaa RuuviTagille virran, joten paristoa ei tarvita
Tarvitsenko kitin?
Et tarvitse kehityskittiä mikäli olet tyytyväinen RuuviTagien ohjelmontiin langattomasti (ovar-the-air).
Suurimmalle osalle käyttäjistä DFU OTA (Device Firmware Update Over-the-Air) on tarpeeksi. Mikäli protokollaa tai bootloaderia halutaan vaihtaa, silloin langallinen ohjelmointi on vaatimus.
Huomaathan, että jos kehität omaa firmwarea paristokäyttöiselle laitteelle, virtamittauksien teko on erittäin suositeltavaa. Hyvä työkalu virtamittaukseen on Nordic Semiconductor’s Power Profiler Kit, joka on yhteensopiva nRF52-DK -kehityslevyn kanssa.
Lisää tietoa kitistä löytyy RuuviLabin tutoriaalista.