Full modem firmware update "nrf_modem_full_dfu_digest" function not working

Hello,

I have implemented a full dfu based on the http flash sample and the full modem dfu api.

After writing the update to flash, i want to verify the written areas and compare the hashes to the hashes in "firmware.update.image.digest.txt".

This can be achieved by using

nrf_modem_full_dfu_digest(uint32_t addr, uint32_t size, struct nrf_modem_full_dfu_digest *digest_buffer);
,

However, this function returns an error, even after first uploading the bootloader.

Also, the modem starts correctly after rebooting, meaning the firmware was updated correctly.

I still want to be able to verify this though, how can i do this?

Parents
  • Hi Berendvisser,

    I am not sure how you use this function in your codes. I find a usage of this function inside Mcumgr based full modem update API. 

    Could you refer to the nRF9160: Full modem firmware update using SMP Server — nRF Connect SDK 2.2.0 documentation (nordicsemi.com) to learn how it use this function?

    Best regards,

    Charlie

  • Hi charlie,

    Thank you for your reply

    After uploading the bootloader segments and fw segments I apply with :

    LOG_DBG("Wrote all segments!!");
                nrf_modem_full_dfu_apply();
                struct nrf_modem_full_dfu_digest digest_2;
                struct nrf_modem_full_dfu_digest digest_3;
                struct nrf_modem_full_dfu_digest digest_4;
                
                err = nrf_modem_full_dfu_digest(this->segments._Segments__Segment[2]._Segment_target_addr, this->segments._Segments__Segment[2]._Segment_len, &digest_2);
                LOG_DBG("digest err:%d", err);
                LOG_HEXDUMP_DBG(digest_2.data, 32, "digest Segment 2");
    
                nrf_modem_full_dfu_digest(this->segments._Segments__Segment[3]._Segment_target_addr, this->segments._Segments__Segment[3]._Segment_len, &digest_3);
                LOG_HEXDUMP_DBG(digest_3.data, 32, "Segment 3");
    
                nrf_modem_full_dfu_digest(this->segments._Segments__Segment[4]._Segment_target_addr, this->segments._Segments__Segment[4]._Segment_len, &digest_4);
                LOG_HEXDUMP_DBG(digest_4.data, 32, "Segment 4");
    

    Now the values for the digests are not properly set and the function returns err: -1

    I have looked at the sample you sent me, however, i can not find a reason why my code wouldn't work

    Any other idea's why this is happening?

    edit:

    So i did some more testing, i found out that the errno i get back is actually 8

    so according to the documentation this means "NRF_ENOEXEC When RPC command failed."

Reply
  • Hi charlie,

    Thank you for your reply

    After uploading the bootloader segments and fw segments I apply with :

    LOG_DBG("Wrote all segments!!");
                nrf_modem_full_dfu_apply();
                struct nrf_modem_full_dfu_digest digest_2;
                struct nrf_modem_full_dfu_digest digest_3;
                struct nrf_modem_full_dfu_digest digest_4;
                
                err = nrf_modem_full_dfu_digest(this->segments._Segments__Segment[2]._Segment_target_addr, this->segments._Segments__Segment[2]._Segment_len, &digest_2);
                LOG_DBG("digest err:%d", err);
                LOG_HEXDUMP_DBG(digest_2.data, 32, "digest Segment 2");
    
                nrf_modem_full_dfu_digest(this->segments._Segments__Segment[3]._Segment_target_addr, this->segments._Segments__Segment[3]._Segment_len, &digest_3);
                LOG_HEXDUMP_DBG(digest_3.data, 32, "Segment 3");
    
                nrf_modem_full_dfu_digest(this->segments._Segments__Segment[4]._Segment_target_addr, this->segments._Segments__Segment[4]._Segment_len, &digest_4);
                LOG_HEXDUMP_DBG(digest_4.data, 32, "Segment 4");
    

    Now the values for the digests are not properly set and the function returns err: -1

    I have looked at the sample you sent me, however, i can not find a reason why my code wouldn't work

    Any other idea's why this is happening?

    edit:

    So i did some more testing, i found out that the errno i get back is actually 8

    so according to the documentation this means "NRF_ENOEXEC When RPC command failed."

Children
No Data
Related