nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Running the serial bootloader example

Instead of using BLE as transport protocol, you can also use serial transport. The SDK provides two example applications for serial (HCI) transport, one for a single-bank update and another for a dual-bank update. See Dual-bank and single-bank updates for more information about these update types.

The general setup and the process of programming the SoftDevice and bootloader are as described in Running the BLE bootloader example. However, you cannot use the Master Control Panel to perform a Device Firmware Update. Instead, nRFgo Studio provides a tool that is similar to the Advanced: IronPython script for DFU for BLE.

Updating the device firmware

Program the SoftDevice and bootloader as described in Programming the DFU bootloader, but use one of the examples for serial transport. The examples for serial transport do not actually require any SoftDevice functions, but installing the SoftDevice provides the Master Boot Record, which is required for running the bootloader.

The names for the examples are dfu_single_bank_serial_s130_pca10028 and dfu_dual_bank_serial_s130_pca10028. If you are not using Keil to work with the SDK, you can find the source code and project file of the examples in the following folder: <InstallFolder>\examples\dfu\bootloader

The tool that you use to update the device firmware is delivered with nRFgo Studio. To use it, ensure that you have installed nRFgo Studio v1.18 or later. By default, the script is located in the C:\Program Files (x86)\Nordic Semiconductor\nRFgo Studio\ folder.

As test images, you can use the firmware images that are provided in the folders <BaseFolder>\dfu\hci_dfu_send_hex\test_images_single_bank_update or test_images_dual_bank_update, respectively. If you are using Keil packs, the default <BaseFolder> is C:\Keil\ARM\Pack\NordicSemiconductor\nRF_Examples\<version>. If you are using the repository distribution variant of the SDK, <BaseFolder> is <InstallFolder>\examples. Use the images for the example that you are running. You cannot update a single-bank bootloader to a dual-bank bootloader or vice versa.

The script uses the following syntax:

hci_dfu_send_hex.exe --file <image_file.zip> --port <com_port> [--flowcontrol] [--baudrate <baud_rate>]
  • <image_file.zip> contains the firmware image and the init packet.
  • <com_port> is the COM port to which the device is connected.
  • --flowcontrol must be specified to enable flow control. If it is not specified, flow control is disabled. The provided examples use flow control, so you must specify this parameter.
  • <baud_rate> is the desired baud rate. Valid values are 38400, 96000, 115200, 230400, 250000, 460800, 921600, and 1000000. Baud rates over 115200 are supported by nRF51822, but might not be supported by all RS232 devices on Windows. If no baud rate is specified, the default baud rate 38400 is used. The provided examples use the default baud rate.

Use hci_dfu_send_hex.exe --help to display usage information.

Verifying the transferred firmware

If you used one of the provided example image files, you can verify that the Device Firmware Update completed as expected as follows:

Image Verification
dfu_test_bootloader_b_hci.zip
dfu_test_softdevice_w_bootloader_b_hci.zip
With the updated bootloader, LED 4 is lit instead of LED 3 when the device is in bootloader mode.
dfu_test_softdevice_b.zip
dfu_test_softdevice_w_bootloader_b_hci.zip
Check the data at location 0x00003000 by issuing the following command:
nrfjprog –memrd 0x3000 –w 32 –n 16
The data has changed to FFFFFF10 51B1E5DB 00018000 FFFFFFFF. Before the update, the last two bytes were 0064 (for SoftDevice S110 8.0.0; other SoftDevices might have a different value).
dfu_test_app_hrm.zip Open the Master Control Panel. The device is advertising as "Dfu_HRM".