We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 764cdcf commit 6f31229Copy full SHA for 6f31229
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c
@@ -1009,6 +1009,21 @@ void serial_free(serial_t *obj)
1009
if (nordic_nrf5_uart_state[instance].usage_counter == 0) {
1010
1011
nrf_uarte_disable(nordic_nrf5_uart_register[instance]);
1012
+
1013
+ /* Turn NRF_UARTE0_BASE or NRF_UARTE1_BASE power off and on to reset peripheral. */
1014
+ if (instance == 0) {
1015
+ *(volatile uint32_t *)0x40002FFC = 0;
1016
+ *(volatile uint32_t *)0x40002FFC;
1017
+ *(volatile uint32_t *)0x40002FFC = 1;
1018
+ }
1019
+#if UART1_ENABLED
1020
+ else {
1021
+ *(volatile uint32_t *)0x40028FFC = 0;
1022
+ *(volatile uint32_t *)0x40028FFC;
1023
+ *(volatile uint32_t *)0x40028FFC = 1;
1024
1025
+#endif
1026
1027
}
1028
1029
0 commit comments