Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU CRC check workaround for J-Link debugging

Common situation:

We have flashed dfu bootloader, and firmware uploaded into Flash via DFU. In this situation, DFU settings page contains correct CRC value for existing application. But if we make any changes in code and upload new version with J-Link, bootloader never start application due to wrong CRC checking.

So, my suggestion to add two lines in nrf_dfu_utils.c function nrf_dfu_app_is_valid()

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
if (crc != s_dfu_settings.bank_0.image_crc)
{
// CRC does not match with what is stored.
NRF_LOG_DEBUG("Return false in CRC");
#ifndef NRF_DFU_DEBUG_VERSION
return false;
#endif
}
}
NRF_LOG_DEBUG("Return true. App was valid");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This change will affect only debug version of bootloader and we still have information about CRC in log