Skip to content

Console Windows application to upload an application via BLE

Notifications You must be signed in to change notification settings

astronomer80/nrf52_bledfu_win

Repository files navigation

nrf52_bledfu_win

Console Windows app to upload an application via BLE on nRF52 MCU that has the DFU Service installed.
It works only on Windows versions >= 10 and a PC with a Bluetooth 4.0 interface
Usage: OTADfu_Console.exe [help] or [scan] or [update -f <bin_file> -d <dat_file> -a <device_address>] or [update -z <zip_file> -a <device_address>]

OTA DFU update application for nrf5x MCUs. Visit https://github.com/astronomer80/nrf52_bledfu_win for more information
Here a list of commands available:
help: Show this help
scan: Scan BLE devices already paired with Windows Settings
update -f < bin_file > -d < dat_file > -a <device_address>. bin_file is the file generated from the Arduino IDE. dat_file is the init packet generated by nrfutil application. device_address: is the address of the device returned using 'scan' command.
update -z < zip_file > -a <device_address>. zip_file is the archive generated by nrfutil application. device_address: is the address of the device returned using 'scan' command.
update -h < hex_file/bin_file > -a <device_address>. hex_file or the bin_file is generated by the Arduino IDE. nrfutil application generates the zip archive. device_address: is the address of the device returned using 'scan' command.

Optional parameter -v: Verbose mode. Adding this parameter as last shows more information during the update procedure.
Example:
OTADfu_Console.exe help
OTADfu_Console.exe scan
OTADfu_Console.exe update -z application.zip -a xxxxxxx
OTADfu_Console.exe update -f application.bin -d application.dat -a xxxxxxx
OTADfu_Console.exe update -h application.bin -a xxxxxxx -v
where xxxxxxx is the device address returned by scan command
DFU Procedure performed by this application:

1)Send 'START DFU' opcode + Application Command (0x0104)
2)Send the image size
3)Send 'INIT DFU' Command (0x0200): Called in the controlPoint_CalueChanged event invoked when the BLE device replies after sending the image size.
4)Transmit the Init image (The file DAT content)
5)Send 'INIT DFU' + Complete Command (0x0201)
6)Send packet receipt notification interval (currently 10)
7)Send 'RECEIVE FIRMWARE IMAGE' command to set DFU in firmware receive state. (0x0300)
8)Send bin array contents as a series of packets (burst mode). Each segment is pkt_payload_size bytes long. For every packet send, wait for notification.
9)Send Validate Command (0x0400)
10)Send Activate and Reset Command (0x0500)


# TODO #
- Manage ecprypted packates
- Update bootloader and softdevice, too