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

nrf52840 , android disconnect after 28 seconds of connection

hi ,

I have a project with sdk14.2 nrf52832. It works well, it can broadcast, it can connect, everything is fine.

But I have a new project that requires nrf52840. My chip is 52840 QIAAC0. It only supports sdk15.0.

So I first tried to change the original project to NRF52840, which supports sdk15.0.

The transplant went well, broadcasting on 52840. But something strange happens when I connect to my phone.

It will disconnect after about 25 seconds. But it's the mobile phone that's actively disconnected. And 52840 re-enter broadcast mode.

I get the logger from sniffer.I found out that BLE's communication with mobile phones suddenly stopped. 

There was no communication for ten seconds, so the phone was disconnected.

I don't know why . Can you analyze the problem? how to solve problem?

sr3 lmp disconnet log01.pcapng

BR

Judge

Parents Reply Children
  • hi 

    My phone's android is 8.1.0, support bluetooth 5.

    The SDK I'm using now is 15.0. Softdevice is s140_nrf52_6.0.0_softdevice.

    I used the Smart Remote 3 program(SR3 version 1.2) to migrate to 52840.

    Nothing logger.Maybe I didn't open more debug information.

    I have followed the instructions in the migration manual.

    I have solved the problem. Add the following code in the sofedevice BLE event:

            case BLE_GAP_EVT_PHY_UPDATE_REQUEST:

            {

                NRF_LOG_DEBUG("PHY update request.");

                ble_gap_phys_t const phys =

                {

                    .rx_phys = BLE_GAP_PHY_AUTO,

                    .tx_phys = BLE_GAP_PHY_AUTO,

                };

                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);

                APP_ERROR_CHECK(err_code);

            } break;

    I don't know why ?

  • Hi Judge,

    So if I understand you correctly you have solved the issue?

    but you are wondering why it now works?

     

    I do not know what your code looked like before, but the way you are handling the BLE_GAP_EVT_PHY_UPDATE_REQUEST case is the same as it is done in "ble_app_uart" example. Which is to automatically choose the PHYs the peer prefers to use. 

     

     

  • hi Martin Lesund,

    Yes, I did. The problem solved.

    Thank you!

Related