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
  • Can you track down which exact API threw the NRF_ERROR_INVALID_LENGTH ? It's very strange that after you get the error, the data still get through to the softdevice. It seems like a bug then.

    We need to find a way to reproduce the issue. How often do you receive error code 9 ? Do you have the same issue if you call other API, such as the sd_ble_gatts_value_set() ?

    If you don't do burst force, and simply call sd_ble_gatts_hvx() once after each TX_COMPLETE, do you see the issue ?

Reply
  • Can you track down which exact API threw the NRF_ERROR_INVALID_LENGTH ? It's very strange that after you get the error, the data still get through to the softdevice. It seems like a bug then.

    We need to find a way to reproduce the issue. How often do you receive error code 9 ? Do you have the same issue if you call other API, such as the sd_ble_gatts_value_set() ?

    If you don't do burst force, and simply call sd_ble_gatts_hvx() once after each TX_COMPLETE, do you see the issue ?

Children
No Data
Related