how can i get the number BLE TX re transmissions

hello Nordic

i am working with nrf52832 and nrf52840 socs, with ncs v2.1.0

i would like to know how many of the BLE packets i am sending has to be resent (and if it is possible to know the reason of resent, in case there is another reason beside packet missed some bytes/bits on the OTA way, that would be great as well ) 

any idea how can i get that info ?

also another question, if i move (with BLE 4.2 and above) to extended length packets, to increase throughput, should there be more resent packets since the risk of loosing data in a larger packet is greater ?

hope to read you soon

best regards

Ziv

  • ok the problem i mentioned here is solve

    needed to increase config 'CONFIG_NUM_PREEMPT_PRIORITIES'  from =10 to =15 

    cause it ASSERTED here on the thread creation 
    void hci_ecdh_init(void)
    {
    #if !defined(CONFIG_BT_CTLR_ECDH_IN_MPSL_WORK)
    	k_poll_signal_init(&ecdh_signal);
    
    	k_thread_create(&ecdh_thread_data, ecdh_thread_stack,
    			K_KERNEL_STACK_SIZEOF(ecdh_thread_stack), ecdh_thread,
    			NULL, NULL, NULL, K_PRIO_PREEMPT(10), 0, K_NO_WAIT);
    	k_thread_name_set(&ecdh_thread_data, "BT CTLR ECDH");
    #else
    with the mentioned error
    ASSERTION FAIL [((((prio)) == 10 && z_is_idle_thread_entry((entry))) || (((10 - 1) >= ((-5))) && ((prio)) >= ((-5)) && ((prio)) <= (10 - 1)))] @ WEST_TOPDIR/zephyr/kernel/thread.c:536
    00> 
    00>   invalid priority (10); allowed range: 9 to -5
    1. however, i added a counter to each callback, which as for i understand is called ofr each connection event, but the count set at 14371 but the 'evt->event_counter' gives 2937412, so what does it count and what each entry to the callback represents ?
    this is my callback, a small modification from the llpm sample
    static bool on_vs_evt(struct net_buf_simple *buf)
    {
        uint8_t                                      code;
        sdc_hci_subevent_vs_qos_conn_event_report_t *evt;
        e_counter++;
        code = net_buf_simple_pull_u8(buf);
        if (code != SDC_HCI_SUBEVENT_VS_QOS_CONN_EVENT_REPORT)
        {
            return false;
        }
    
        evt = (void *)buf->data;
        con_event_info.nak_count += evt->nak_count;
        con_event_info.crc_err_count += evt->crc_error_count;
        con_event_info.timeout_disconnection_count += evt->rx_timeout;
    
        con_event_info.con_event_count += evt->event_counter;
    
        return true;
    }
    2. moving to softdevice controller increased ram take by 5% and also flash take, is there a way to configure for use only feature or something to decrease the memory take ?
    hope to read you soon
    best regards
    ziv
  • Hi,

    1)

    ziv123 said:
    1. however, i added a counter to each callback, which as for i understand is called ofr each connection event, but the count set at 14371 but the 'evt->event_counter' gives 2937412, so what does it count and what each entry to the callback represents ?

    You don't need to do any increment for the event_counter yourself. The event will give you the event_counter directly.

    2) Will be covered here:  reduce RAM and flash take by softdevice controller 

  • You don't need to do any increment for the event_counter yourself. The event will give you the event_counter directly.

    i am trying to understand the diff between the values 

    if the event_counter is increment by 1 each time the callback is called the 2 values (mt counter and the event_counter) should have been equal ???

  • Hi,

    ziv123 said:
    i am trying to understand the diff between the values 


    What values do you mean now?

    evt->event_counter  ,  con_event_info.con_event_count , e_counter ?

  • e_counter  vs  evt->event_counter

    volatile uint32_t e_counter = 0;
    static bool       on_vs_evt(struct net_buf_simple *buf)
    {
        uint8_t                                      code;
        sdc_hci_subevent_vs_qos_conn_event_report_t *evt;
        e_counter++;
        code = net_buf_simple_pull_u8(buf);
        if (code != SDC_HCI_SUBEVENT_VS_QOS_CONN_EVENT_REPORT)
        {
            return false;
        }
    
        evt = (void *)buf->data;
        con_event_info.nak_count += evt->nak_count;
        con_event_info.crc_err_count += evt->crc_error_count;
        con_event_info.timeout_disconnection_count += evt->rx_timeout;
    
        con_event_info.con_event_count = evt->event_counter;
    
        return true;
    }

    this are the printed values,

    /// print values on disconnection:
    static void disconnect(struct k_work *work)
    {
        LOG_INF("event log: naks %d, crc %d, timeouts %d, events %d", con_event_info.nak_count, con_event_info.crc_err_count,
                con_event_info.timeout_disconnection_count, con_event_info.con_event_count);
        con_event_info.nak_count = 0;
        con_event_info.crc_err_count = 0;
        con_event_info.timeout_disconnection_count = 0;
        con_event_info.con_event_count = 0;
    
        comm_mng_disconnect_ble_blocking();
    }
    
    //// output
    counter 9032 event log: naks 62, crc 9, timeouts 23, events 4423

    what can cause the diff ? 

    another question i have - is it possible to have the report start at some point after the connection between end point and node was established and not from the first moment of connection ? (i ask that in order to get better resolution of number of connection event and re transmissions at the stage of big data transfer which is not always start right at the start of the connection)

    hope to read you soon

    best regards

    Ziv

Related