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

Problem with simultaneous transmission and reception

Hi all again guys! I am experiencing a problem with my application: i have a beacon that is sending ADC converted values to a nrf51 DK (via notification), which is connected to the pc to receive these values via USB and visualize them; from the pc, i also send back some values at precise moments to the beacon, via write without response, so that the transmission is bi-directional. What happens is that sometimes (it seems pretty much random, other times it all goes good with no problems), when i decide to send some numbers from the PC using the write operation (while of course i am still receiving notifications simultaneously), this causes a disconnection between the two devices (i think probably because of an error occurring in these operations), with consequent loss of data sent by notification, that should be continuous and real-time. What could be the problem? Isn't the nrf51 capable of handling both transmission and reception simultaneously? Please note that my connection parameters between the two devices are 10 ms of connection interval, and 0 slave latency.

Thanks in advance and tell me if any other information are needed!

projects.rar

  • Excuse me for bothering Mr Myhre, did you manage to try my code? I did some other tests and the code works in the cases when i don't have disconnection between the two devices (i see on the beacon the number sent via serial with app uart put on an oscylloscope), but i still cannot understand why there are those random disconnections. When a disconnection happens, the values that i sent with the write are put via serial on the immediately successive connection and write operation, so when a disconnection happens i actually "lose" that packet. I only need help about this, fix the disconnection problem! Thanks really...

  • I have been out travelling, sorry. You are probably getting BLE_HCI_CONNECTION_TIMEOUT on the central because the peripheral is not responding. It is probably not responding because you it has reset in app_error_handler() or because you have got a hard fault. Try setting a breakpoing in app_error_handler() and see if you hit it, and try stopping when you get this disconnect, where in the code are you?

  • I'm sorry Mr Myhre but i am currently at a point of the project where, not for my fault, i must work on different features of the system and i can't make any testing on the bluetooth devices (even though i already tried something in the error handler with no results, but i am not so confident in my debug abilities); unfortunately i will have to solve it later when i will have the occasion to work again on the BT part, so can i kindly ask you or somebody of the Nordic moderation team to make this debug for me on the code so i will have something ready in the following weeks to fix the problem? It would be really helpful for me!

  • If you try what I mentioned above, and you are still stuck, I will help you. Let me know when you ahve time working on BLE again.

  • I am having the possibility to work on the beacon today. Since the problem seems to be the beacon (as you said, the app_error_handler is called and a system reset in it is executed), i tried to figure out what makes this happen, and what i saw is that if i remove the app_uart_put instruction, it happens very very less times (maybe 1 every 30/40 sendings), if i put it back, every 2 or 3 times i send something to the beacon, they disconnect, due to the function nvic_systemreset in the app error handler. Even with this, this happening seems to be pretty random.

    In the error handler, the error code seems to come from app uart put, and the error is "NRF_ERROR_NO_MEM". Can you please give me your expert opinion on how to fix this? Please note that every time that the beacon receive a packet to send out with app uart put, it's a packet of 13 bytes; this error seems to happen sometimes at the first sending after turning on the beacon, so the buffer shouldn't be already full (TX_BUFFER is set on 256).

Related