Skip to content

Commit 420d66d

Browse files
committed
Nano33ble: UARTE0 and UART0 disabled in variant
UARTE0 and UART0 are initially enabled by the bootloader.
1 parent 7a20033 commit 420d66d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

variants/ARDUINO_NANO33BLE/variant.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ extern "C" {
132132
}
133133

134134
#include "nrf_rtc.h"
135+
#include "nrf_uarte.h"
136+
#include "nrf_uart.h"
135137

136138
void initVariant() {
137139
// turn power LED on
@@ -155,7 +157,13 @@ void initVariant() {
155157

156158
digitalWrite(PIN_ENABLE_SENSORS_3V3, HIGH);
157159
digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH);
158-
160+
161+
// Disable UARTE0 which is initially enabled by the bootloader
162+
nrf_uarte_task_trigger(NRF_UARTE0, NRF_UARTE_TASK_STOPRX);
163+
while (!nrf_uarte_event_check(NRF_UARTE0, NRF_UARTE_EVENT_RXTO)) ;
164+
NRF_UARTE0->ENABLE = 0;
165+
NRF_UART0->ENABLE = 0;
166+
159167
NRF_PWM_Type* PWM[] = {
160168
NRF_PWM0, NRF_PWM1, NRF_PWM2
161169
#ifdef NRF_PWM3

0 commit comments

Comments
 (0)