connection failure but recoverable by system reset

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
uta_lc
Offline
Last seen:1 year 1 week ago
加入:2016-05-03 07:39
connection failure but recoverable by system reset

Dear DLG support,

We have observed the case where a running product all of a sudden is not connectable any more. We tried to sniff it but for some reason, the sniffer can only capture the CONNECT_REQ message and the rest are some empty PDUs from the master (iPhone) but no response from the peripheral side (14580) - likely the connection is half way through but just cannot finish.

We then did a reset of the peripheral and it is OK to connect from iPhone again.

From your experience, what can cause the above issue? Is it something DLG can help with?

If not, do we have a way to capture the failure at some point so that I can test whether we have failed a number of connection retries. At least at this point I can reset the system to recover it from the state.

Note: We are actually using 5.0.3 but not sure why it is in the pull-down list above.

Thanks for your attention,
uta_lc

Device:
PM_Dialog
Offline
Last seen:7 hours 16 min ago
工作人员
加入:2018-02-08 11:03
Hi uta_lc,

Hi uta_lc,

The description of your problem is quite generic, so I can’t be so much specific of what might go wrong. There are a few reasons that your device isn’t connectable and after the reset can be connectable, so I will refer the most possible and common reasons in order to debug this.

  1. Regarding your description. Could you please make sure that your device is still advertising and that the device you see on your mobile application is not cached from the central device.
  2. In order for a device to be connectable, it must advertise undirected advertising packets, so could you please check that the packets emitted are in accordance with connectable ones?
  3. Please try to use a development kit, for example with a Pro Dev kit, in order to check if you face the same problem and verify that what you are experiencing is a sw or a hw issue. Also, I suggest you try to use a different BLE phone and possibly an android in order eliminate the case of the phone having issues.
  4. Please make sure that you don’t use P1_2 and P1_3 , because they affect the XTAL16 if you toggle them in high frequency (UART, PWM, SPI, etc).
  5. Also, I suggest you to check the behavior of your code while you try to connect, so can you please try to run it in debug mode and add some breakpoint in the user_app_connection and user_app_adv_undirect_complete callback functions, can you see them occur when the issue happens ? In case you are using a custom board, can you replicate the issue on your board using a default SDK example?

Please check the above recommendations, in order to clarify if this is a hardware or a software issue.

Thanks, PM_Dialog

uta_lc
Offline
Last seen:1 year 1 week ago
加入:2016-05-03 07:39
Thanks for your response.

Thanks for your response.

1. Yes - it is advertising
2. Yes - it is doing undirectional advertising
3. The failure is hard to capture / reproduce and we only captured once on our own. We plan to isolate the cause down the track but in the short term, we are more interested in finding a work around. That is, do we have a way to monitor failed connection so that we can reboot?

4. We are not using P12 or P13 at all.

5. See answer to above point 3.

We will follow your advice to track down the cause but right now we are keen to know if we have a way to monitor whether a connection is successful or not - say upon receiving CONNECT_REQ we set up a timeout timer, in user_on_connection we can cancel the timer otherwise it will trigger a time out event?

Thanks for your help,
uta_lc

LC_Dialog
Offline
Last seen:6 days 3 hours ago
工作人员
加入:2016-09-19 23:20
Hi uta_lc,

Hi uta_lc,

Adding to the previous suggestions.,

If you have the debugger connections exposed on your hardware, you might want to hot attach the debugger and see where the system stands at the time of this connection issue. This will provide some insight into what might be going wrong in the software execution flow.

Also, you can power your target board with a Pro Dev kit and observe the power consumption using the power profiler tool available in our Smart Snippets software. The power drawn can point to some specific operation.

希望这可以帮助. .

Best,
LC_Dialog

uta_lc
Offline
Last seen:1 year 1 week ago
加入:2016-05-03 07:39
Thanks for the wonderful

Thanks for the wonderful suggestions.

当我们试图捕捉bug发现the root cause, we do have a pending release where I was asked to detect the failed connection attempt, once that happens for a few times, we have to reboot to work around. Do we have such a point in the SDK so that I can put a hook in to capture failed connection attempt?

Thanks for your attention,
uta_lc

PM_Dialog
Offline
Last seen:7 hours 16 min ago
工作人员
加入:2018-02-08 11:03
Hi uta_lc,

Hi uta_lc,

There is no point in the SDK that you are able to put a hook in order to capture a failed connection attempt.

Thanks, PM_Dialog