Skip to content

Commit 3645e81

Browse files
authored
Merge pull request #9347 from applecuckoo/applecuckoo-nano-33-ble
New board version: Nano 33 BLE Sense Rev2
2 parents 9b23460 + 59954cf commit 3645e81

File tree

8 files changed

+181
-9
lines changed

8 files changed

+181
-9
lines changed

ports/nordic/boards/arduino_nano_33_ble/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Arduino Nano 33 BLE and Nano 33 BLE Sense
22

3-
The [Arduino Nano 33 BLE](https://store.arduino.cc/usa/nano-33-ble-with-headers) and
4-
[Arduino Nano 33 BLE Sense](https://store.arduino.cc/usa/nano-33-ble-sense) and
5-
are built around the NINA B306 module, based on Nordic nRF 52840 and containing
6-
a powerful Cortex M4F. Both include an onboard 9 axis Inertial Measurement Unit (IMU), the LSM9DS1.
7-
The Nano 33 BLE Sense adds an LPS22HB barometric pressure and temperature sensor,
8-
an ADPS-9960 digital proximity, ambient light, RGB, and gensture sensor,
3+
The [Arduino Nano 33 BLE](https://store.arduino.cc/usa/nano-33-ble) and
4+
[Arduino Nano 33 BLE Sense](https://store.arduino.cc/usa/nano-33-ble-sense)
5+
are built around the NINA-B306 module, based on the Nordic nRF52840 and containing
6+
a powerful Cortex-M4F. Both include an onboard 9-axis Inertial Measurement Unit (IMU), the LSM9DS1.
7+
The Nano 33 BLE Sense adds an LPS22HB barometric pressure and temperature sensor, an HTS221 humidity sensor,
8+
an APDS-9960 digital proximity, ambient light, RGB, and gesture sensor,
99
and an MP34DT05 digital microphone.
1010

1111
Note: the Arduino Nano 33 BLE and BLE Sense do not include a QSPI external
@@ -15,11 +15,11 @@ filesystem.
1515
I2C pins `board.SCL1` and `board.SDA1` are not exposed and are used for onboard peripherals.
1616
Pin `board.R_PULLUP` must be set to high to enable the `SCL1` and `SDA1` pullups for proper operation.
1717

18-
Pin `board.VDD_ENV` applies power to the LSM9DS1, and must be high for it to be operational.
18+
Pin `board.VDD_ENV` applies power to the LSM9DS1, the LPS22HB, and the HTS221, and must be high for them to be operational.
1919

2020
Pins `board.MIC_PWR`, `board.PDMDIN`, and `board.PDMCLK` are for the Nano 33 BLE Sense onboard microphone.
2121

22-
Pin `board.INT_ADPS` is the interrupt pin from the ADPS-9960.
22+
Pin `board.INT_APDS` is the interrupt pin from the APDS-9960.
2323

2424
Pins `board.RGB_LED_R`, `board.RGB_LED_G`, and `board.RGB_LED_B`
2525
are the red, green and blue LEDS in the onboard RGB LED.

ports/nordic/boards/arduino_nano_33_ble/pins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
4848
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_G), MP_ROM_PTR(&pin_P0_16) },
4949
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_B), MP_ROM_PTR(&pin_P0_06) },
5050

51-
// Power line to LSM9DS1.
51+
// Power line to LSM9DS1, LPS22 and HTS221.
5252
{ MP_ROM_QSTR(MP_QSTR_VDD_ENV), MP_ROM_PTR(&pin_P0_22) },
5353

5454
// Pullup voltage for SDA1 and SCL1
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Arduino Nano 33 BLE Rev2 and Nano 33 BLE Sense Rev2
2+
3+
The [Arduino Nano 33 BLE Rev2](https://store.arduino.cc/usa/nano-33-ble-rev2) and
4+
[Arduino Nano 33 BLE Sense Rev2](https://store.arduino.cc/usa/nano-33-ble-sense-rev2)
5+
are built around the NINA-B306 module, based on the Nordic nRF52840 and containing
6+
a powerful Cortex-M4F. Both include an onboard 9-axis Inertial Measurement Unit (IMU), made up of the BMI270 6-axis IMU and the BMM150 3-axis magnetometer.
7+
The Nano 33 BLE Sense Rev2 adds an LPS22HB barometric pressure and temperature sensor, an HS3003 humidity sensor,
8+
an APDS-9960 digital proximity, ambient light, RGB, and gesture sensor,
9+
and an MP34DT06JTR digital microphone.
10+
11+
Note: the Arduino Nano 33 BLE Rev2 and BLE Sense Rev2 do not include a QSPI external
12+
flash. Any Python code will need to be stored on the internal flash
13+
filesystem.
14+
15+
I2C pins `board.SCL1` and `board.SDA1` are not exposed and are used for onboard peripherals.
16+
Pin `board.R_PULLUP` must be set to high to enable the `SCL1` and `SDA1` pullups for proper operation.
17+
18+
Pin `board.VDD_ENV` applies power to the BMI270, the BMM150, the LPS22HB and the HS3003, and must be high for them to be operational.
19+
20+
Pins `board.MIC_PWR`, `board.PDMDIN`, and `board.PDMCLK` are for the Nano 33 BLE Sense onboard microphone.
21+
22+
Pin `board.INT_APDS` is the interrupt pin from the APDS-9960.
23+
24+
Pins `board.INT_BMI_1` and `board.INT_BMI_2` are the two interrupt pins from the BMI270.
25+
26+
Pin `board.INT_LPS` is the interrupt pin from the LPS22.
27+
28+
Pins `board.RGB_LED_R`, `board.RGB_LED_G`, and `board.RGB_LED_B`
29+
are the red, green and blue LEDS in the onboard RGB LED.
30+
31+
Pins `board.LED_G` and `board.LED_Y` are onboard green and red LEDs. `board.LED_Y` is also `board.SCK`.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "supervisor/board.h"
8+
#include "nrf.h"
9+
#include "nrf_rtc.h"
10+
11+
void board_init(void) {
12+
// Initializations below from Arduino variant.cpp.
13+
14+
// // turn power LED on
15+
// pinMode(LED_PWR, OUTPUT);
16+
// digitalWrite(LED_PWR, HIGH);
17+
18+
// Errata Nano33BLE - I2C pullup is on SWO line, need to disable TRACE
19+
// was being enabled by nrfx_clock_anomaly_132
20+
CoreDebug->DEMCR = 0;
21+
NRF_CLOCK->TRACECONFIG = 0;
22+
23+
// FIXME: bootloader enables interrupt on COMPARE[0], which we don't handle
24+
// Disable it here to avoid getting stuck when OVERFLOW irq is triggered
25+
nrf_rtc_event_disable(NRF_RTC1, NRF_RTC_INT_COMPARE0_MASK);
26+
nrf_rtc_int_disable(NRF_RTC1, NRF_RTC_INT_COMPARE0_MASK);
27+
28+
// // FIXME: always enable I2C pullup and power @startup
29+
// // Change for maximum powersave
30+
// pinMode(PIN_ENABLE_SENSORS_3V3, OUTPUT);
31+
// pinMode(PIN_ENABLE_I2C_PULLUP, OUTPUT);
32+
33+
// digitalWrite(PIN_ENABLE_SENSORS_3V3, HIGH);
34+
// digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH);
35+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#pragma once
8+
9+
#include "nrfx/hal/nrf_gpio.h"
10+
11+
#define MICROPY_HW_BOARD_NAME "Arduino Nano 33 BLE Rev2"
12+
#define MICROPY_HW_MCU_NAME "nRF52840"
13+
14+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_02)
15+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_31)
16+
17+
#define DEFAULT_SPI_BUS_SCK (&pin_P0_13)
18+
#define DEFAULT_SPI_BUS_MOSI (&pin_P0_01)
19+
#define DEFAULT_SPI_BUS_MISO (&pin_P1_08)
20+
21+
#define DEFAULT_UART_BUS_RX (&pin_P1_10)
22+
#define DEFAULT_UART_BUS_TX (&pin_P1_03)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
USB_VID = 0x2341
2+
USB_PID = 0x805A
3+
USB_PRODUCT = "Arduino_Nano_33_BLE"
4+
USB_MANUFACTURER = "Arduino"
5+
6+
MCU_CHIP = nrf52840
7+
8+
INTERNAL_FLASH_FILESYSTEM = 1
9+
CIRCUITPY_ULAB = 0
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "shared-bindings/board/__init__.h"
8+
9+
static const mp_rom_map_elem_t board_module_globals_table[] = {
10+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
11+
12+
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P1_11) },
13+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_12) },
14+
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_15) },
15+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_13) },
16+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_14) },
17+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_23) },
18+
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_21) },
19+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_27) },
20+
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P1_02) },
21+
22+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) },
23+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) },
24+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) },
25+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_29) },
26+
27+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_31) },
28+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_31) },
29+
30+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_02) },
31+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_02) },
32+
33+
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_28) },
34+
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_03) },
35+
36+
{ MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_P0_14) },
37+
{ MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_P0_15) },
38+
39+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P1_01) },
40+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_08) },
41+
42+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_13) },
43+
{ MP_ROM_QSTR(MP_QSTR_LED_Y), MP_ROM_PTR(&pin_P0_13) },
44+
45+
{ MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P1_09) },
46+
47+
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_R), MP_ROM_PTR(&pin_P0_24) },
48+
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_G), MP_ROM_PTR(&pin_P0_16) },
49+
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_B), MP_ROM_PTR(&pin_P0_06) },
50+
51+
// Power line to IMU, pressure, temperature and humidity sensors.
52+
{ MP_ROM_QSTR(MP_QSTR_VDD_ENV), MP_ROM_PTR(&pin_P0_22) },
53+
54+
// Pullup voltage for SDA1 and SCL1
55+
{ MP_ROM_QSTR(MP_QSTR_R_PULLUP), MP_ROM_PTR(&pin_P1_00) },
56+
57+
{ MP_ROM_QSTR(MP_QSTR_MIC_PWR), MP_ROM_PTR(&pin_P0_17) },
58+
{ MP_ROM_QSTR(MP_QSTR_PDMCLK), MP_ROM_PTR(&pin_P0_26) },
59+
{ MP_ROM_QSTR(MP_QSTR_PDMDIN), MP_ROM_PTR(&pin_P0_25) },
60+
61+
{ MP_ROM_QSTR(MP_QSTR_INT_APDS), MP_ROM_PTR(&pin_P0_19) },
62+
{ MP_ROM_QSTR(MP_QSTR_INT_BMI_1), MP_ROM_PTR(&pin_P0_11) },
63+
{ MP_ROM_QSTR(MP_QSTR_INT_BMI_2), MP_ROM_PTR(&pin_P0_20) },
64+
{ MP_ROM_QSTR(MP_QSTR_INT_LPS), MP_ROM_PTR(&pin_P0_12) },
65+
66+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P1_03) },
67+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P1_10) },
68+
69+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
70+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
71+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
72+
};
73+
74+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

tools/ci_check_duplicate_usb_vid_pid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"0x303A:0x8166": ["yd_esp32_s3_n8r8", "yd_esp32_s3_n16r8"],
6767
"0x2341:0x056B": ["arduino_nano_esp32s3", "arduino_nano_esp32s3_inverted_statusled"],
6868
"0x2E8A:0x1020": ["waveshare_rp2040_plus_4mb", "waveshare_rp2040_plus_16mb"],
69+
"0x2341:0x805A": ["arduino_nano_33_ble", "arduino_nano_33_ble_rev2"],
6970
}
7071

7172
cli_parser = argparse.ArgumentParser(

0 commit comments

Comments
 (0)