Skip to content

Commit 72abe51

Browse files
Naveen KajeNaveen Kaje
authored andcommitted
NRF52: setup the UART_RTS pin during startup to enable console RX
While investigating the RX issue on NRF52_DK after SDK 14 updates, it is observed that the RX FIFO doesn't get filled up, when the flow control is disabled. Hence the readable never returns true. If using Serial interface, the stdio file handles (0, 1, 2) get opened. This results in configuring the flow control for STDIO, and it is observed that the RX FIFO gets filled. However, if RawSerial is used, the STDIO file handles don't get opened. During the debug process it was observed that if the flow control is configured once and then set to disabled, RX worked as expected. Alternative to this approach is that user application specifically enables flow control as done in mbed's Greentea test suite. See https://goo.gl/r8nBYH See https://goo.gl/8VB2qg step 14 for _initio's description. See test code to reproduce the issue and test fix here: https://goo.gl/AQU1xG Description The change in behavior with NRF52's UART RX is documented here. #6891 This change is a fix for the above issue.
1 parent 8b62315 commit 72abe51

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#include "nrf.h"
4040
#include "cmsis_nvic.h"
4141
#include "stdint.h"
42+
#include "PinNames.h"
43+
#include "hal/gpio_api.h"
4244

4345
#if defined(SOFTDEVICE_PRESENT)
4446
#include "nrf_sdm.h"
@@ -110,3 +112,11 @@ void nrf_reloc_vector_table(void)
110112
SCB->VTOR = (uint32_t) nrf_dispatch_vector;
111113
#endif
112114
}
115+
116+
void mbed_sdk_init(void)
117+
{
118+
gpio_t rts;
119+
gpio_init_out(&rts, STDIO_UART_RTS);
120+
/* Set STDIO_UART_RTS as gpio driven low */
121+
gpio_write(&rts, 0);
122+
}

0 commit comments

Comments
 (0)