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

Device not connecting in boot loader mode

Hello ,

I am using nRF52832 controller in peripheral role. I have integrated Secure boot loader code. I am facing issue of mobile device is not getting connected to the DFU service in boot-loader.

When device is in Application  it is connected and operation is fine,but after entering DFU by triggering command from DFU service to enter boot-loader mobile does not get connected but device remains in boot-loader mode. SDK used is 15.2.0 . Secure bootloader example code from DFU section is used.

I am using Custom board with ready module integrated  of nrf52832 from RAYTAC (MDBT42Q-512KV2). Board has Power supply regulator on board. Input supply voltage 10 v to 30 v with 500 mA current rating. When i use supply input of 5 volt it works perfectly. But for 12 volts it gives me above error behavior. This issue is been faced after flashing secure boot-loader code. Without boot-loader code simple application works totally fine.

Thanks in advance.

  • Are you sure this is related to the input voltage at all? Does everything work when you use 5V? Can you successfully update the application?

    Don't you agree if the input voltage to the nRF doesn't change, and nothing else, as seen from the nRF changes, then the behavior shouldn't change?

    Are you sure that the DFU part is working properly when you use the 5V in?

  • Are you sure that the DFU part is working properly when you use the 5V in?

    Yes i have tested it for multiple times and Dfu process done successfully with valid FW updates. 

    Don't you agree if the input voltage to the nRF doesn't change, and nothing else, as seen from the nRF changes, then the behavior shouldn't change?

    Yes i do agree to this statement but i am facing issue.. and no clues for why this is so happening.

    Can you successfully update the application?

    YES I can. 

    Can it be related to RAM and FLASH memory managements. My application code is modified code of Multiperipheral example . Which has following Section_placement MACRO settings:

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x80000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x10000

    FLASH_START=0x26000

    FLASH_SIZE=0x5a000

    RAM_START=0x200053F0

    RAM_SIZE=0xAC20

    Where for secure_bootloader ble example code has following Section_placement MACRO settings:

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x80000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x10000

    FLASH_START=0x72000

    FLASH_SIZE=0x8000

    RAM_START=0x200057b8

    RAM_SIZE=0xa848

    Is there anything wrong in this ?

  • Are you sure this is your settings?

    In the Bootloader examples for the nRF52832 examples from the SDK uses the following settings for the Flash:

    FLAS_START = 0x78000

    FLASH_SIZE = 0x6000

    Using these settings the bootloader will use the flash area 0x78000 to 0x7E000. The remaining flash is for the bootloader settings. 

    In theory, it is possible with the settings you have used as well, but it has to be set several places in the project, so it is easy to do mistakes. 

    Try to revert the bootloader settings settings to 0x78000 and 0x6000, and see if that changes anything. But then again, this should not be dependent on the voltage into your external voltage regulator.

    What is it that you are trying to update? The app + bl? Have you tried to debug the bootloader to figure out why the application is not starting? To do so, you should use the pca10040_ble_debug and enable logging and see if you get any sensible output.

    Are there any other changes you have done to the bootloader project that I should know of?

    Best regards,

    Edvin

  • Try to revert the bootloader settings settings to 0x78000 and 0x6000, and see if that changes anything. But then again, this should not be dependent on the voltage into your external voltage regulator.

    Yes i do tried it also by changing flash settings . But no luck. I have erased whole flash and then only boot loader is flashed in memory. Same issue persists that device starts advertising but no connection is possible. Debug strings in nRF connect shows Error 22 (0x16) GATT CONN TERMINATE LOCAL HOST.

    What is it that you are trying to update? The app + bl?

    I am trying to update only application. 

  • Have you tried to debug the bootloader to figure out why the application is not starting? To do so, you should use the pca10040_ble_debug and enable logging and see if you get any sensible output.

    I tried for ble-debug example code and got following log:

    <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> nrf_dfu_settings: Settings OK
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <debug> app: Enter nrf_dfu_app_is_valid
    <debug> app: No valid app to boot.
    <debug> app: DFU mode because app is not valid.
    <info> nrf_bootloader_wdt: WDT is not enabled
    <debug> app: in weak nrf_dfu_init_user
    <debug> app: timer_stop (0x200057D4)
    <debug> app: timer_activate (0x200057D4)
    <info> app: Entering DFU mode.
    <debug> app: Initializing transports (found: 1)
    <debug> nrf_dfu_ble: Initializing BLE DFU transport
    <debug> nrf_dfu_ble: Setting up vector table: 0x00072000
    <debug> nrf_dfu_ble: Enabling SoftDevice.
    <debug> nrf_dfu_ble: Configuring BLE stack.
    <debug> nrf_dfu_ble: Enabling the BLE stack.
    <debug> nrf_dfu_ble: No advertising name found
    <debug> nrf_dfu_ble: Using default advertising name
    <debug> nrf_dfu_ble: Advertising...
    <debug> nrf_dfu_ble: BLE DFU transport initialized.
    <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
    <debug> app: Enter main loop
    <debug> nrf_dfu_ble: Connected
    <debug> nrf_dfu_ble: Advertising...
    <debug> app: timer_stop (0x200057D4)
    <debug> app: timer_fire (0x200057D4)
    <info> app: Inactivity timeout.
    <debug> app: Resetting bootloader.
    <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.

    When i try to connect from mobile device then it gives Connected on debug but mobile is not able to discover the services on device and gets timeout and device gets disconnected . So after timeout device gets reset and again goes in boot loader.

Related