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

sd_ble_gatts_hvx error with serializer

Hi there!

I have been working with serializer and have the below issue: I am using sd_ble_gatts_hvx() to transfer 20 bytes in burst until I get an error (TX buffer full or other errors). However, I am getting an error code 9: INVALID length for sd_ble_gatts_hvx(). Debugging further I found that it is an error while decoding at the Nordic SDK. I guess decoding fails because of invalid length though the length was <= 20. But the problem here is in spite of getting an error response, the stack is transmitting this packet most of the times. So as a work around I stopped re-transmitting the packet if the error code is 9. This still doesn't solve my problem as sometimes the packet is not transmitted for this case. Can you help me out in fixing this issue? If there is an issue with the NRF stack/SDK, is there a workaround?

I am using nrf SDK 12.1 The APP is hosted on another controller and I am using the serializer code to interface with nrf52832, S132 through UART.

Parents
  • @Gauti: Have you tried to trace down in the serialization library on which function throw error code 9 ? Note that NRF_ERROR_INVALID_LENGTH is not in the list of return code of sd_ble_gatts_hvx().

    Error 12290 = 0x3002 means BLE_ERROR_INVALID_CONN_HANDLE not buffer full. Could you double check ? If you run out of buffer for notification, you should receive BLE_ERROR_NO_TX_PACKETS = 0x3004 instead.

Reply
  • @Gauti: Have you tried to trace down in the serialization library on which function throw error code 9 ? Note that NRF_ERROR_INVALID_LENGTH is not in the list of return code of sd_ble_gatts_hvx().

    Error 12290 = 0x3002 means BLE_ERROR_INVALID_CONN_HANDLE not buffer full. Could you double check ? If you run out of buffer for notification, you should receive BLE_ERROR_NO_TX_PACKETS = 0x3004 instead.

Children
No Data
Related