nRF52832 DFU downgrade fails

Hello, 

I am using nRF52832, nRF5 SDK, s132, and DFU-OTA with private keys and secure bootloader
I am trying to enable the DFU Downgrade by disabling the define NRF_DFU_APP_DOWNGRADE_PREVENTION (set to 0) in secure_bootloader . 
But I notice a strange behaviour in which I don't know what is going wrong. 

Let's say, I have 3 versions of my application: 1.1.6, 1.1.7, 1.1.8 
1.1.6 is in production, and has enabled the downgrade prevention. 
In the next version, 1.1.7, I want to add the ability of downgrade. So, I create two versions for testing 1.1.7 and 1.1.8 with downgrade ability. 
 
Case 1:
From nRF Connect, I write on board the version 1.1.8 
I perform DFU from mobile nRF Connect to version 1.1.7 and it is successful. 
I perform DFU to version 1.1.6 and it is successful. 
I can do DFU from 1.1.8 to 1.1.6 also successfully. 

Case 2:
From nRF Connect., I erase and write the version 1.1.6 (which is in production). 
I perform successfully DFU to 1.1.7 (normally since it is an upgrade)
However, from 1.1.7 back to 1.1.6 it disconnects and gives FW failure code 5. 

Finally, I do all the above using the Distribution packet zip which contains application and bootloader and softdevice. So, my assumption was that since I do DFU with the bootloader it would work, but it doesn't. 
Do you know waht am I doing wrong here?

Best regards, 
Dimitra

Parents
  • Hi!

    it disconnects and gives FW failure code 5. 

    Where do you see this code 5? Do you have any logs from the bootloader for this?

  • I see it at the logs of nRF Connect app on my mobile phone. 


  • Hi!

    Could you share this log?

    Also, if you use the _debug-suffixed bootloader project, then logging is enabled in that project, so we can see the logs from the bootloader.

  • Could you share this log?

    The log from my phone - nRF Cnnect app:

    nRF Connect, 2024-07-01
    B-cd1132 (CD:BA:11:32:E5:60)
    V	14:44:37.945	Connecting to CD:BA:11:32:E5:60...
    D	14:44:37.945	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:44:38.047	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	14:44:38.070	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	14:44:38.070	Connected to CD:BA:11:32:E5:60
    D	14:44:38.072	wait(1600ms)
    I	14:44:38.072	MTU changed to: 247
    D	14:44:38.086	wait(1600ms)
    I	14:44:38.573	Service changed, invalidating services
    V	14:44:38.576	Discovering services...
    D	14:44:38.576	gatt.discoverServices()
    D	14:44:38.992	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDING (11)
    D	14:44:39.027	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDED (12)
    I	14:44:39.027	Device bonded
    I	14:44:39.430	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    V	14:44:39.673	Discovering services...
    D	14:44:39.673	gatt.discoverServices()
    V	14:44:39.691	Discovering services...
    D	14:44:39.691	gatt.discoverServices()
    D	14:44:39.868	[Callback] Services discovered with status: 0
    I	14:44:39.868	Services discovered
    V	14:44:39.883	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Secure DFU Service (0xFE59)
    - Buttonless DFU [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    Device Information (0x180A)
    - Manufacturer Name String [R] (0x2A29)
    - Hardware Revision String [R] (0x2A27)
    - Firmware Revision String [R] (0x2A26)
    Unknown Service (a2661000-72a5-11eb-9439-0242ac130002)
    - Unknown Characteristic [I R] (a2661007-72a5-11eb-9439-0242ac130002)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [I R] (a2661001-72a5-11eb-9439-0242ac130002)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N W] (a2661004-72a5-11eb-9439-0242ac130002)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [I] (a2661005-72a5-11eb-9439-0242ac130002)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [W] (a2661008-72a5-11eb-9439-0242ac130002)
    - Unknown Characteristic [W] (a2661002-72a5-11eb-9439-0242ac130002)
    - Unknown Characteristic [R] (a2661003-72a5-11eb-9439-0242ac130002)
    - Unknown Characteristic [R] (a2661006-72a5-11eb-9439-0242ac130002)
    - Unknown Characteristic [W] (a2661009-72a5-11eb-9439-0242ac130002)
    - Unknown Characteristic [R W] (a2662000-72a5-11eb-9439-0242ac130002)
    D	14:44:39.883	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	14:44:39.885	gatt.setCharacteristicNotification(a2661007-72a5-11eb-9439-0242ac130002, true)
    D	14:44:39.887	gatt.setCharacteristicNotification(a2661001-72a5-11eb-9439-0242ac130002, true)
    D	14:44:39.888	gatt.setCharacteristicNotification(a2661004-72a5-11eb-9439-0242ac130002, true)
    D	14:44:39.895	gatt.setCharacteristicNotification(a2661005-72a5-11eb-9439-0242ac130002, true)
    I	14:44:39.981	Connection parameters updated (interval: 45.0ms, latency: 0, timeout: 5000ms)
    I	14:44:43.447	Connection parameters updated (interval: 11.25ms, latency: 0, timeout: 10000ms)
    V	14:44:43.918	Reading characteristic 00002a26-0000-1000-8000-00805f9b34fb
    D	14:44:43.918	gatt.readCharacteristic(00002a26-0000-1000-8000-00805f9b34fb)
    I	14:44:43.940	Read Response received from 00002a26-0000-1000-8000-00805f9b34fb, value: (0x) 31-2E-31-2E-38, "1.1.8"
    A	14:44:43.940	"1.1.8" received
    V	14:44:58.179	Writing request to characteristic a2661004-72a5-11eb-9439-0242ac130002
    D	14:44:58.179	gatt.writeCharacteristic(a2661004-72a5-11eb-9439-0242ac130002, value=0x01)
    I	14:44:58.209	Data written to a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 01
    A	14:44:58.209	"(0x) 01" sent
    V	14:44:59.491	Enabling notifications for a2661004-72a5-11eb-9439-0242ac130002
    D	14:44:59.491	gatt.setCharacteristicNotification(a2661004-72a5-11eb-9439-0242ac130002, true)
    D	14:44:59.492	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
    I	14:44:59.522	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
    A	14:44:59.522	"Notifications enabled" sent
    V	14:44:59.524	Notifications enabled for a2661004-72a5-11eb-9439-0242ac130002
    I	14:44:59.583	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-00-00-00-00
    A	14:44:59.583	"(0x) 00-00-00-00-00-00" received
    I	14:44:59.703	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-EC-2C-00-00
    A	14:44:59.703	"(0x) 00-00-EC-2C-00-00" received
    I	14:44:59.826	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-F4-2C-00-00
    A	14:44:59.826	"(0x) 00-00-F4-2C-00-00" received
    I	14:44:59.939	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-00-2D-00-00
    A	14:44:59.939	"(0x) 00-00-00-2D-00-00" received
    I	14:45:00.063	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-0C-2D-00-00
    A	14:45:00.063	"(0x) 00-00-0C-2D-00-00" received
    I	14:45:00.186	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-EC-2C-00-00
    A	14:45:00.186	"(0x) 00-00-EC-2C-00-00" received
    I	14:45:00.311	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-04-2D-00-00
    A	14:45:00.311	"(0x) 00-00-04-2D-00-00" received
    I	14:45:00.434	Notification received from a2661004-72a5-11eb-9439-0242ac130002, value: (0x) 00-00-1C-2D-00-00
    A	14:45:00.434	"(0x) 00-00-1C-2D-00-00" received
    V	14:45:00.494	Disabling notifications for a2661004-72a5-11eb-9439-0242ac130002
    D	14:45:00.494	gatt.setCharacteristicNotification(a2661004-72a5-11eb-9439-0242ac130002, false)
    D	14:45:00.495	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0000)
    I	14:45:00.513	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 00-00
    A	14:45:00.513	"Notifications and indications disabled" sent
    V	14:45:00.515	Notifications and indications disabled for a2661004-72a5-11eb-9439-0242ac130002
    V	14:45:06.560	[DFU] DFU service started
    V	14:45:06.560	[DFU] Opening file...
    I	14:45:06.610	[DFU] Firmware file opened successfully
    V	14:45:06.610	[DFU] Connecting to DFU target...
    D	14:45:06.610	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	14:45:06.632	[DFU] Connected to CD:BA:11:32:E5:60
    D	14:45:06.632	[DFU] wait(1600)
    V	14:45:08.233	[DFU] Discovering services...
    D	14:45:08.233	[DFU] gatt.discoverServices()
    I	14:45:08.238	[DFU] Services discovered
    W	14:45:08.238	[DFU] Sending system components
    V	14:45:08.241	[DFU] Reading Service Changed CCCD value...
    D	14:45:08.241	[DFU] gatt.readDescriptor(00002902-0000-1000-8000-00805f9b34fb)
    I	14:45:08.264	[DFU] Read Response received from descr.00002a05-0000-1000-8000-00805f9b34fb, value (0x): 02-00
    A	14:45:08.264	[DFU] Service Changed indications enabled
    W	14:45:08.276	[DFU] Application with buttonless update found
    V	14:45:08.276	[DFU] Jumping to the DFU Bootloader...
    V	14:45:08.276	[DFU] Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	14:45:08.276	[DFU] gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	14:45:08.276	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x02-00)
    I	14:45:08.287	[DFU] Data written to descr.8ec90003-f315-4f60-9fb8-838830daea50
    V	14:45:08.287	[DFU] Notifications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    A	14:45:08.287	[DFU] Indications enabled
    V	14:45:08.287	[DFU] Writing to characteristic 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 01
    D	14:45:08.287	[DFU] gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50)
    A	14:45:08.308	[DFU] Enter bootloader sent (Op Code = 1)
    I	14:45:08.314	[DFU] Notification received from 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 20-01-01
    A	14:45:08.314	[DFU] Response received (Op Code = 1, Status = 1)
    V	14:45:08.314	[DFU] Disconnecting...
    D	14:45:08.315	[DFU] gatt.disconnect()
    I	14:45:08.329	[DFU] Disconnected
    D	14:45:08.329	[DFU] gatt.disconnect()
    D	14:45:08.329	[DFU] gatt.close()
    V	14:45:08.329	[DFU] Scanning for the DFU Bootloader... (timeout 5000 ms)
    I	14:45:09.055	[DFU] DFU Bootloader found with address CD:BA:11:32:E5:61
    V	14:45:09.066	[DFU] DFU service started
    I	14:45:09.066	[DFU] Firmware file opened successfully
    V	14:45:09.066	[DFU] Connecting to DFU target...
    D	14:45:09.095	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	14:45:09.689	[DFU] Connected to CD:BA:11:32:E5:61
    V	14:45:09.691	[DFU] Discovering services...
    D	14:45:09.691	[DFU] gatt.discoverServices()
    D	14:45:09.835	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	14:45:10.435	[DFU] Services discovered
    W	14:45:10.435	[DFU] Sending system components
    V	14:45:10.454	[DFU] Requesting new MTU...
    D	14:45:10.454	[DFU] gatt.requestMtu(517)
    I	14:45:10.520	[DFU] MTU changed to: 247
    V	14:45:10.520	[DFU] Enabling notifications for 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:45:10.520	[DFU] gatt.setCharacteristicNotification(8ec90001-f315-4f60-9fb8-838830daea50, true)
    D	14:45:10.520	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	14:45:10.520	[DFU] Data written to descr.8ec90001-f315-4f60-9fb8-838830daea50
    V	14:45:10.520	[DFU] Notifications enabled for 8ec90001-f315-4f60-9fb8-838830daea50
    A	14:45:10.520	[DFU] Notifications enabled
    V	14:45:10.520	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 06-01
    D	14:45:10.520	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.520	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.520	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-06-01-00-02-00-00-00-00-00-00-00-00-00-00
    A	14:45:10.520	[DFU] Command object info received (Max size = 512, Offset = 0, CRC = 00000000)
    V	14:45:10.520	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 02-00-00
    D	14:45:10.520	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.520	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-02-01
    I	14:45:10.520	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    A	14:45:10.520	[DFU] Packet Receipt Notif disabled (Op Code = 2, Value = 0)
    V	14:45:10.520	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-01-95-00-00-00
    D	14:45:10.520	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.599	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.611	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:45:10.611	[DFU] Command object created
    V	14:45:10.611	[DFU] Writing to characteristic 8ec90002-f315-4f60-9fb8-838830daea50 value (0x): 12-92-01-0A-4C-08-01-12-48-08-02-10-34-1A-02-81-02-20-03-28-EC-92-09-30-98-F8-02-38-00-42-24-08-03-12-20-71-61-5E-B8-EA-DF-79-DA-DA-BC-86-C2-1E-6F-8E-CC-B5-E4-1D-80-83-AE-31-09-03-B2-97-0C-21-F7-DF-60-48-00-52-04-08-01-12-00-52-04-08-01-12-00-10-00-1A-40-F2-1E-4F-BB-6E-07-0A-4E-62-05-3C-14-61-2B-F4-E4-F2-68-99-F0-62-66-61-FD-E2-95-05-6E-0D-DD-CE-CD-BC-94-58-5D-56-62-33-BB-D1-34-F1-66-E6-6C-70-B1-3B-31-D6-19-8E-26-EB-17-57-8B-36-3E-36-90-DE-25
    D	14:45:10.611	[DFU] gatt.writeCharacteristic(8ec90002-f315-4f60-9fb8-838830daea50)
    I	14:45:10.611	[DFU] Data written to 8ec90002-f315-4f60-9fb8-838830daea50
    A	14:45:10.611	[DFU] Command object sent (CRC = 8D8BD2D8)
    V	14:45:10.611	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    D	14:45:10.611	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.658	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.674	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-95-00-00-00-D8-D2-8B-8D
    A	14:45:10.674	[DFU] Checksum received (Offset = 149, CRC = 8D8BD2D8)
    V	14:45:10.675	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    D	14:45:10.675	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.706	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.840	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-0B-05
    W	14:45:10.840	[DFU] Invalid system components. Trying to send application
    V	14:45:10.840	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 06-01
    D	14:45:10.840	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.868	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.869	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-06-01-00-02-00-00-00-00-00-00-00-00-00-00
    A	14:45:10.870	[DFU] Command object info received (Max size = 512, Offset = 0, CRC = 00000000)
    V	14:45:10.870	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 02-00-00
    D	14:45:10.870	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.898	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.899	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-02-01
    A	14:45:10.899	[DFU] Packet Receipt Notif disabled (Op Code = 2, Value = 0)
    V	14:45:10.900	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-01-8E-00-00-00
    D	14:45:10.900	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.928	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.945	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:45:10.948	[DFU] Command object created
    V	14:45:10.948	[DFU] Writing to characteristic 8ec90002-f315-4f60-9fb8-838830daea50 value (0x): 12-8B-01-0A-45-08-01-12-41-08-FB-4E-10-34-1A-02-81-02-20-00-28-00-30-00-38-B0-FF-04-42-24-08-03-12-20-46-D2-BB-6F-7F-12-D8-3A-8F-88-B3-5E-61-2C-2B-8D-8D-13-1C-09-C5-D7-D6-1C-60-57-90-4E-64-61-DA-91-48-00-52-04-08-01-12-00-10-00-1A-40-75-66-B7-9A-C9-D5-36-77-4D-86-7E-D8-78-B7-D9-B2-4E-87-B2-64-8D-2D-FB-6F-9C-76-3B-52-61-02-9D-00-32-FA-AF-0C-D6-02-B4-78-A2-BA-19-B7-18-39-D7-55-34-7D-31-62-B4-54-92-9B-1F-25-35-67-43-F6-49-0D
    D	14:45:10.948	[DFU] gatt.writeCharacteristic(8ec90002-f315-4f60-9fb8-838830daea50)
    I	14:45:10.953	[DFU] Data written to 8ec90002-f315-4f60-9fb8-838830daea50
    A	14:45:10.953	[DFU] Command object sent (CRC = FC592C10)
    V	14:45:10.953	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    D	14:45:10.953	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:10.988	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:10.990	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-8E-00-00-00-10-2C-59-FC
    A	14:45:10.990	[DFU] Checksum received (Offset = 142, CRC = FC592C10)
    V	14:45:10.990	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    D	14:45:10.990	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:45:11.019	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50
    I	14:45:11.154	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-0B-05
    E	14:45:11.155	[DFU] Remote DFU error: EXTENDED ERROR
    E	14:45:11.155	[DFU] Details: FW version failure (Code = 5)
    V	14:45:11.155	[DFU] Disconnecting...
    D	14:45:11.173	[DFU] gatt.disconnect()
    I	14:45:11.173	[DFU] Disconnected
    D	14:45:11.173	[DFU] gatt.refresh() (hidden)
    D	14:45:11.173	[DFU] gatt.disconnect()
    D	14:45:11.173	[DFU] gatt.close()
    D	14:45:11.173	[DFU] wait(600)
    D	14:45:18.347	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
    E	14:45:18.347	Error 8 (0x8): GATT CONN TIMEOUT
    I	14:45:18.347	Disconnected
    D	14:45:18.425	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    

    Also, if you use the _debug-suffixed bootloader project, then logging is enabled in that project, so we can see the logs from the bootloader.

    I used to do DFU with a zip that contains the secure bootloader hex file, the softdevice and the application. 
    I changed it now and included the _debug bootloader (after setting 0 downgrade prevention) and run the RTT Viewer to see logs, but only the normal ones appeared , which originate from the application. 

    /**@brief Function for handling all dfu related events.
     *
     * @param[in] event DFU events
     */
    
    static void ble_dfu_evt_handler(ble_dfu_buttonless_evt_type_t event)
    {
      switch (event)
      {
        case BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE:
          NRF_LOG_INFO("Device is preparing to enter bootloader mode.");
        break;
    
        case BLE_DFU_EVT_BOOTLOADER_ENTER:
          NRF_LOG_INFO("Device will enter bootloader mode.");
        break;
    
        case BLE_DFU_EVT_BOOTLOADER_ENTER_FAILED:
          NRF_LOG_ERROR("Request to enter bootloader mode failed asynchroneously.");
          APP_ERROR_CHECK(false);
          
        break;
    
        case BLE_DFU_EVT_RESPONSE_SEND_ERROR:
          NRF_LOG_ERROR("Request to send a response to client failed.");
          APP_ERROR_CHECK(false);
          
        break;
    
        default:
          NRF_LOG_ERROR("Unknown event from ble_dfu_buttonless.");
        break;
      }
    }
    
    /**@brief Function for handling power management events. We use it just to enter DFU.
     *
     * @param[in] event power management event
     */
    
    static bool app_shutdown_handler(nrf_pwr_mgmt_evt_t event)
    {
      switch (event)
      {
        case NRF_PWR_MGMT_EVT_PREPARE_DFU:
          NRF_LOG_INFO("Power management wants to reset to DFU mode.");
        break;
    
        default:
          return true;
      }
    
      NRF_LOG_INFO("Power management allowed to reset to DFU mode.");
      return true;
    }


    From this section of my code from the application, these log messages appeared: 

    and then the logs stopped, so I don't see any logs from the bootloader. Is there another way to do it?

  • Hi,

    Are you also increasing the bootloader version? Note that turning off downgrade prevention only applies to the application version.

  • No I do not increase any version on the booloader. In fact, I didn't change anything in the config file, other than the downgade prevention. Here is the config file from the secure_bootloader/pca10040_s132_ble_debug example, which I changed this configuration only, and added on my zip file for DFU (along with softdevice and application). 

    70348.sdk_config.h

  • Please make sure to bump the version number of the bootloader in your DFU package. Otherwise, the bootloader update will be rejected with the "FW version failure" error.

Reply Children
No Data
Related