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

Related