Hi,
My name is Bruno and I'm developing an Application which consists on:
Connect to a BLE device (I'm using Nina B112 from u-blox, which contains a NRF52832 SoC) through a Android Apk;
Android will send Nina data through NUS;
Nina will send data through UART to another microcontroller (MSP430);
MSP will send data back to Nina;
Nina will send MSP's data back to the Android through NUS;
The problem is that I can connect to the BLE and everything works good, but suddenly i get disconnected and can't reconnect (can't find Nina's advertising anymore)
When anything connects to Nina, it powers on the MSP so i can start the communication (I'm doing this for power consumption purposes). And when it gets disconnected, Nina turns off the MSP.
I don't know if Nina's stopped working and all pins were left 'HIGH' because MSP keeps turned on after that.
I connected to Nina B1 EVK and keep sending messages through NUS and no errors occured (it kept normally for hours). But Nina's EVK was not connected to anything so there was no UART messages received (only sent). Because of that i think that the UART might be the issue.
I couldn't track when the error occurs cause it occured after sending few messages (like 20 successfull messages sent) and lots of messages (like over 10 000). The interval between messages that android is sending is 200ms.
SPECS:
-UART: default config @19200 baudrate (flow control disabled, thinking about enabling it, i don't know if it would fix it)
-Nina: I'm using SDK v15.2, softdevice s132 that came with the SDK
-when receiving a UART message I'm using the Scheduler to proccess it, same with NUS.
-I'm using app_uart's methods
-on Android side i'm using nRF_Connect apk and an apk modified from nRF_UART
-as a try to solve the issue i implemented a routine that renews a timer each time a message arrive from NUS, and if no message arrive the timer expires and calls sd_ble_gap_disconnect using the m_connection_handle from the ble_uart_app example and BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.
I still think the UART might be the issue, wondering if there's something related to priorities and interrupts. If any one could help me i'd be very thankfull. Is there any point i'm missing?
Thanks in advance,
Bruno
