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

why my 51822 break down when i use the sd_ble_gatts_hvx() during the interruption caused by the external pin toggling

Hi, i use the library app_gpiote to setup interrupts on a toggling external pin(this pin generates a signal which changes from high to low).The external interrupt signal is generated every 4ms. during each interrupt i will get a 2-bytes data,and every 10th interrupt i have to send the data(10*2bytes) to the central device using the sd_ble_gatts_hvx() function.The problem is that when i use sd_ble_gatts_hvx() to transmit the data during the 10th interrupt ,the system will break down without any tips. i don't know what is the reason causing the problem. i wonder whether 4ms is too short to finish the transmition by the sd_ble_gatts_hvx() function or not.
wish for your answer. have a good day !

  • Hi

    It would depend on the connection interval that you choose if the stack is able to transmit so much data. According to my calculations, you are sending 4 kbps. It would also depend on what central device you use if it is able to receive multiple packets or not per connection event, see this thread for ideas on how many packets can be sent to different central devices.

    Also make sure you are monitoring the softdevice buffers as described here

    What happens if you start your debugger and set a breakpoint in the app_error_handler function? Do you get any error code there that can give some hints on what is going on?

Related