Files
web-bluetooth-dfu/README.md
2016-03-07 11:36:37 +01:00

3.3 KiB

Web Bluetooth DFU

Circle CI Bower npm Licence MIT

Device firmware update with Web Bluetooth

Update device firmware via Web Bluetooth following the protocol here:

http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk52.v0.9.2/bledfu_transport.html?cp=4_0_2_4_2_4

Device Configuration

You will need an nRF51 or nRF52 development kit, flashed with the appropriate image:

nrf51_boot_s110.hex

nrf52_boot_s132.hex

Web Example

Open this site in a Web Bluetooth enabled browser:

https://thegecko.github.io/web-bluetooth-dfu/

Node Example

Clone this repository, install the npm dependencies and execute.

$ npm install
$ node example_node <device-type>

Where <device-type> is one of nrf51 or nrf52.

Updating the SoftDevice or Bootloader

When updating the application nothing special needs to be done - the only input required is APPLICATION.hex. However it is possible to update the SoftDevice or Bootloader as well. The user will need to specify the image type of the update when transferring a SoftDevice or Bootloader in dfu.provision() (i.e. dfu.provision(device, buffer, dfu.ImageType.SoftDevice);) along with the following:

Softdevice: When updating the SoftDevice we must not rewrite the Master Boot Record (MBR). As the MBR is included in Nordic's SoftDevices at the beggining of FLASH, the end address of the MBR will need to be specified when converting the hex file (i.e. hex2bin(softdevice.hex, 0x1000);). This way when updating the SoftDevice the current MBR already on the device will be preserved, but the SoftDevice will be replaced. User is responsible for determining the end address of the MBR for their specific SoftDevice and specifying this as an input to hex2bin.

Bootloader: When updating the bootloader we must not rewrite the UICR. The UICR is a special page of FLASH located in a different memory region on Nordic Devices. Nordic's DFU protocol does not support transferring data that is located in this memory region, and thus it needs to be trimmed off of our BOOTLOADER.hex file. However hex2bin will take care of this automatically and no special care needs to be taken when doing this type of update.

Note: Currently updating the SoftDevice and Bootloader at the same time is not supported.