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

Buttonless DFU service does not start when NRF_LOG_ENABLED is set 0

Hi all,

I have a very strange problem with the Buttonless DFU service. For my project we have two different builds, one debug and one "release" build. The debug build sets the following SDK config defines to 1, and the release build sets them to 0.

  • NRF_SDH_BLE_LOG_ENABLED
  • NRF_SDH_SOC_LOG_ENABLED
  • NRF_SDH_LOG_ENABLED
  • NRF_LOG_BACKEND_RTT_ENABLED
  • NRF_LOG_ENABLED

When I compile the project and flash the debug build (application + softdevice + bootloader) the application starts up and I can access the DFU service. However when I compile and flash the "release" build the application does not start. If I remove the DFU service the application starts up with both builds, so there's something happening when I disable the logs with the DFU service. Its very hard to debug since everything works the logs are enabled.

I've had some issues before with observers being optimized way since the source code from the libs is not being directly referenced from my code. Could it be something similar going on here? https://devzone.nordicsemi.com/support/224969 (Private ticket)

All help is appreciated, this is a very annoying problem!

Parents
  • Hi,

    Maybe I'm way off but I wonder if it could be caused by an invalid CRC value in your bl settings page which would cause the bootloader to enter DFU mode. Is this page being re-generated each time you compile the app? As you may know, the settings page includes a CRC checksum value of the app image which must match the CRC of the actual app image stored in flash. The bootloader will not "jump" to the application if there's a mismatch. Does your device appear to be stuck in DFU mode? 

  • Here is the log from the bootloader:

    <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.
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <debug> app: Enter nrf_dfu_app_is_valid
    <debug> app: Return true. App was valid
    <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    <debug> app: running irq table set
    <debug> app: After running irq table set

Reply
  • Here is the log from the bootloader:

    <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.
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <debug> app: Enter nrf_dfu_app_is_valid
    <debug> app: Return true. App was valid
    <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    <debug> app: running irq table set
    <debug> app: After running irq table set

Children
No Data
Related