ANT RX fail while BLE connected with phone

Hi,

        I am currently developing a heart rate strap using SDK 17.1.0 and the S312 SoftDevice with the nRF52805.
I have noticed an issue:
when I connect the heart rate strap to my phone using the nRF Connect app, the ANT broadcast shows a large number of RX Failures and frequently enters the "Go to Search" state. However, as soon as I disconnect the phone from the heart rate strap, everything works normally. Similarly, when I don’t connect the phone at all, the ANT communication is also normal. Are there any parameters that need to be adjusted?

#define MIN_CONN_INTERVAL MSEC_TO_UNITS(400, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.4 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(650, UNIT_1_25_MS) /**< Maximum acceptable connection interval (0.65 second). */
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds). */

#ifndef ANT_HRM_ANT_OBSERVER_PRIO
#define ANT_HRM_ANT_OBSERVER_PRIO 1
#endif

NRF_SDH_ANT_OBSERVER(m_ant_observer, ANT_HRM_ANT_OBSERVER_PRIO,ant_hrm_sens_evt_handler, &m_ant_hrm);

Thank you.

John

Parents
  • Hi John,

    Could you check what's the actual connection interval when you connect to the phone ? It's the connection interval reported in BLE_GAP_EVT_CONNECTED event. 
    You can also use the sniffer trace to see what actually happen over the air. 

    I suspect that the connection interval for BLE was too short that it affects ANT communications. 

    Please also check the configuration for NRF_SDH_BLE_GAP_EVENT_LENGTH , could you try setting it down to 6 or lower . 

  • Hi Hung,

        I change NRF_SDH_BLE_GAP_EVENT_LENGTH value from 240 to 6. The issue has been greatly improved.
    Can you help me explain why this value has an effect?

    On the other hand, if I change MIN_CONN_INTERVAL  and MAX_CONN_INTERVAL to 30 ms and 60 ms, it also greatly improves this problem. I don’t understand why?

    Thank you.

    John.

Reply Children
  • Hi John, 
    NRF_SDH_BLE_GAP_EVENT_LENGTH  decide how long the BLE stack should stay in a connection event. 
    If you set it to 240 it will stay in the connection event up to 300ms if the connection event is as long. 
    When you set it down to 6 the maximum time the BLE stack stay in the connection event will be down to 7.5ms.
    This mean you will have more time for ANT protocol. 

    When you change  MIN_CONN_INTERVAL  and MAX_CONN_INTERVAL  down to 30 and 60ms, I think it will allow the phone to actually use these number instead of ignore it due to it 's too long (when you set to 400 and 650). I suspect that in that case the phone actually set it to something smaller. But we need to see the sniffer trace to be able to tell. 

Related