Buttonless DFU with bonds, issue on Galaxy s8 phone

We are working on a project, with a working secure buttonless bootloader that works flawlessly. However I recently made it with bonds, and it works with all of the devices I've tested both OS and android, except my Galaxy S8. Upon issuing the enter bootloader command, the device enters bootloader mode and advertises the bootloader fine. However when I connect my Galaxy S8 to the device, I notice it contains all the characteristics and services of the app on the firmware, not the bootloader, and pressing the DFU button on NRF Connect and attempting an update via zip will fail. Attempting with a newer android phone, android tablet, and OS phone works fine, upon connecting with the bootloader the NRF connect app displays all the bootloader services and characteristics instead of the device apps. Do you have any idea what may be the issue with my Galaxy S8? I have attempted reinstalling the NRF Connect app with no success.

Thanks,

Steven

Parents
  • Hello Steven,

    It sounds like the bootloader either failed to send the service changed indication, or the phone failed to process it. When bond sharing is enabled, the service changed indication is used by the GATT server to signal that the attribute table has been changed and that the phone must perform a new service discovery.

    To troubleshoot this, I recommend starting by checking the error code returned by the nrf_dfu_ble.c->service_changed_send() function in the bootloader (it should be called when reconnecting to the device in bootloader DFU mode).

    When using buttonless DFU without bonds, the bootloader will use a different address to avoid problems with attribute caching. However, this is not possible with bond sharing, as the BLE address has to remain the same for the bond to be valid.

    Link: https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/service_dfu.html 

    Best regards,

    Vidar

  • Hi Vidar, thanks for the response.

    It appears it is related to the indication, as if I select the indication button for service changed on NRF connect during application mode, before i enter DFU, everything works as expected on my Galaxy S8. So from my understanding, the app is supposed to set indication for service changed at some point, but it is failing on my phone? Is there a way to code to make it indicate at some point, perhaps after connection, in case it fails?

    My current tools at my disposal is our custom pcb and an nRF52 DK, with which I used Segger IDE to debug. I am unsure how I can check for the error code returned by the service_changed_send() function, as I believe you cannot debug the DK with both app and bootloader on it? Unless I am mistaken?

    Thanks,

    Steven

  • Hi Steven,

    It sounds like the problem was that your phone was not subscribed to the Service Changed (SC) indication. This will prevent the bootloader and the app from reporting changes to the attribute table. I'm not sure why this is only affecting the S8, however. Maybe the other Android phones enabled indications automatically. iOS devices will do it automatically, at least. Either way, if you are using a custom Android app, the solution should be to have it enable the SC indication automatically. For the nRF connect app, it needs to be done manually before starting DFU.

    Steven Yan said:
    My current tools at my disposal is our custom pcb and an nRF52 DK, with which I used Segger IDE to debug. I am unsure how I can check for the error code returned by the service_changed_send() function, as I believe you cannot debug the DK with both app and bootloader on it? Unless I am mistaken?

    I don't think it will be necessary to debug the bootloader after all. However, if I were to debug it, I would start a debug session with the bootloader project, set breakpoints before and after the function in question, let the execution continue to the application, initiate DFU, and then wait for the breakpoints to get hit.

    Best regards,

    Vidar

  • Thank you for your help, we will keep that in mind

Reply Children
No Data
Related