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
109,00€
Ruuvi is based in Finland. If you’re an EU consumer, VAT is included. If you’re a non-EU customer, you don't pay VAT. If you're an EU business, insert your VAT ID at checkout.
In stock
The Development Kit is designed for hardcore developers who would like to take their RuuviTag sensors to the limit by flashing and debugging the devices via SWD (Serial-Wire-Debug) bus or use RuuviTag’s extra IO connections on bottom of the circuit board.
The package includes:
- 1 x Nordic Semiconductor nRF52-DK evaluation kit
- 1 x Development shield designed for RuuviTag
Advantages of the kit
- Use third-party protocol stacks or operating systems (ie. Wirepas Connectivity or other 3rd party)
- Debug your firmware via SWD (the nRF52-DK has an integrated Segger J-Link programmer)
- Easy access to all the IO pins found on bottom of the RuuviTag
- The original RuuviTag software can be restored (factory reset)
- Safely test different protocol stacks in development (Bluetooth 5 for example, an upcoming feature)
- No hassle with a battery while developing because the shield powers the RuuviTag
Do I need one?
The DevKit isn’t needed if you’re happy to flash your RuuviTags over-the-air.
For most of the people, DFU OTA (Device Firmware Update Over-the-Air) is enough if no protocol stack or bootloader has to be replaced or no serious debugging is needed.
Note also that if you’re developing your own firmware, power consumption measurements are recommended so that possible current leaks can be obtained. A great tool for this is Nordic Semiconductor’s Power Profiler Kit which is compatible with the nRF52-DK evaluation board.
To read more about the DevKit, refer to RuuviLab’s tutorial.