Execution time of bt_nus_send

Hi,

This is the follow up on this question, I'm not sure how it was closed.

I'm getting different execution times (not transmission time, like mentioned in the answer here) for `bt_nus_send` function, although in the above mentioned post it is said that the function is not blocking. So, I'm wondering why sometimes the function takes a couple of milliseconds to execute if it is not blocking.

In most cases it is stable, and around ~100 microseconds, but I think when there is a problem with connection, I get a couple of milliseconds. If the function only queues data in the SoftDevice controller's FIFO for transmission in the next connection event, I expect similar execution times each time the function is called.

What could be the cause of the problem?

Parents
  • Hello,

    This is the follow up on this question, I'm not sure how it was closed.

    It seems the ticket was closed because my comment was marked as a 'verified answer', which usually indicates that the issue in the original ticket has been resolved by the comment.

    I'm getting different execution times (not transmission time, like mentioned in the answer here) for `bt_nus_send` function, although in the above mentioned post it is said that the function is not blocking. So, I'm wondering why sometimes the function takes a couple of milliseconds to execute if it is not blocking.

    Could you elaborate on how you have measured the execution time? Which priority were this measurement being performed with?

    In most cases it is stable, and around ~100 microseconds, but I think when there is a problem with connection, I get a couple of milliseconds. If the function only queues data in the SoftDevice controller's FIFO for transmission in the next connection event, I expect similar execution times each time the function is called.

    Yes, I too do not expect connection state to matter to the execution time of the function call, which is why I think we will need to look into how the execution time is measured before we delve deeper into this.

    Best regards,
    Karl

  • For measuring of execution time, I am using TIMER — Timer/counter, and just calling nrfx_timer_capture before and after bt_nus_send call.

Reply Children
No Data
Related