Skip to content

Instantly share code, notes, and snippets.

@tstellanova
Last active April 24, 2020 16:11
Show Gist options
  • Save tstellanova/7c78979f93f6a9db540ac3c319c5d474 to your computer and use it in GitHub Desktop.
Save tstellanova/7c78979f93f6a9db540ac3c319c5d474 to your computer and use it in GitHub Desktop.
Building arduino apps for D6 fitness tracker 2020

By any means necessary, get a serial bootloader onto the D6

I had to use linux bluetoothctl tools to scan for the D6 device, get its address, use nrfutil to update via bluetooth. Look at options with nrfutil dfu ble --help to figure out how to specify device address etc.

Some of the notes from Fanoush were helpful, some were not.

I eventually installed this binary which allowed me to upload subsequent binaries using TTL-over-USB rather than BLE.

Create a TTL-over-USB wire harness

The D6 routes 3 volt TTL lines over the USB connector for the purposes of DFU.
The standard USB pinout is:

  • black GND
  • green RX (connect TX here)
  • white TX (connect RX here)
  • red +5 VDC (optional, can be used for charging)

Follow the instructions for setting up Arduino with the D6 board manager:

  • Download and install the Arduino IDE (At least v1.6.12)
  • Start the Arduino IDE
  • Go into Preferences
  • Add https://atc1441.github.io/D6Library/package_nRF5_boards_index.json as an Additional Board Manager URL
  • Close and restart Arduino
  • Open the Boards Manager from the Tools -> Board menu and install D6 Tracker by ATC1441.
    This can take many minutes -- don't close the dialog before it finishes installing.
  • Select the DSD6 Tracker board from the Tools -> Board menu
  • In Preferences -> Show verbose output during both compilation and upload
  • Under File -> Examples -> D6 Examples there are multiple examples. Try building one. Watch the build output for the location of the .hex file.
  • Upload will fail in SerialUploader-- no idea why, but I used adafruit-nrfutil to repackage the hex file and load onto the device.

Install adafruit nrfutil

Going forward, use eg adafruit-nrfutil to repackage and install new firmware updates. For example, given a hex file from the arduino build:

adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application HeartRateTest.ino.hex dfu-pkg.zip
adafruit-nrfutil dfu serial --package dfu-pkg.zip -p /dev/cu.usbserial-0001 -b 38400

Note that the TTL-over-USB serial port rate is limited to 38400.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment