Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

uart module stop working while connecting.

Hi guys,

I am developing a device which uses nrf51822 and using SDK 11. My application is connecting to other device continuously and exchange information by UART 10400 baud rate. The data transfer time is about 33 ms and I use timer to repeat the process by 500 ms. This process is start when the power is ON and stop when power is OFF. While this process is going, I want to connect to device by using smart phone and send some information as well as to receive information.

I always can connect to the phone; however, after connection, in several times, the uart module is not working anymore, in the uart lines, the signals is still there. The nrf51822 still be able to send and receive uart signals in the uart lines however, uart module is not receive any byte.It only return 

APP_UART_TX_EMPT

but not return

APP_UART_DATA_READY

anymore.

Otherwise, in some good times, once the connection established and uart was still working, everything still fine while connection status. I still able to sent and received data from nrf51822.

And this is only happened after connection or bond. I still very new in this so I don't know what is the conditions for connection as well as bond? I wonder if there is any special conditions for connection and bond which interrupts this process? And what should I do in this situation.

P.s: In my application I also use Peer Manage, Scheduler, UART_FIFO and FDS.

  • Hi Dat,

    Did you use HWFC ? 

    When you using nRF51 there is maximum 6ms of latency cause by the softdevice in worse case. So HWFC is recommended if you don't want missing byte. 

    What do you mean by "The nrf51822 still be able to send and receive uart signals in the uart lines however, uart module is not receive any byte." ? You mean you find that in the hardware UART buffer of the nRF51, you still see the data coming in ? but not with the module ? 

    Could you try to test with the ble_app_uart example to see if it has the same issue ?  Which Softdevice did you use ? 

  • Thank you for your response.

    I am not using HWFC. I will try it now. But I do applied Scheduler module to this uart interrupt and many others. Is that a problem?

    What do you mean by "The nrf51822 still be able to send and receive uart signals in the uart lines however, uart module is not receive any byte." ? You mean you find that in the hardware UART buffer of the nRF51, you still see the data coming in ? but not with the module ? 

    I mean in the physical line RX, I still can see the data signals by using oscillo scope. However, the uart_handler interrupt only return  APP_UART_TX_EMPTY. In the normal case, it will return APP_UART_DATA_READY. I used UART with FIFO.

    I used s130_nrf51_2.0.0_softdevice.hex in sdk11.

  • I found out that when I disable scheduler module in uart interrupt then it works fine. But I don't know why is that? Is there any special interrupts that scheduler module can not work with? Actually without the connecting to phone part, the scheduler with this uart interrupt still works fine.

  • Could you post the code in the UART interrupt ? And the part that you need to comment out ? 

Related