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

can't send packet in specified time interval

Hi all.

I want to send my packets in the negotiated time interval.

I sat the NRF_SDH_BLE_GAP_EVENT_LENGTH to 6.

The negotiated TI is 36 ms.

the results are 

1- the number of packets when I receive the hvx_complete event is always 1. (in the picture). 

2- some times I get NRF_ERROR_RESOURCES. (error number 19 in the picture).

3- in android, I get packets in unstable time distances.

so why I get errors(for resource in NRF) and time is not stable while the TI is less than the time that I call hvx_send ?

please help.

thanks all.

Parents Reply
  • Hello,

    ali_dehghan_nayeri said:
    Interrupt of timer0  was the problem.

    Yes, TIMER0 is in use by the SoftDevice, and may not be used by the application when the SoftDevice is enabled, this will cause the SoftDevice to assert.

    You mention that you get error for resources, could you make sure to have DEBUG defined in your preprocessor defines, like shown in the included image?

    This will make the logger output a detailer error message whenever a non-NRF_SUCCESS error is passed to an APP_ERROR_CHECK.
    If you are getting NRF_ERROR_RESOURCES from sd_ble_gatts_hvx then that means that you are queueing notifications faster than you are sending them, leading to the buffer filling up.

    ali_dehghan_nayeri said:
    so can we set sending ble packet priority more than the interrupt priority of timer0?

    You do not need to worry about prioritizing to send packets - the SoftDevice handles all this for you.
    I think the issue here is that your notification buffer is full, so that you are unable to queue all the packets you want to have sent. What queue size are you using?

    Best regards,
    Karl

Children
No Data
Related