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

USB Dfu cause hash not match issue.

hi,

I am working on nrf52833 dfu. right now I received an error 

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.

it happened when 96% finished.

my dfu memory settings is :

FLASH (rx) : ORIGIN = 0x74000, LENGTH = 0xA000
RAM (rwx) : ORIGIN = 0x20002ae8, LENGTH = 0x1d518
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
bootloader_settings_page (r) : ORIGIN = 0x0007F000, LENGTH = 0x1000
uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
mbr_params_page (r) : ORIGIN = 0x0007E000, LENGTH = 0x1000

and my application is :

FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0x4D000
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000

Parents Reply Children
  • first your blog is not working for me. let's make clear, this issue only happened on sdk 17, which released weeks ago. we have working uart dfu for nrf52832 which used sdk 14, and a working usb dfu for nrf52840 which used sdk 15. 

    so there is two things, one is a bootloader which I start from an ble bootloader example, and try to make it works for usb. it uses softdevice. it get the hash not match issue at the end of flash. the issue happened when it flashed 96%. after using the '-prn 256' it change to 98%.

    then I followed edvin suggested, to start from a usb bootloader with debug, and make it work for the chip I want to use, which is nrf52833. also I have no idea why you guys do not have the example code for that. then that works, that can flashed all the code, but then the application is not runing, I think I am clear here, it is the application not running, which means the bootloader is runing, I can get the "Inside main" print out. 

    then I check the memory usage by using nrf connect, found there is something wrong, first there is no softdevice detected. the code is there, but it detected as application. second, the softdevice start address is not right, I think right now 0x0 to 0x1000 is used for mbr, and sd start at 0x1000, but based the memory I get after dfu, it start at 0xFF8. I also checked when I flash the mbr, there is a 8 bytes start at 0xFF8, but when I flashed sd, the 8 bytes is not there.

  • from the debug version print, I get "app: Inside main" at the end, which means it should enter the application mode, but the application is not really run, and the code seems stopped.

  • Hi ,

    Hung is currently out of office on vacation but he will be back next week. Thanks for your patience.

  • Hi Weizhen, 
    I'm sorry for late response I was on vacation last week.

    Could you send us the bootloader that you made for the nRF52833 ? Are you using open bootloader or the secure one ? From which project did you modify the bootloader to ? Was it the one for nRF52832 or nRF52840 ? 


    The address 0xFF8 is used to store the start address of the bootloader in the MBR.  This is optional as the start address of the bootloader is also stored in the UICR.

  • pca10100_usb_debug.zippca10100_s140_ble_debug_usb.zip

    I also post my info here. https://devzone.nordicsemi.com/f/nordic-q-a/64101/nrf52833-usb-dfu-bootloader-does-not-go-to-the-application 

    the pca10100_usb_debug is the one I start from pca10100e_usb_debug, this one, I can flash, and the application and bootloader can be writed into memory, but the application is not run. then the pca10100_s140_ble_debug_usb is the one I start from pca10100_s140_ble_debug, this one the nrfutil do not give any problems, but after flash, the application is not on memory.

Related