Finally I received my
AtomWear VigekWear development kit after the successful Kickstarter campaign. It arrived just after I handed in my dissertation, so the timing couldn’t have been better As usual the Kickstarter campaign had different rewards, so I went for the ultimate kit, which includes the base board, a flexible printed circuit, a rubber band and six modules – MCU, battery, debug, magnetometer/gyroscope, thermometer/barometer and OLED screen. I can’t complain – it’s a pretty sweet kit, basically has everything to build your own FitBit or Jawbone tracker. And it comes pre-programmed to display steps or temperature on the OLED screen.
The kit is based on Nordic Semiconductor’s nRF51822 processor, which basically is an ARM Cortex-M0 processor with an integrated BLE module – a well-suited processor for low-power applications. Even though it’s pretty fun to play around with the software that it came with, how to program it?
Well, as it is a small wearable device, rather than a full-on development board, it does not have an on-board debugger, which means, that it needs an external one connected through the DBG module. As all the development boards, that I used until now had on-board debuggers, I’ve actually never looked into getting one. So it was about time! Developers from Giayee recommend using a J-Link debugger, but in fact any ARM debugger for Cortex-M0 will do. I decided to go with the J-Link EDU, which is an educational platform capable of debugging the whole family of Cortex-M processors over SWD. However, it comes with a very limited license for Segger software and limited support.
Connecting the debugger to the
AtomWear VigekWear is very straight forward. The image below gives a pinout of the J-Link 20pin socket (not the ribbon cable) and the DBG module pinout. Only 4 pins have to be connected for flashing and debugging: Vref, GND, SWDIO and SWDCLK.
Because the J-Link EDU comes with a limited software license, I ran into some trouble with flashing the MCU, as the license does not cover the Segger J-Flash program. After trying out different products from Segger and Nordic Semi, I found out a way to go about this. So, to load your compiled program to the
AtomWear VigekWear, you need to perform the following steps:
- Download and install drivers and software from Segger. This will install the drivers and about 15 more applications on your computer. However, if you’re using the J-Link EDU (just like me), you won’t be able to use half of it. So, you can uninstall most of the applications, but make sure that you keep the JLink.dll file, otherwise you won’t be able to flash the MCU.
- Download and install the nRFgo Studio from Nordic Semiconductor. This will be the main tool used to program the MCU.
Finally, to flash the MCU, you will need two files – the softdevice (for my applications I’m using the s110 softdevice) and the compiled program hex files. If you don’t have your own program yet, you can use the
AtomWear VigekWear program supplied with support files (AtomWear.hex). Open the nRFgo Studio, and if your AtomWear VigekWear is connected properly, you should see the following text:
It displays the version of the debugger firmware and the ‘Boards connected’, which is empty, as it does not recognize the board. Then, click ‘nRF51 Programming’ under the ‘Device Manager’ tab on the left. It will now display what’s installed on the device and will give you options to flash a new softdevice/program/bootloader or erase everything.
So, to flash a new program just go to the ‘Program Application’ tab, select the hex file that you want to upload and press ‘Program’. When it’s done programming, check that the program successfully flashed by pressing the ‘Verify’ button.
How to get the hex file? Well, you have to use an IDE to write your program. Until now I was using Keil uVision 5 to write programs for ARM development boards, but the free version of uVision allows you to flash programs up to 32kB. It’s enough for most applications, but unless you want to write very basic BLE applications, your programs will be bigger. Therefore, I am using the mbed online compiler from ARM as it does not have a program size limit. The only difference is that instead of giving you two hex files (one for the softdevice and one for the program), it combines them into one hex file. So, to flash this file onto the board, you will need to erase everything that is stored on the board by clicking the ‘Erase all’ button. Now you will see that there’s only one region in the device memory:
Now you need to select your combined hex file from the ‘Program Application’ tab (mine’s called nRF51822.hex) and flash it to the board. If the board flashes successfully, you should see that the memory is now split into two regions: the SoftDevice and Application:
AtomWear VigekWear by removing the power source (battery or the USB cable) and your application should start running.
I hope that you found it useful and let me know if you have any questions or suggestions for an easier way of doing this.
Updated: AtomWear changed its name to VigekWear after a lawsuit from Intel. Updated my post accordingly. More info about this here: https://github.com/VigekWear/Vigekwear