Getting Started with the VigekWear development kit

AtomWear Dev Kit

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.

AtomWear kitThe 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.

J-Link EDUConnecting 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.

connection

J-Link and AtomWearBecause 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:

  1. 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.
  2. 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:

nRFgoIt 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.

nRFgoSo, 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:

nRFgoNow 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:

nRFgoNotice, that I used an older version of the s110 SoftDevice with my application.

Restart the 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

2 comments to Getting Started with the VigekWear development kit

  1. lygrok says:

    Hi, I own an Atomwear and I’m having troubles to flash it properly.
    I’m using a j-link edu, I have compiled the github app (Version 2.1, both bootloader and app from https://github.com/AtomWear/Atomwear) and I have flashed it using nrfgo studio.

    But nevertheless, when it finishes flashing and it outputs a success message, I can’t verify if the write was successful, and I start getting different errors, like “Failed to read flash info”, “An error condition was detected in the JLinkARM DLL”, or “Could not connect to the target device”. It seems like the success of the flash procedure it’s almost random.

    I’m writing to you in case you are familiar with this problem, maybe you could help me how to fix it.

    Thanks in advance!

    PD: This is the output I used to get: http://i.imgur.com/OYwWrax.png

    • domas says:

      Hi lygrok,
      thanks for your comment.

      I tried to replicate your error, but wasn’t able to. Everything seems to be flashing fine for me.

      I guess you have installed the drivers from Segger, right? I remember, that it installs a .dll file, which you should not delete. Make sure that you have it.

      Also, are you able to erase all the data from memory?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>