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

Connection is disconnected automatically

Hi,

I'm trying to implement a pulse counter, and send the data to client via BLE. I have debugged the module of the counter without connection separately, it's working well. But when I'm using USB Dongle for debugging the data, some issue happens: Once the pulse generator is connected, the connection will be disconnected automatically, and same thing happens if I try to reconnect it.

I opened the UART, and got below logs:

[DM]: Request to allocation connection instance
[DM]:[00]: Connection Instance Allocated.
[DM]: Searching for device 0xD7 0xAD 0x10 0x2D 0xFB 0x8A.
[DM]:[DI 0x00]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]:[DI 0x01]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]:[DI 0x02]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]:[DI 0x03]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]:[DI 0x04]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]:[DI 0x05]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]:[DI 0x06]: Device type 0xFF.
[DM]: Device Addr 0x00 0x00 0x00 0x00 0x00 0x00.
[DM]: Notifying application of event 0x11
I: Device connected
[DM]: Disconnect Reason 0x003E
[DM]: Notifying application of event 0x12
[DM]:[CI 0x00]: Freeing connection instance
[DM]:[00]: Freed connection instance.
[DM]: Initializing Connection Instance 0x00000000.
I: Device disconnected

Would you please help me check what might cause this disconnection?

The counter I'm using is implemented with LPCOMP + TIMER which have been described in my previous two questions: 1) and 2).

I was using s110 based on SDK 7.2, and just upgraded to latest SDK 8.1, the issue is still there.

The USB Dongle was initialized based on SDK7.2, and the logs were captured from UART which was implemented with simple_uart library in SDK7.2.

Just as I pre-mentioned, if there is no pulse generator connected, I can use USB Dongle to debug my customized service to control the board (pca10028) to start sampling and stop sampling. But once it's connected to P0.05, the connection is disconnected immediately.

Any feedback will be really appreciated.

Thanks & Regards, Stanley

  • Hi Hung Bui,

    Sorry for confusing you about the counter. The first line "NRF_TIMER2->MODE = TIMER_MODE_MODE_Counter; " should be useless. This counter is actually working in TIMER mode, and it's just used as a TICK counter. When the LPCOMP interrupt happens, the TICK in the TIMER will be read out, and TIMER will be reset for next time usage.

    I'm sure the connection is established. I'm using Nordic Master Control Panel on the phone to connect the device, and with Pulse generator turned off, everything works well, I can get the services list from the APP. But once I turned on the generator, the connection was disconnected quickly. Consequently, I can see APP keeps trying to re-connect the device, occasionally can see the refreshed service information in APP.

    I set up the Sniffer on my USB Dongle (PCA00001), with the firmware "ble-sniffer_nRF51822_1.0.1_1111_Sniffer.hex". The WaveShark version is Wireshark-win64-1.12.5.

    Regards, Stanley

  • Is it possible to be caused by the current of input? I don't have a tool to measure the input current.

  • @Stanley: I'm not sure I fully understand your configuration. Could you update with the correct configuration of TIMER, PPI, and interrupt handler ?

    You can test if the pulse generator caused the voltage to drop or smth with the hardware by not enabling the interrupt on the input LPCOMP pin to see if the connection is dropped or not. If it won't then most likely it was the issue with the interrupt handler.

  • Hi Hung Bui,

    Sorry for late response, I was trapped into other issues in these days.

    For this issue, we're making a new board with a real DA module to generate pulse, and will check if it's caused by voltage. Will get back to you once the result is coming.

Related