Hello Everyone,
We are using nRF52840 IC for our products which has 1 MB of flash.
Thread Secure DFU Example provided with Nordic SDK supports only Dual Bank DFU. This limits the application size.
Our Application size is increasing and therefore Dual Bank DFU cannot accommodate new application image.
To resolve this issue, we have decided to add an external Flash which can act as Bank1 for storing DFU image.
We have successfully directed incoming DFU packets to external QSPI flash by making changes in nrf_dfu_flash.c file.
Now, once complete image has been transferred to external flash, Hash has to be verified. In my case, hash verification fails, which is expected.
<info> nrf_dfu_validation: Hash verification. start address: 0x71000, size: 0x7803C
<warning> nrf_dfu_validation: Hash verification failed.
<info> nrf_dfu_validation: Expected FW hash:
<info> nrf_dfu_validation: BA 71 8F 68 A9 19 0C EE|.q.h....
<info> nrf_dfu_validation: DC 46 7F 8A D1 20 A5 FF|.F... ..
<info> nrf_dfu_validation: 76 53 F3 C9 02 3B 89 E9|vS...;..
<info> nrf_dfu_validation: E8 1F 35 92 BD 8A 7F 6F|..5....o
<info> nrf_dfu_validation: Actual FW hash:
<info> nrf_dfu_validation: 3F 6E E3 8E 2A D6 14 46|?n..*..F
<info> nrf_dfu_validation: C7 BC 57 29 86 7E 8F AF|..W).~..
<info> nrf_dfu_validation: B4 1A 59 A8 1B C7 01 6A|..Y....j
<info> nrf_dfu_validation
I don't fully understand how this function works -
nrf_crypto_hash_calculate(&hash_context,
&g_nrf_crypto_hash_sha256_info,
(uint8_t*)src_addr,
data_len,
m_fw_hash,
&hash_len);
as it takes in starting address of firmware in flash, it's length and calculates Hash. Does this function reads complete firmware from flash to calculate hash ?
Thanks.