Constantly getting BLE_GAP_EVT_DISCONNECTED although BLE traffic correct

I am working on a BLE to ANT (Specifically FTMP to FE-C) gateway.

HW used is the pca10059 dongle.

Windows10, Programmer 3.0.4, Segger 5.42a.

SW is nRF5_SDK_17.1.0_ddde560

Softdevice ANT_s340_nrf52840_6.1.1.

ANT part works and BLE part sort of works also but I cannot figure out why I am getting BLE_GAP_EVT_DISCONNECTED(GATT_CONN_LMP_TIMEOUT) every about 40s.

Being a newbie on BLE, I decided to start from the ble_hrs_c example and adapt it (also taking inspiration from ble_lbs_c. 

I registered a new UUID for the FTMP (0x1826) successfully.

I manage to connect to the FTMP trainer, which grants me a total of 10 services (had to increase the max # of services to 10 to get them all).

I save the cccd handles of my needed services and use them to request the bike to start transmitting data (does not work for some reason but not the issue of the ticket) and to get notifications from the bike data.

(I can get the nRF Connect app to get the bike to start transmitting data, it seems to remember the state)

All is well, the data appears and is converted to ANT and shows up on mt garmin watch.

BUT! For unknown reasons I keep getting this GATT_CONN_LMP_TIMEOUT every 40s, lose connection to the trainer and need to start over. It reconnects and loses connection 40s later.

If I do not use the cccd handles to request notification nor try to start the trainer via the not working service, I get the exact same behaviour so I guess it probably has nothing to do with them?

I am a bit blind and only have the LED outputs to lead my troubleshooting efforts (and sending debug data over ANT) since I haven't managed to get the log info to the USB port.

Any suggestions what might be causing the timeouts?

Thanks for any advice

/Ola

Parents Reply
  • Ok great. In order to understand fully what is going on before attempting to debug further, I borrowed a 52840DK at work and decided to start up the nRF sniffer on it.

    Unfortunately, I can not get the sniffer to work. It cannot connect to my board although having flashed the sniffer hex file and seeing LED1 blink (supposedly when it receives BLE packages) so I think it is flashed ok.

    However, neither the programmer nor nRF Go is able to program it, but segger seems to succeed.

    In my attempts to understand why, I checked the device manager and disovered that there are 2 Jlink CDC UART ports. I stubled across another ticket with another person having the same problem, so I left a note there about my same problem.

    Also tried to connect with putty but no connection is made on either port.

    What to do?

    I guess I could try the same thing on my 52840 Dongle but am afraid that the sniffer hex file will overwrite the mbr, rendering the dongle useless unless I connect the DK debugger to it, which I prefer not to do.

    What to try next?

    Thanks

Children
Related