This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Soft device enable and disable - [DFU] disconnected by the remote device

Hello all

I am facing a very strange issue, already searched the forum but didnt find anything like it.

Okay so I can get DFU to work. For our custom application we have to disable the soft device for some time for sensor acquisitions and re enable it at a later time for OTA upgrades.

I simply use nrf_sdh_disable_request() to de initialize the soft device successfully, which it does.

I later re - enable soft device using the standard ble calls in example code:

ble_stack_init();
    peer_manager_init();
    gap_params_init();
    gatt_init();
    advertising_init();
    services_init_2();
    conn_params_init();   
     
    //Start execution.
    application_timers_start();
    advertising_start(erase_bonds);

BLE gets initialized successfully, device is advertised and connects to as well. The problem is in DFU. When I attempt DFU, it keeps getting stuck into trying to switch to bootloader, repeatedly giving
"[DFU] disconnected by the remote device"

The logs then try to open the firmware file again, re initiating the process but nothing happen. I have spend quite some time on this and hit a blocker. Any help is appreciated. There must be a step I am missing during re-enabling the soft device

  • Okay so I managed to debug the project at least. I dont merge all files and then flash and debug. I flashed the bootloader and then started to debug the project.

    The debugger reaches till NVIC_SystemReset() meaning the system does try to go into DFU mode.

    if ((m_pwr_mgmt_evt == NRF_PWR_MGMT_EVT_PREPARE_RESET)
         || (m_pwr_mgmt_evt == NRF_PWR_MGMT_EVT_PREPARE_DFU))
        {
            NVIC_SystemReset();
        }

    Anyways, the debugger hits NRF_BREAKPOINT_COND in app_error_fault_handler in app_error_weak.c and then restarts.

    So I think the system should have gone into DFU mode at least, but either it didnt go or something else happened. Any thoughts?

    I promise I am going to close the issue after this haha. We have a release pending with all these features actually

  • The program can't reach both NVIC_SystemReset() in the pwr module and the flash breakpoint NRF_BREAKPOINT_COND in one session. Can you read out the error information from the app error handler?

  • Sorry I meant that this happens after I attempt DFU. As soon as I press DFU, the program reaches NVIC_SystemReset(). After this restart it is expected for firmware to go into DFU mode right. Instead it just reboots the app

  • Lets focus on the assert for now. Can you please read the error information from the app error handler when you have hit the flash breakpoint (i.e. error code, file name, and line number) ?

  • Im facing a super weird issue right now. The working example I had - Bonding + LESC DFU. To make it debug I just flash bootloader and then debug the main app. Doing that brings about the same result (system restart)

    But when I merge BL settings + BL + APP + SD, I cant debug but the DFU happens.

Related