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

Segger Embedded Studio loops in softdevice

Hi,

My project cannot be debugged using Segger Embedded Studio. The debugger doesn't halt at the application main and instead keeps running. Hitting a pause shows the debugger at 'SEV' instruction at address 0x0001304A (which seems to be from softdevice). I am using the softdevice s132v5.1 and the application uses freertos similar to the HRS example in SDK.

Any inputs on the reason for debugger behaving so?

Thanks.

Parents Reply Children
  • You can skip the crc in nrf_dfu_utils.c -> nrf_dfu_app_is_valid() by doing something like this:

    bool nrf_dfu_app_is_valid(void)
    {
        NRF_LOG_DEBUG("Enter nrf_dfu_app_is_valid");
        if (s_dfu_settings.bank_0.bank_code != NRF_DFU_BANK_VALID_APP)
        {
           // Bank 0 has no valid app. Nothing to boot
           NRF_LOG_DEBUG("Return false in valid app check");
           return false;
        }
    
    #ifndef SKIP_INTEGRITY_CHECK
        // If CRC == 0, the CRC check is skipped.
        if (s_dfu_settings.bank_0.image_crc != 0)
        {
            uint32_t crc = crc32_compute((uint8_t*) CODE_REGION_1_START,
                                         s_dfu_settings.bank_0.image_size,
                                         NULL);
    
            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;
            }
        }
    #endif //SKIP_INTEGRITY_CHECK
    
        NRF_LOG_DEBUG("Return true. App was valid");
        return true;
    }

     

    Note that compile time flags to skip CRC check were added in SDK 15. You could implement the same in SDK 14  (flags to skip CRC in SDK 15).  

  • Thank you. That's very helpful. I will take a look at this new config option and its implementation.

Related