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

DFU bootloader for ble and usb failes with code 3

<info> app: Inside main
<debug> app: In nrf_bootloader_init
<debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<warning> nrf_dfu_settings: Resetting bootloader settings since neither the settings page nor the backup are valid (CRC error).
<warning> nrf_dfu_settings: Settings write aborted since it tries writing to forbidden settings.
<error> nrf_dfu_settings: nrf_dfu_settings_write_and_backup() failed with error: F
<error> app: Received an error: 0x00000003!

I have merged the ble_dfu and the usb_dfu, ble_dfu was my starting point. The above is my debug output. Please help

Below is the linker settings

linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0xf0000;FLASH_SIZE=0xf000;RAM_START=0x20005978;RAM_SIZE=0x3a688"
linker_section_placements_segments="FLASH RX 0x0 0x100000;RAM1 RWX 0x20000000 0x40000;mbr_params_page RX 0x000FE000 0x1000;bootloader_settings_page RX 0x000FF000 0x1000;uicr_bootloader_start_address RX 0x10001014 0x4;uicr_mbr_params_page RX 0x10001018 0x4"

Regards Rit

Parents
  • Hi

    The warning from your log seems to come from the following function in nrf_dfu_settings..: 

    if (NRF_DFU_IN_APP && !settings_forbidden_parts_equal_to_backup((uint8_t *)&s_dfu_settings))
        {
            NRF_LOG_WARNING("Settings write aborted since it tries writing to forbidden settings.");
            return NRF_ERROR_FORBIDDEN;
        }

    NRF_DFU_IN_APP is documented as the following:

    // <q> NRF_DFU_IN_APP  - Specifies that this code is in the app, not the bootloader, so some settings are off-limits.
     
    
    // <i> Enable this to disable writing to areas of the settings that are protected
    // <i> by the bootlader. If this is not enabled in the app, certain settings write
    // <i> operations will cause HardFaults or will be ignored. Enabling this option
    // <i> also causes postvalidation to be disabled since this is meant to be done
    // <i> in the bootloader. NRF_BL_DFU_ALLOW_UPDATE_FROM_APP must be enabled in the bootloader.
    
    #ifndef NRF_DFU_IN_APP
    #define NRF_DFU_IN_APP 0
    #endif

    What is NRF_DFU_IN_APP set to in your bootloader project?

    Best regards,

    Simon

Reply
  • Hi

    The warning from your log seems to come from the following function in nrf_dfu_settings..: 

    if (NRF_DFU_IN_APP && !settings_forbidden_parts_equal_to_backup((uint8_t *)&s_dfu_settings))
        {
            NRF_LOG_WARNING("Settings write aborted since it tries writing to forbidden settings.");
            return NRF_ERROR_FORBIDDEN;
        }

    NRF_DFU_IN_APP is documented as the following:

    // <q> NRF_DFU_IN_APP  - Specifies that this code is in the app, not the bootloader, so some settings are off-limits.
     
    
    // <i> Enable this to disable writing to areas of the settings that are protected
    // <i> by the bootlader. If this is not enabled in the app, certain settings write
    // <i> operations will cause HardFaults or will be ignored. Enabling this option
    // <i> also causes postvalidation to be disabled since this is meant to be done
    // <i> in the bootloader. NRF_BL_DFU_ALLOW_UPDATE_FROM_APP must be enabled in the bootloader.
    
    #ifndef NRF_DFU_IN_APP
    #define NRF_DFU_IN_APP 0
    #endif

    What is NRF_DFU_IN_APP set to in your bootloader project?

    Best regards,

    Simon

Children
No Data
Related