Skip to content

Commit 32b77fb

Browse files
committed
Use NRF_LF_SRC_SYNTH as 32k clock source
Nina 01B ship without the 32k onboard and are otherwise indistinguishable from 00B modules. Don't merge this patch before running extensive tests on low power and BLE performance. We can use the bootloader glitch (NRF_CLOCK_INT_LF_STARTED interrupt enabled and firing as soon as the USB starts, fixed in variant.cpp) to discriminate the boards if really needed.
1 parent 1da4e66 commit 32b77fb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

variants/ARDUINO_NANO33BLE/conf/mbed_app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
],
66
"target_overrides": {
77
"*": {
8+
"target.lf_clock_src":"NRF_LF_SRC_SYNTH",
89
"target.printf_lib": "std",
910
"platform.stdio-buffered-serial": false,
1011
"platform.stdio-baud-rate": 115200,

variants/ARDUINO_NANO33BLE/variant.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,18 @@ extern "C" {
135135
#include "nrf_rtc.h"
136136
#include "nrf_uarte.h"
137137
#include "nrf_uart.h"
138+
#include "nrf_clock.h"
138139

139140
void initVariant() {
140141
// turn power LED on
141142
pinMode(LED_PWR, OUTPUT);
142143
digitalWrite(LED_PWR, HIGH);
143144

145+
if (nrf_clock_int_enable_check(NRF_CLOCK_INT_LF_STARTED_MASK)) {
146+
// NINA B306 01B modules (without 32k xtal)
147+
nrf_clock_int_disable(NRF_CLOCK_INT_LF_STARTED_MASK);
148+
}
149+
144150
// Errata Nano33BLE - I2C pullup is controlled by the SWO pin.
145151
// Configure the TRACEMUX to disable routing SWO signal to pin.
146152
NRF_CLOCK->TRACECONFIG = 0;

0 commit comments

Comments
 (0)