Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions variants/ARDUINO_NANO33BLE/conf/mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
],
"target_overrides": {
"*": {
"target.lf_clock_src":"NRF_LF_SRC_SYNTH",
"target.printf_lib": "std",
"platform.stdio-buffered-serial": false,
"platform.stdio-baud-rate": 115200,
Expand Down
16 changes: 12 additions & 4 deletions variants/ARDUINO_NANO33BLE/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,18 @@ extern "C" {
#include "nrf_rtc.h"
#include "nrf_uarte.h"
#include "nrf_uart.h"
#include "nrf_clock.h"

void initVariant() {
// turn power LED on
pinMode(LED_PWR, OUTPUT);
digitalWrite(LED_PWR, HIGH);

if (nrf_clock_int_enable_check(NRF_CLOCK_INT_LF_STARTED_MASK)) {
// NINA B306 01B modules (without 32k xtal)
nrf_clock_int_disable(NRF_CLOCK_INT_LF_STARTED_MASK);
}

// Errata Nano33BLE - I2C pullup is controlled by the SWO pin.
// Configure the TRACEMUX to disable routing SWO signal to pin.
NRF_CLOCK->TRACECONFIG = 0;
Expand All @@ -159,10 +165,12 @@ void initVariant() {
digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH);

// Disable UARTE0 which is initially enabled by the bootloader
nrf_uarte_task_trigger(NRF_UARTE0, NRF_UARTE_TASK_STOPRX);
while (!nrf_uarte_event_check(NRF_UARTE0, NRF_UARTE_EVENT_RXTO)) ;
NRF_UARTE0->ENABLE = 0;
NRF_UART0->ENABLE = 0;
if (nrf_uarte_event_check(NRF_UARTE0, NRF_UARTE_EVENT_RXTO)) {
nrf_uarte_task_trigger(NRF_UARTE0, NRF_UARTE_TASK_STOPRX);
while (!nrf_uarte_event_check(NRF_UARTE0, NRF_UARTE_EVENT_RXTO));
NRF_UARTE0->ENABLE = 0;
NRF_UART0->ENABLE = 0;
}

NRF_PWM_Type* PWM[] = {
NRF_PWM0, NRF_PWM1, NRF_PWM2
Expand Down