nRF52805 BLE doesn't re-advertise after disconnection

Hi, I'm using BC805M module which uses nRF52805 SoC. 

I have a power ON/OFF button on the PCB. If I press the button (deep sleep mode) during BLE connection, the BLE will disconnect with the mobile app. Then, press the button again, the chip will wake up, and I could see the chip is advertising BLE. So far so good. 

Issue:  

My BLE signal transmits data to the mobile phone app nRF Connect correctly and continuously. However, if I disconnect the BLE signal by closing the tab in nRF Connect, it will disappear forever. I mean, it will NOT re-advertise after disconnection. The button doesn't work as well. 

Any idea, please? Thanks a lot! 

Parents
  • Hello,

    My BLE signal transmits data to the mobile phone app nRF Connect correctly and continuously. However, if I disconnect the BLE signal by closing the tab in nRF Connect, it will disappear forever. I mean, it will NOT re-advertise after disconnection. The button doesn't work as well. 

    Does you device still function at all after an unexpected disconnection? Is there any indication that the program is still running, apart from the advertising not restarting and the button not working?
    The fact that your SYSTEM_OFF sleep button does not work makes me suspect that your program might be getting stuck somewhere, or that an error has occurred due to the disconnection - the latter should usually mean a reset would happen, if you have not implemented specific error handling to avoid this.
    On the bright side, this definitely sounds like a logical error within the program, so it hopefully should not take too long to root out.

    What happens if you provoke this condition in a debug session, does your program counter get stuck anywhere?

    Best regards,
    Karl

Reply
  • Hello,

    My BLE signal transmits data to the mobile phone app nRF Connect correctly and continuously. However, if I disconnect the BLE signal by closing the tab in nRF Connect, it will disappear forever. I mean, it will NOT re-advertise after disconnection. The button doesn't work as well. 

    Does you device still function at all after an unexpected disconnection? Is there any indication that the program is still running, apart from the advertising not restarting and the button not working?
    The fact that your SYSTEM_OFF sleep button does not work makes me suspect that your program might be getting stuck somewhere, or that an error has occurred due to the disconnection - the latter should usually mean a reset would happen, if you have not implemented specific error handling to avoid this.
    On the bright side, this definitely sounds like a logical error within the program, so it hopefully should not take too long to root out.

    What happens if you provoke this condition in a debug session, does your program counter get stuck anywhere?

    Best regards,
    Karl

Children
  • Thank you very much, Karl. 

    I solved the problem. But I don't understand why. 

    Initially, due to my logger config was wrong, I cannot see the print/log in RTT Viewer. After I fixed the logger config issues (see this link), my BLE device works properly now. I mean, it will re-advertise after disconnection. 

    Do you have any clue why, please? Thanks. 

  • StevenW807 said:
    Thank you very much, Karl. 

    No problem at all, Steven, I am happy to help!

    StevenW807 said:

    Initially, due to my logger config was wrong, I cannot see the print/log in RTT Viewer. After I fixed the logger config issues (see this link), my BLE device works properly now. I mean, it will re-advertise after disconnection. 

    Do you have any clue why, please? Thanks. 

    I do no immediately see how resolving the logger issue should also resolve the BLE re-advertising issue, no..
    Are you seeing any unusual or warnings logged by your logger when you go through the same test scenario, now that the logger is fixed?
    For the record, the expected behavior of all examples is to resume advertising upon a broken connection.

    Best regards,
    Karl

Related