Thank you very much for your help Mike. My area of expertise is firmware and RTOS so I feel quite confident on the matter of interthread synchronization and shared object access protection. Unfortunatelly I am not so expert on the windows subsystem.
No matter what I try I am unable to solve the issue. On your first answer in this thread you said that read characteristics/values form separate thread is not recomended, but because I need to have some kind of UART emulation with constant communication with the BLE device I do not see how can I make it in another way without compromising the UI responsiveness. I am under the impression that this is the cause of the issue in my particular application.
I have made quite a lot of test, even making every single call to your API from my bluetooth thread, instead of some from the UI thread and then from the bluetooth thread. Same result.
So to sumarize, do you think that read characteristics/values form separate thread is the cause of the problem?, any workaround?
Regards,
Iker.