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

DFU SDK15 CRC problem.

Hi!

nRF52832, SDK15, S132.

I try to use DFU. I already implemented same DFU on a SDK13. All works correct. 

When flash SD132 and merged firmware with bootloader_setting.hex, always DFU targ started in a air.

 0> <info> app: Inside main
 0> <debug> app: In nrf_bootloader_init
 0> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
 0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
 0> <debug> app: Enter nrf_bootloader_fw_activate
 0> <info> app: No firmware to activate.
 0> <debug> app: Enter nrf_dfu_app_is_valid
 0> <debug> app: Return false in CRC
 0> <debug> app: DFU mode because app is not valid.
 0> <info> nrf_bootloader_wdt: WDT is not enabled
 0> <debug> app: in weak nrf_dfu_init_user
 0> <info> app_timer: RTC: initialized.
 0> <info> app: Entering DFU mode.
 0> <debug> app: Initializing transports (found: 1)
 0> <debug> nrf_dfu_ble: Initializing BLE DFU transport
 0> <debug> nrf_dfu_ble: Setting up vector table: 0x00072000
 0> <debug> nrf_dfu_ble: Enabling SoftDevice.
 0> <debug> nrf_dfu_ble: Configuring BLE stack.
 0> <debug> nrf_dfu_ble: Enabling the BLE stack.
 0> <debug> nrf_dfu_ble: No advertising name found
 0> <debug> nrf_dfu_ble: Using default advertising name
 0> <debug> nrf_dfu_ble: Advertising...
 0> <debug> nrf_dfu_ble: BLE DFU transport initialized.
 0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
 0> <debug> app: Enter main loop

Therefore, problem in a CRC that DFU can't calculate CRC of the app.

        if (crc != s_dfu_settings.bank_0.image_crc)
        {
            // CRC does not match with what is stored.
            NRF_LOG_DEBUG("Return false in CRC");
            return  false;
        }

If I changed to return true; , all work fine.

One more time, I use same merge code for get bootloader_setting.hex in the SDK13 and it wors fine.

I use example from

https://devzone.nordicsemi.com/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader

Should make any changes for calculate CRC in the SDK15?

Parents Reply
  • seems, work. But I need check with real DFU update. I'll write later.

    Einar, one more question-

    I need into bootloader insert a crypto library. For this reason I expand size of bootloader from 0x72000 to 0x6D000. All works. 

    Could you explain me chain of work. After reset, starts SD, than transfer management to bootloader? But how SD known wich address of bootloader starts? 0x72000 or 0x6D000 or another?

Children
Related