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

sd_ble_gatts_hvx() and extra data

Hello,

I'm using Win 8.1 BT LE stack to communicate with the NORDIC. I am using soft device s110. I use notifications to send data to windows which assembles a message based on it. I am seeing that every so often (and it is not every time), data gets sent over BT that is extra data.

For example, I am meaning to send a 60 bytes of data and instead, windows receives an extra 27 bytes (87) of data. This is not the exact situation, but is pretty close. Also, these 27 bytes seem to be random. The bytes also seem to come in the middle of the stream, so I get something like 40 good bytes, 27 garbage bytes, then the remaining 20 good bytes.

I'm 90% sure it's not my code because the code is just reading from the SPI bus and then sending the data. I've verified the SPI bus data with the logic analyzer is correct (60 bytes) and that the data Windows gets is the 87 bytes as described before.

Is this a know issue? Is there a workaround? Am I missing something?

Thanks.

Parents
  • I had a similar problem when moving 2K of binary data from UART0 to be transmitted to my iOS central device. It turned out my copy of data from the UART to my buffer for data to be transmitted was done in user level code called out of the main loop. However, my read of that buffer to send the data to the radio was being done in a low priority interrupt. I was able to protect my copy of UART data into the outgoing buffer with a critical section to prevent corruption and incorrect byte counts.

    Without seeing your code, I have no idea if this is relevant to your problem. But I thought I'd mention it in case it might be helpful.

Reply
  • I had a similar problem when moving 2K of binary data from UART0 to be transmitted to my iOS central device. It turned out my copy of data from the UART to my buffer for data to be transmitted was done in user level code called out of the main loop. However, my read of that buffer to send the data to the radio was being done in a low priority interrupt. I was able to protect my copy of UART data into the outgoing buffer with a critical section to prevent corruption and incorrect byte counts.

    Without seeing your code, I have no idea if this is relevant to your problem. But I thought I'd mention it in case it might be helpful.

Children
No Data
Related