Connection failed and caused a system reset when connect to some Android platform

⚠️
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.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
文究
Offline
Last seen:1 year 7 months ago
加入:2016-07-12 07:10
Connection failed and caused a system reset when connect to some Android platform

Hi, DLG,

I've got the problem when connecting the peripheral(DA14580) to the Android platform (Xiaomi, MI note 3) using the 'all in one' example, the peripheral(DA14580) sometimes gets reset a few seconds after when I make the 'connetion' action on the phone. Then I've tried on the IOS platform, but it seemed no problem at all.

In the example of 'all in one', what I have made the modifications are listed as below:
1. Suit the GPIO to my board:
1.1 One Led at P02, activated at High level.
1.2 One button at P11, input High when pushed.
1.3 One PWM at P10.
1.4 Disable the I2C function in the orignial example.
2. At bottom of the 'user_app_init', power down the flash with the code: ( As such, when the device gets reset, it can be stuck at booting routine )
spi_flash_enable(SPI_EN_GPIO_PORT, SPI_EN_GPIO_PIN);
spi_flash_power_down ();
spi_release();

Then, I tried to sniff the packets over the air using sniffer: ( Continuously connect or disconnect the device through App 'nrf connect' from the phone(Xiaomi, MI note 3) )
3. The failure occured once in 5 or 6 attempts.
4. And the most of the time of the failure, when I started to connect the device from the phone, the sniffer can still and only catch the ADV_IND and SCAN_REQ/SCAN_RSP PDUs and last for over 10 seconds, then the device stuck.
5. Sometimes in these failures, the sniffer gets the CONNECT_REQ PDUs, and then the 'Feature exchange' and 'Version exchange' procedures. After that the master of the phone immediately sends out a 'LL_TERMINATE_IND' PDU with the error code 'Remote User Terminated Connection(0x13)', and later on the ADV_IND/SCAN_REQ/SCAN_RSP similar to the point 4 as described above. The packets snifferred are listed in the attachment.

Hope your help.

Attachment:
Device:
文究
Offline
Last seen:1 year 7 months ago
加入:2016-07-12 07:10
Description fixes:

Description fixes:

1. In addition to the original post behind 'In the example of 'all in one', what I have made the modifications are listed as below', add 'The duration time of the Advertising is changed from 10 seconds to 120 seconds'

2. I had only make the 'connection' atcion and then the situation occurred according the description of point 5 of the original post.

PM_Dialog
Offline
Last seen:7 hours 46 min ago
工作人员
加入:2018-02-08 11:03
嗨文究,

嗨文究,

There are a few reasons that your device resets, so I will refer the most possible and common reasons in order to debug this.

  • Could you please check what does your code after it gets reset and what does when you try to connect from an Android phone?

  • Your code is still running or it gets into an assertion? You can test this via hot attaching the debugger. When you try to connect from your phone the user_app_connection() callback function will be triggered, so where does your code go after that?

  • In addition, could you please clarify if you face the same problem when you run the default all_in_one example of SDK? Which SDK version are you using?

  • Also, could you please let me know if you are able to connect from the NRF application of another android phone?

Thanks, PM_Dialog