Hi Nordic team,
I have a curious problem I need a little help with:
(NRF52840 & SDK 15.3)
I have a project which is an integration of the ble_uart example and the serial_uartes example. I've removed all references to the older app_uart functions in the ble code and instead use the newer nrf_serial library to configure both UARTEs as follows:
UARTE0: DMA, priority 6, flow control disabled, 9600 baud, RX on P0.13, TX on P0.15 (connected to a GPS device)
UARTE1: DMA, priority 6, flow control disabled, 115200 baud, RX on P0.29, TX on P0.31 (connected to a PC)
NRF_LOGGING is disabled so that I can send my own debug to UARTE1.
After programming or soft-reset, everything works fine - the GPS device gets configured correctly by commands sent to it on UARTE0, and data is received and decoded properly from it. Debug messages are sent to UARTE1 correctly, and I can also send debug strings from my PC via UARTE1 and have them sent over ble to my phone. All hunky dory.
The problem arises when I power-cycle the board: UARTE0 stops receiving characters from the GPS, i.e. the RX_DATA event never fires. I know that the GPS is sending them, and I know that it has been configured correctly, so UARTE0 Tx seems fine. UARTE1 also works fine in both directions. It is just UARTE0 RX that fails. I have tried swapping over the instances of the 2 UARTEs but it makes no difference. The only thing I can't change is the pin config: GPS data comes in on P0.13. If I disable the ble code, so that the project behaves more or less like the serial_uartes example, then the problem seems to go away, and I can power cycle the board without problems. So it seems to be something to do with initialising the ble stack, I think.