DFU Bootloader uploading smaller App

Hi,

we have a NRF52832 based project / product. We are using a DFU bootloader for application and SD update. The update is done from a master microcontroller using UART.

Our update packages are created using the Nordic Tools and uploaded to the master microcontroller via ftp. All that is working just fine. 

We just have one problem: If we update the application with a smaller file than the one that is installed, the update fails. The bootloader reports "nrf_dfu_validation: Hash verification failed."

It looks like the hash is generated over a larger area of flash than the size of the application itself. When the application that has been installed before is smaller there seems to be a rest of the old application in the flash memory and the hash generation fails.

What can be done to avoid this problem?

Related