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

Not sure if it's the right .zip file format

Hello,

I'm trying to update an application with a dual bank over BLE, but first I wanted to try on the given examples so I'm sure that I'm creating the .zip files the right way.

I'm useing the nRF51422 uController (pca10028) with SDK 11, the s130 Softdevice and nRFutill 0.5.2.

These are the steps I take:

- First I use nRFgo Studio to program the SoftDevice.

- Then I use Keil uVision5 to load the given dfu_dual_bank_ble_s130_pca10028.uvprojx (path: C:\nRF5_SDK_11.0.0_89a8197\examples\dfu\bootloader\pca10028\dual_bank_ble_s130\arm5_no_packs) file on the uController.

- Then I use the cmd to navigate to my .hex target (e.g. C:\nRF5_SDK_11.0.0_89a8197\examples\peripheral\blinky_freertos\hex\blinky_FreeRTOS_pca10028) and build a .Zip file with nrfutil dfu genpkg --application app.hex --dev-type 1 --dev-revision 3 --application-version 2 --sd-req 0x80 app_dfu_package.zip (I allready tried it without --dev-type, --dev-revision, --application-version and --sd-req, because I'm not sure if eim correct with dev-type and dev-revision).

- Afert that I transfer the .zip file to my smart Phone, connect to the uController with nRF Connect and upload the application with the dfu button where I select the .zip option.

The .zip file is accepted and uploaded to the uController, but after that the uController doesn't do anything. It should use LED 1 & 2 and let them blink but everything (except LED5) is dark.

When I tried this with C:\nRF5_SDK_11.0.0_89a8197\examples\dfu\ble_dfu_send_hex\test_images_update_nrf51\dfu_test_app_hrm_s130.hex and the allready given .zip file both worked the same.

Where did it go wrong?

  • Hi,

    There are a number of checks that need to be met for the bootloader to accept the image. For instance the device must match (dev-type),  the application version must be larger than the current application version (application-version), the device must have a correct SoftDevice version (sd-req) etc.You can disable those checks to by setting 0xffff  for dev-type, dev-revision etc. (0xfffe for sd-req) as indicated here to see if that is the issue. You should not use that for upgrade images you send to customers though, as for instance upgrading to a firmware that does not match the SoftDevice could brick the device (it will only be recoverable using a debugger).

  • I tried to set everything to 0xFFFF (and --sd-req to 0xFFFE), but it didnt't work ether.

    Bevor I load the application on the device I erase all and start from the begining with the sotfdevice and the bootloader.

  • I see. Does it seem like the upgrade is successful from the phone side? Or how far do you get? Can you upload logs from the mobile side (for instance the nRF Connect app) so that we can understand more what is going on? Do you have any logging on the bootloader side? Unlike the more recent bootloaders the SDK 11 bootloader does not come with logging support in the SDK, but if you have added it any logs from there would be useful as well.

    By the way, are you working on a new product? If yes, why do you use such an old SDK version for the bootloader?

  • Yes it seams to be upgraded. There is just an Error massage after the reconnection to the device. I will upload a log from nRF Connect, but I dont have loggin on the bootloader side.

    nRF Connect, 2018-09-12
    DfuTarg (E2:A0:1C:79:44:01)
    V	10:46:45.038	Connecting to E2:A0:1C:79:44:01...
    D	10:46:45.039	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE)
    D	10:46:45.217	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	10:46:45.217	Connected to E2:A0:1C:79:44:01
    D	10:46:45.255	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    V	10:46:45.255	Discovering services...
    D	10:46:45.255	gatt.discoverServices()
    D	10:46:45.286	[Callback] Services discovered with status: 0
    I	10:46:45.287	Services discovered
    V	10:46:45.317	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Device Firmware Update Service (00001530-1212-efde-1523-785feabcd123)
    - DFU Packet [WNR] (00001532-1212-efde-1523-785feabcd123)
    - DFU Control Point [N W] (00001531-1212-efde-1523-785feabcd123)
       Client Characteristic Configuration (0x2902)
    - DFU Version [R] (00001534-1212-efde-1523-785feabcd123)
    D	10:46:45.317	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	10:46:45.321	gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
    V	10:47:32.828	[DFU] DFU service started
    V	10:47:32.829	[DFU] Opening file...
    I	10:47:32.865	[DFU] Firmware file opened successfully
    V	10:47:32.865	[DFU] Connecting to DFU target...
    D	10:47:32.865	[DFU] gatt = device.connectGatt(autoConnect = false)
    I	10:47:32.865	[DFU] Connected to E2:A0:1C:79:44:01
    V	10:47:32.865	[DFU] Discovering services...
    D	10:47:32.865	[DFU] gatt.discoverServices()
    I	10:47:32.879	[DFU] Services discovered
    D	10:47:32.880	[DFU] wait(1000)
    V	10:47:33.916	[DFU] Reading DFU version number...
    D	10:47:33.916	[DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
    I	10:47:33.957	[DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 08-00
    A	10:47:33.957	[DFU] Version number read: 0.8
    D	10:47:33.957	[DFU] wait(1000)
    V	10:47:34.969	[DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
    D	10:47:34.970	[DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
    D	10:47:34.970	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	10:47:35.004	[DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
    V	10:47:35.004	[DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
    A	10:47:35.004	[DFU] Notifications enabled
    D	10:47:35.004	[DFU] wait(1000)
    V	10:47:36.007	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:36.007	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:36.057	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 01-04
    A	10:47:36.057	[DFU] DFU Start sent (Op Code = 1, Upload Mode = 4)
    V	10:47:36.057	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
    D	10:47:36.057	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
    I	10:47:36.057	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 00-00-00-00-00-00-00-00-CC-07-00-00
    A	10:47:36.057	[DFU] Firmware image size sent (0b, 0b, 1996b)
    I	10:47:38.053	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-01-01
    A	10:47:38.053	"Response for: Start DFU
    Value: Success" received
    I	10:47:38.075	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-01-01
    A	10:47:38.075	[DFU] Response received (Op Code = 1 Status = 1)
    A	10:47:38.075	[DFU] Writing Initialize DFU Parameters...
    V	10:47:38.075	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:38.075	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:38.128	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-00
    V	10:47:38.128	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
    D	10:47:38.128	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
    I	10:47:38.128	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): FF-FF-FF-FF-FF-FF-FF-FF-01-00-FE-FF-1D-67
    V	10:47:38.128	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:38.128	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:38.206	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-02-01
    A	10:47:38.206	"Response for: Initialize DFU Parameters
    Value: Success" received
    I	10:47:38.210	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-01
    I	10:47:38.210	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-02-01
    A	10:47:38.210	[DFU] Initialize DFU Parameters completed
    A	10:47:38.210	[DFU] Response received (Op Code = 2, Status = 1)
    V	10:47:38.210	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:38.210	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:38.271	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 08-0A-00
    A	10:47:38.273	[DFU] Packet Receipt Notif Req (Op Code = 8) sent (Value = 10)
    V	10:47:38.273	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:38.273	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:38.336	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 03
    A	10:47:38.336	[DFU] Receive Firmware Image request sent
    A	10:47:38.337	[DFU] Uploading firmware...
    V	10:47:38.337	[DFU] Sending firmware to characteristic 00001532-1212-efde-1523-785feabcd123...
    I	10:47:38.654	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-C8-00-00-00
    A	10:47:38.654	"Packet receipt notification
    Number of bytes received: 200" received
    I	10:47:38.986	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-90-01-00-00
    A	10:47:38.987	"Packet receipt notification
    Number of bytes received: 400" received
    I	10:47:39.374	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-58-02-00-00
    A	10:47:39.374	"Packet receipt notification
    Number of bytes received: 600" received
    I	10:47:39.703	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-20-03-00-00
    A	10:47:39.703	"Packet receipt notification
    Number of bytes received: 800" received
    I	10:47:40.033	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-E8-03-00-00
    A	10:47:40.033	"Packet receipt notification
    Number of bytes received: 1000" received
    I	10:47:40.425	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-B0-04-00-00
    A	10:47:40.425	"Packet receipt notification
    Number of bytes received: 1200" received
    I	10:47:40.783	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-78-05-00-00
    A	10:47:40.783	"Packet receipt notification
    Number of bytes received: 1400" received
    I	10:47:41.113	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-40-06-00-00
    A	10:47:41.113	"Packet receipt notification
    Number of bytes received: 1600" received
    I	10:47:41.444	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 11-08-07-00-00
    A	10:47:41.444	"Packet receipt notification
    Number of bytes received: 1800" received
    I	10:47:41.805	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-03-01
    A	10:47:41.805	"Response for: Receive firmware image
    Value: Success" received
    I	10:47:41.823	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-03-01
    A	10:47:41.823	[DFU] Response received (Op Code = 3, Status = 1)
    A	10:47:41.823	[DFU] Upload completed in 3482 ms
    V	10:47:41.823	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:41.823	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:41.863	Notification received from 00001531-1212-efde-1523-785feabcd123, value: (0x) 10-04-01
    A	10:47:41.863	"Response for: Validation firmware
    Value: Success" received
    I	10:47:41.872	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 04
    I	10:47:41.872	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-04-01
    A	10:47:41.872	[DFU] Validate request sent
    A	10:47:41.872	[DFU] Response received (Op Code = 4, Status = 1)
    V	10:47:41.873	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	10:47:41.873	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	10:47:41.931	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 05
    A	10:47:41.931	[DFU] Activate and Reset request sent
    D	10:47:41.984	[Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
    W	10:47:41.984	Connection terminated by peer (status 19)
    I	10:47:41.984	Disconnected
    I	10:47:42.028	[DFU] Disconnected by the remote device
    D	10:47:42.028	[DFU] gatt.refresh() (hidden)
    D	10:47:42.028	[DFU] gatt.close()
    D	10:47:42.028	[DFU] wait(1400)
    D	10:47:42.028	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	10:47:42.051	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	10:47:43.432	gatt.close()
    D	10:47:43.433	wait(200)
    V	10:47:43.635	Connecting to E2:A0:1C:79:44:01...
    D	10:47:43.635	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE)
    

    I'm working on a excisting product, we want to upgrade it OTA so it's easier for the customer to have it up to date.

  • I'm starting to think that the application isn't in the right place. I use the default IROM and IRAM settings. Do I have to change them to use the application?

Related