This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU over BLE for Simblee

Hello,

We have around 700 product in the field based on the Simblee BLE module, which was discontinued 1+ year ago. Application was developed using Simblee's proprietary library and the Arduino IDE. We are switching to Laird's BL652 and now using Nordic SDK 15.3.0.

We have our app, based on Nordic SDK 15.3 and S112, developed and working well on our custom board with Laird's BL652. We are adding a new feature that uses the Timeslot API. This API is not available through Simblee's proprietary library, so we are looking for ways of getting all 700 Simblee-based product in the field updated to a new app based on Nordic SDK 10.0 and S110.

I am confident we can develop the app and flash it to Simblee over USB. This video shows how to erase an RFduino (precursor to Simblee) and flash an app based on Nordic SDK.

What's unclear is whether or not it's possible to push an update out to our users via our iOS app and use DFU over BLE to update the Simblee peripherals. This would be ideal as it would not require that our users send their devices back for update.

Simblee uses nRF51822 revision 3 and I think has 128K flash. See attached Simblee data sheet (block diagram on page 6).

Simblee is flashed using the Arduino IDE and a USB shield. If "#include <ota_bootloader.h>" is in app source, a bootloader capable of legacy DFU over BLE is flashed along with the application. See screen capture of nRF Connect showing legacy DFU service, etc. All 700 devices in the field have OTA bootloader flashed.

I am able to build a new version (hex file) of the Simblee app (using Arduino IDE) and use version 0.5.2 of nrfutil to create a zip file:

nrfutil dfu genpkg new_app.zip --application new_app.hex --application-version 0xffff --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe

(Interesting that --sd-req is 0xfffe.) Using iOS-Pods-DFU-Library, I can then use the standard procedure to perform DFU over BLE. Here's the code (objective C):

NSURL *bundledFirmwareURL = [[NSBundle mainBundle] URLForResource:@"new_app" withExtension:@"zip"];
DFUFirmware *selectedFirmware = [[DFUFirmware alloc] initWithUrlToZipFile:bundledFirmwareURL];

DFUServiceInitiator *initiator = [[DFUServiceInitiator alloc] initWithQueue:dispatch_get_main_queue()
delegateQueue:dispatch_get_main_queue()
progressQueue:dispatch_get_main_queue()
loggerQueue:dispatch_get_main_queue()];

[initiator withFirmware:selectedFirmware];
initiator.packetReceiptNotificationParameter = 2; // default is 12
initiator.logger = self; // - to get log info
initiator.delegate = self; // - to be informed about current state and errors
initiator.progressDelegate = self; // - to show progress bar

DFUServiceController *controller = [initiator startWithTarget: myPeripheral];

Here's a log of DFU process:

2020-04-21 09:32:46.898944-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateConnecting
2020-04-21 09:32:46.898999-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:32:46.899737-0600 myapp[6798:4964585] logWith: [Callback] Central Manager did update state to: Powered ON
2020-04-21 09:32:46.899757-0600 myapp[6798:4964585] logWith: Connecting to p1...
2020-04-21 09:32:46.899769-0600 myapp[6798:4964585] logWith: centralManager.connect(peripheral, options: nil)
2020-04-21 09:32:46.900128-0600 myapp[6798:4964585] logWith: [Callback] Central Manager did connect peripheral
2020-04-21 09:32:46.900150-0600 myapp[6798:4964585] logWith: Connected to p1
2020-04-21 09:32:46.900161-0600 myapp[6798:4964585] logWith: Discovering services...
2020-04-21 09:32:46.900171-0600 myapp[6798:4964585] logWith: peripheral.discoverServices(nil)
2020-04-21 09:32:46.901252-0600 myapp[6798:4964585] logWith: Services discovered
2020-04-21 09:32:46.901281-0600 myapp[6798:4964585] logWith: Starting Legacy DFU...
2020-04-21 09:32:46.901292-0600 myapp[6798:4964585] logWith: Connected to p1
2020-04-21 09:32:46.901303-0600 myapp[6798:4964585] logWith: Services discovered
2020-04-21 09:32:46.901312-0600 myapp[6798:4964585] logWith: Legacy DFU Service found
2020-04-21 09:32:46.901322-0600 myapp[6798:4964585] logWith: Discovering characteristics in DFU Service...
2020-04-21 09:32:46.901332-0600 myapp[6798:4964585] logWith: peripheral.discoverCharacteristics(nil, for: 00001530-1212-EFDE-1523-785FEABCD123)
2020-04-21 09:32:47.146054-0600 myapp[6798:4964585] logWith: DFU characteristics discovered
2020-04-21 09:32:47.146596-0600 myapp[6798:4964585] logWith: Reading DFU Version number...
2020-04-21 09:32:47.146757-0600 myapp[6798:4964585] logWith: peripheral.readValue(00001534-1212-EFDE-1523-785FEABCD123)
2020-04-21 09:32:47.202713-0600 myapp[6798:4964585] logWith: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x): 0100
2020-04-21 09:32:47.202883-0600 myapp[6798:4964585] logWith: Version number read: 0.1
2020-04-21 09:32:47.203008-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateStarting
2020-04-21 09:32:47.203542-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:32:47.203698-0600 myapp[6798:4964585] logWith: Enabling notifications for 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:47.203836-0600 myapp[6798:4964585] logWith: peripheral.setNotifyValue(true, for: 00001531-1212-EFDE-1523-785FEABCD123)
2020-04-21 09:32:47.323522-0600 myapp[6798:4964585] logWith: Notifications enabled for 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:47.323756-0600 myapp[6798:4964585] logWith: DFU Control Point notifications enabled
2020-04-21 09:32:47.323890-0600 myapp[6798:4964585] logWith: Application with buttonless update found
2020-04-21 09:32:47.324011-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateEnablingDfuMode
2020-04-21 09:32:47.324256-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:32:47.324767-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:47.324929-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x0104, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:32:47.381446-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:47.381623-0600 myapp[6798:4964585] logWith: Jump to bootloader (Op Code = 1, Upload Mode = 4) request sent
2020-04-21 09:32:47.568087-0600 myapp[6798:4964585] logWith: [Callback] Central Manager did disconnect peripheral
2020-04-21 09:32:47.568292-0600 myapp[6798:4964585] logWith: Disconnected by the remote device
2020-04-21 09:32:47.568425-0600 myapp[6798:4964585] logWith: Connecting to p1...
2020-04-21 09:32:47.568555-0600 myapp[6798:4964585] logWith: centralManager.connect(peripheral, options: nil)
2020-04-21 09:32:47.990087-0600 myapp[6798:4964585] logWith: [Callback] Central Manager did connect peripheral
2020-04-21 09:32:47.990305-0600 myapp[6798:4964585] logWith: Connected to p1
2020-04-21 09:32:47.990439-0600 myapp[6798:4964585] logWith: Discovering services...
2020-04-21 09:32:47.990561-0600 myapp[6798:4964585] logWith: peripheral.discoverServices([00001530-1212-EFDE-1523-785FEABCD123])
2020-04-21 09:32:48.348668-0600 myapp[6798:4964585] logWith: Services discovered
2020-04-21 09:32:48.348880-0600 myapp[6798:4964585] logWith: Legacy DFU Service found
2020-04-21 09:32:48.349146-0600 myapp[6798:4964585] logWith: Discovering characteristics in DFU Service...
2020-04-21 09:32:48.349300-0600 myapp[6798:4964585] logWith: peripheral.discoverCharacteristics(nil, for: 00001530-1212-EFDE-1523-785FEABCD123)
2020-04-21 09:32:48.590536-0600 myapp[6798:4964585] logWith: DFU characteristics discovered
2020-04-21 09:32:48.590722-0600 myapp[6798:4964585] logWith: Reading DFU Version number...
2020-04-21 09:32:48.590997-0600 myapp[6798:4964585] logWith: peripheral.readValue(00001534-1212-EFDE-1523-785FEABCD123)
2020-04-21 09:32:48.648168-0600 myapp[6798:4964585] logWith: Read Response received from 00001534-1212-EFDE-1523-785FEABCD123, value (0x): 0600
2020-04-21 09:32:48.648352-0600 myapp[6798:4964585] logWith: Version number read: 0.6
2020-04-21 09:32:48.648480-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateStarting
2020-04-21 09:32:48.648896-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:32:48.649032-0600 myapp[6798:4964585] logWith: Enabling notifications for 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:48.649222-0600 myapp[6798:4964585] logWith: peripheral.setNotifyValue(true, for: 00001531-1212-EFDE-1523-785FEABCD123)
2020-04-21 09:32:48.769654-0600 myapp[6798:4964585] logWith: Notifications enabled for 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:48.769859-0600 myapp[6798:4964585] logWith: DFU Control Point notifications enabled
2020-04-21 09:32:48.770003-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:48.770136-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x0104, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:32:48.770262-0600 myapp[6798:4964585] logWith: Writing image sizes (0b, 0b, 34376b) to characteristic 00001532-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:48.770387-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x000000000000000048860000, for: 00001532-1212-EFDE-1523-785FEABCD123, type: .withoutResponse)
2020-04-21 09:32:48.826747-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:48.826945-0600 myapp[6798:4964585] logWith: Start DFU (Op Code = 1, Upload Mode = 4) request sent
2020-04-21 09:32:50.631436-0600 myapp[6798:4964585] logWith: Notification received from 00001531-1212-EFDE-1523-785FEABCD123, value (0x): 100101
2020-04-21 09:32:50.631663-0600 myapp[6798:4964585] logWith: Response (Op Code = 1, Status = 1) received
2020-04-21 09:32:50.631807-0600 myapp[6798:4964585] logWith: Writing Initialize DFU Parameters...
2020-04-21 09:32:50.631932-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:50.632057-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x0200, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:32:50.632179-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001532-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:50.632310-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0xffffffffffff00000100feff0cc0, for: 00001532-1212-EFDE-1523-785FEABCD123, type: .withoutResponse)
2020-04-21 09:32:50.632433-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:50.632555-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x0201, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:32:50.686862-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:50.746196-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:50.748853-0600 myapp[6798:4964585] logWith: Notification received from 00001531-1212-EFDE-1523-785FEABCD123, value (0x): 100201
2020-04-21 09:32:50.749026-0600 myapp[6798:4964585] logWith: Response (Op Code = 2, Status = 1) received
2020-04-21 09:32:50.749217-0600 myapp[6798:4964585] logWith: Initialize DFU Parameters completed
2020-04-21 09:32:50.750442-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateUploading
2020-04-21 09:32:50.750809-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:32:50.750953-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:50.751086-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x080200, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:32:50.808035-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:50.808253-0600 myapp[6798:4964585] logWith: Packet Receipt Notif Req (Op Code = 8, Value = 2) request sent
2020-04-21 09:32:50.808391-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:32:50.808670-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x03, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:32:50.867842-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:32:50.868020-0600 myapp[6798:4964585] logWith: Uploading firmware...
2020-04-21 09:32:50.868156-0600 myapp[6798:4964585] logWith: Sending firmware to DFU Packet characteristic...
2020-04-21 09:32:50.868323-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 0
2020-04-21 09:32:51.348064-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 1
2020-04-21 09:32:51.887798-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 2
2020-04-21 09:32:52.367730-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 3
2020-04-21 09:32:52.907785-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 4
2020-04-21 09:32:53.478040-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 5
2020-04-21 09:32:54.018251-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 6
2020-04-21 09:32:54.557918-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 7
2020-04-21 09:32:55.068485-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 8
2020-04-21 09:32:55.637790-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 9
2020-04-21 09:32:56.117765-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 10
2020-04-21 09:32:56.657789-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 11
2020-04-21 09:32:57.227668-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 12
2020-04-21 09:32:57.707820-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 13
2020-04-21 09:32:58.337878-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 14
2020-04-21 09:32:58.817613-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 15

.
.
.

2020-04-21 09:33:42.047232-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 96
2020-04-21 09:33:42.526689-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 97
2020-04-21 09:33:43.096535-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 98
2020-04-21 09:33:43.576753-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 99
2020-04-21 09:33:44.115962-0600 myapp[6798:4964585] dfuProgressDidChangeFor: 100
2020-04-21 09:33:44.177036-0600 myapp[6798:4964585] logWith: Notification received from 00001531-1212-EFDE-1523-785FEABCD123, value (0x): 100301
2020-04-21 09:33:44.177245-0600 myapp[6798:4964585] logWith: Response (Op Code = 3, Status = 1) received
2020-04-21 09:33:44.177383-0600 myapp[6798:4964585] logWith: Upload completed in 53.31 seconds
2020-04-21 09:33:44.177659-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateValidating
2020-04-21 09:33:44.177920-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:33:44.178052-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:33:44.178299-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x04, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:33:44.235144-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:33:44.235320-0600 myapp[6798:4964585] logWith: Validate Firmware (Op Code = 4) request sent
2020-04-21 09:33:44.266531-0600 myapp[6798:4964585] logWith: Notification received from 00001531-1212-EFDE-1523-785FEABCD123, value (0x): 100401
2020-04-21 09:33:44.266707-0600 myapp[6798:4964585] logWith: Response (Op Code = 4, Status = 1) received
2020-04-21 09:33:44.266840-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateDisconnecting
2020-04-21 09:33:44.267228-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>
2020-04-21 09:33:44.267456-0600 myapp[6798:4964585] logWith: Writing to characteristic 00001531-1212-EFDE-1523-785FEABCD123...
2020-04-21 09:33:44.267631-0600 myapp[6798:4964585] logWith: peripheral.writeValue(0x05, for: 00001531-1212-EFDE-1523-785FEABCD123, type: .withResponse)
2020-04-21 09:33:44.325032-0600 myapp[6798:4964585] logWith: Data written to 00001531-1212-EFDE-1523-785FEABCD123
2020-04-21 09:33:44.325210-0600 myapp[6798:4964585] logWith: Activate and Reset (Op Code = 5) request sent
2020-04-21 09:33:44.512551-0600 myapp[6798:4964585] logWith: [Callback] Central Manager did disconnect peripheral
2020-04-21 09:33:44.512743-0600 myapp[6798:4964585] logWith: Disconnected by the remote device
2020-04-21 09:33:44.512872-0600 myapp[6798:4964585] dfuStateDidChangeTo: DFUStateCompleted
2020-04-21 09:33:44.513096-0600 myapp[6798:4964585] self.centralManager.delegate is <myCentralManager: 0x1c01bed80>

We don't know how Simblee's library was developed, if with the Nordic SDK of the time, which SoftDevice and version was used, if at all. All we know is all Simblee devices in the field have the legacy DFU service installed. Is there a way we can learn more, like which SD is used? If we knew that a SD was used and the version, we could develop our new Nordic SDK-based app for Simblee so that DFU over BLE would work? Perhaps the only DFU over BLE option available is to update all of bootloader, SD and app. Given Simblee is only 128K, not sure if this is possible.

Any guidance would be greatly appreciated.

Many thanks,

Tim

Simblee RFD77101 Datasheet v2.2.pdf

  • Hi Edvin,

    As per related ticket ...

    I have ble_app_uart for s130 in SDK 12.3 now working with s110. I also discovered that Simblee apps are located at 0x1F000 instead of the standard location 0x18000. I don't understand why. When I change the FLASH_START address from 0x18000 to 0x1F000 and build the app, I can take the hex file, generated a zip using nrfutil and the Simblee bootloader will accept the image and the app runs properly.

    So I'm good now and will proceed with work to customize ble_app_uart for our application.

    Many thanks for your help along the way.

    Tim

Related