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

Hash of the received firmware image does not match the hash in the init packet

Hello,

I have implemented DFU using I2C by modifying the original nrf_dfu_serial_uart.c file. Also, on the master side I have added an I2C adapter class.

The communication seems to be fine between the master and slave. The firmware upgrade process is working as expected until the last block of the firmware image is received.

When the last block is received, the Master throws an error message saying: 

raise NordicSemiException('Extended Error 0x{:02X}: {}'.format(resp[3], data))
pc_ble_driver_py.exceptions.NordicSemiException: Extended Error 0x0C: The hash of the received firmware image does not match the hash in the init packet.

I expected it to work without any problems as I have not modified the core implementation. Only the transport layers have been changed.

Can you let me know what might be going wrong?

Logs: uart_log.txt8255.dfu_i2c.log

I have attached the two log files from UART and I2C for reference. Please see the logs, the checksum received for all the blocks are identical among I2C and SLIP(UART) implementations.

SDK - 15.3

SoftDevice: s132 v6.1.1

Example: Serial DFU Debug

Application: ble_uart_peripheral

Hardware: nRF52 DK

Best regards,

Navin

dfu_uart.log

Parents
  • I have not checked in detail, but from the log, it looks like the transferred data is identical. If that is the case, then it should work, as you write.

    There is one typical issue when modifying the bootloader, which we should rule out. If you are using SES, the bootloader project in the SDK is misconfigured, and will not generate a build error if the image is up to two pages (8 kB) too large, overwriting MBR params and bootloader settings. In this case, you would see undefined behavior. Can you try to move the bootloader start address down with two pages and see if this changes anything? This is a long shot, but it is worth ruling out.

Reply
  • I have not checked in detail, but from the log, it looks like the transferred data is identical. If that is the case, then it should work, as you write.

    There is one typical issue when modifying the bootloader, which we should rule out. If you are using SES, the bootloader project in the SDK is misconfigured, and will not generate a build error if the image is up to two pages (8 kB) too large, overwriting MBR params and bootloader settings. In this case, you would see undefined behavior. Can you try to move the bootloader start address down with two pages and see if this changes anything? This is a long shot, but it is worth ruling out.

Children
Related