Skip to content

Commit e9ab999

Browse files
benjaminbjornssonMaureenHelm
authored andcommitted
boards: arm: arduino_nano_33_ble: Add support for sense version of board
This commit adds support for the Arduino Nano 33 BLE Sense board. The DTS is separated into a common dtsi and one DTS for each version of the board. The sensors with existing drivers: hts221, lps22hb and apds9960 are added to the DTS of the Sense version. A startup delay is added to the vdd_env node. This is done to give some time for the sensors VDD/VCC to go high before the sensor drivers are initialized. The functionality was verified using the driver sample of each sensor. Signed-off-by: Benjamin Björnsson <[email protected]>
1 parent 0c23a02 commit e9ab999

9 files changed

+242
-142
lines changed

boards/arm/arduino_nano_33_ble/Kconfig.board

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
config BOARD_ARDUINO_NANO_33_BLE
55
bool "Arduino Nano 33 BLE board"
66
depends on SOC_NRF52840_QIAA
7+
8+
config BOARD_ARDUINO_NANO_33_BLE_SENSE
9+
bool "Arduino Nano 33 BLE Sense board"
10+
depends on SOC_NRF52840_QIAA
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Copyright (c) 2020 Jefferson Lee.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if BOARD_ARDUINO_NANO_33_BLE
4+
if BOARD_ARDUINO_NANO_33_BLE || BOARD_ARDUINO_NANO_33_BLE_SENSE
55

66
config BOARD
7-
default "arduino_nano_33_ble"
7+
default "arduino_nano_33_ble" if BOARD_ARDUINO_NANO_33_BLE
8+
default "arduino_nano_33_ble_sense" if BOARD_ARDUINO_NANO_33_BLE_SENSE
89

910
config BT_CTLR
1011
default BT
1112

1213
config REGULATOR
1314
default y if SENSOR
1415

15-
endif # BOARD_ARDUINO_NANO_33_BLE
16+
endif # BOARD_ARDUINO_NANO_33_BLE || BOARD_ARDUINO_NANO_33_BLE_SENSE
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/*
2+
* Copyright (c) 2020 Jefferson Lee
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,console = &uart0;
10+
zephyr,shell-uart = &uart0;
11+
zephyr,uart-mcumgr = &uart0;
12+
zephyr,bt-mon-uart = &uart0;
13+
zephyr,bt-c2h-uart = &uart0;
14+
zephyr,sram = &sram0;
15+
zephyr,flash = &flash0;
16+
zephyr,code-partition = &code_partition;
17+
};
18+
19+
leds {
20+
compatible = "gpio-leds";
21+
led0: led_0 {
22+
gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
23+
label = "Red LED";
24+
};
25+
led1: led_1 {
26+
gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
27+
label = "Green LED";
28+
};
29+
led2: led_2 {
30+
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
31+
label = "Blue LED";
32+
};
33+
led4: led_4 {
34+
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
35+
label = "User LED";
36+
};
37+
};
38+
39+
vdd_env: vdd-env {
40+
compatible = "regulator-fixed";
41+
label = "vdd_env";
42+
regulator-name = "vdd_env";
43+
enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
44+
regulator-boot-on;
45+
startup-delay-us = <5000>;
46+
};
47+
48+
zephyr,user {
49+
/* I2C pull-ups are connected to VDD via pin voltage level */
50+
pull-up-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
51+
};
52+
53+
/* These aliases are provided for compatibility with samples */
54+
aliases {
55+
led0 = &led0;
56+
led1 = &led1;
57+
led2 = &led2;
58+
led4 = &led4;
59+
spi = &spi2;
60+
};
61+
};
62+
63+
&flash0 {
64+
partitions {
65+
compatible = "fixed-partitions";
66+
#address-cells = <1>;
67+
#size-cells = <1>;
68+
69+
boot_partition: partition@0 {
70+
label = "sam-ba";
71+
reg = <0x00000000 0x00010000>;
72+
read-only;
73+
};
74+
75+
code_partition: partition@10000 {
76+
label = "code";
77+
reg = <0x00010000 0x000e8000>;
78+
read-only;
79+
};
80+
81+
/*
82+
* The flash starting at 0x000f8000 and ending at
83+
* 0x000fffff is reserved for use by the application.
84+
*
85+
* Storage partition will be used by FCB/LittleFS/NVS
86+
* if enabled.
87+
*/
88+
storage_partition: partition@f8000 {
89+
label = "storage";
90+
reg = <0x000f8000 0x00008000>;
91+
};
92+
};
93+
};
94+
95+
&adc {
96+
status = "okay";
97+
};
98+
99+
&uart0 {
100+
compatible = "nordic,nrf-uart";
101+
current-speed = <115200>;
102+
status = "okay";
103+
pinctrl-0 = <&uart0_default>;
104+
pinctrl-1 = <&uart0_sleep>;
105+
pinctrl-names = "default", "sleep";
106+
};
107+
108+
arduino_i2c: &i2c0 {
109+
compatible = "nordic,nrf-twim";
110+
status = "okay";
111+
pinctrl-0 = <&i2c0_default>;
112+
pinctrl-1 = <&i2c0_sleep>;
113+
pinctrl-names = "default", "sleep";
114+
};
115+
116+
&i2c1 {
117+
compatible = "nordic,nrf-twim";
118+
status = "okay";
119+
pinctrl-0 = <&i2c1_default>;
120+
pinctrl-1 = <&i2c1_sleep>;
121+
pinctrl-names = "default", "sleep";
122+
};
123+
124+
/* SPI2 is used because SPI1/0 shares conflicts with I2C1/0 */
125+
arduino_spi: &spi2 {
126+
compatible = "nordic,nrf-spim";
127+
status = "okay";
128+
pinctrl-0 = <&spi2_default>;
129+
pinctrl-1 = <&spi2_sleep>;
130+
pinctrl-names = "default", "sleep";
131+
};
132+
133+
&gpio0 {
134+
status = "okay";
135+
};
136+
137+
&gpio1 {
138+
status = "okay";
139+
};
140+
141+
zephyr_udc0: &usbd {
142+
compatible = "nordic,nrf-usbd";
143+
status = "okay";
144+
};

boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts

Lines changed: 2 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -5,146 +5,11 @@
55
*/
66
/dts-v1/;
77
#include <nordic/nrf52840_qiaa.dtsi>
8+
#include "arduino_nano_33_ble-common.dtsi"
89
#include "arduino_nano_33_ble-pinctrl.dtsi"
910
#include "arduino_nano_r3_connector.dtsi"
1011

1112
/ {
12-
model = "Arduino Nano 33 BLE (Sense)";
13+
model = "Arduino Nano 33 BLE";
1314
compatible = "arduino,arduino_nano_33_ble";
14-
15-
chosen {
16-
zephyr,console = &uart0;
17-
zephyr,shell-uart = &uart0;
18-
zephyr,uart-mcumgr = &uart0;
19-
zephyr,bt-mon-uart = &uart0;
20-
zephyr,bt-c2h-uart = &uart0;
21-
zephyr,sram = &sram0;
22-
zephyr,flash = &flash0;
23-
zephyr,code-partition = &code_partition;
24-
};
25-
26-
leds {
27-
compatible = "gpio-leds";
28-
led0: led_0 {
29-
gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
30-
label = "Red LED";
31-
};
32-
led1: led_1 {
33-
gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
34-
label = "Green LED";
35-
};
36-
led2: led_2 {
37-
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
38-
label = "Blue LED";
39-
};
40-
led4: led_4 {
41-
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
42-
label = "User LED";
43-
};
44-
};
45-
46-
vdd_env: vdd-env {
47-
compatible = "regulator-fixed-sync", "regulator-fixed";
48-
label = "vdd_env";
49-
regulator-name = "vdd_env";
50-
enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
51-
regulator-boot-on;
52-
};
53-
54-
zephyr,user {
55-
/* I2C pull-ups are connected to VDD via pin voltage level */
56-
pull-up-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
57-
};
58-
59-
/* These aliases are provided for compatibility with samples */
60-
aliases {
61-
led0 = &led0;
62-
led1 = &led1;
63-
led2 = &led2;
64-
led4 = &led4;
65-
spi = &spi2;
66-
};
67-
};
68-
69-
&flash0 {
70-
partitions {
71-
compatible = "fixed-partitions";
72-
#address-cells = <1>;
73-
#size-cells = <1>;
74-
75-
boot_partition: partition@0 {
76-
label = "sam-ba";
77-
reg = <0x00000000 0x00010000>;
78-
read-only;
79-
};
80-
81-
code_partition: partition@10000 {
82-
label = "code";
83-
reg = <0x00010000 0x000e8000>;
84-
read-only;
85-
};
86-
87-
/*
88-
* The flash starting at 0x000f8000 and ending at
89-
* 0x000fffff is reserved for use by the application.
90-
*
91-
* Storage partition will be used by FCB/LittleFS/NVS
92-
* if enabled.
93-
*/
94-
storage_partition: partition@f8000 {
95-
label = "storage";
96-
reg = <0x000f8000 0x00008000>;
97-
};
98-
};
99-
};
100-
101-
&adc {
102-
status = "okay";
103-
};
104-
105-
&uart0 {
106-
compatible = "nordic,nrf-uart";
107-
current-speed = <115200>;
108-
status = "okay";
109-
pinctrl-0 = <&uart0_default>;
110-
pinctrl-1 = <&uart0_sleep>;
111-
pinctrl-names = "default", "sleep";
112-
};
113-
114-
arduino_i2c: &i2c0 {
115-
compatible = "nordic,nrf-twim";
116-
status = "okay";
117-
pinctrl-0 = <&i2c0_default>;
118-
pinctrl-1 = <&i2c0_sleep>;
119-
pinctrl-names = "default", "sleep";
120-
};
121-
122-
&i2c1 {
123-
compatible = "nordic,nrf-twim";
124-
status = "okay";
125-
pinctrl-0 = <&i2c1_default>;
126-
pinctrl-1 = <&i2c1_sleep>;
127-
pinctrl-names = "default", "sleep";
128-
};
129-
130-
/* SPI2 is used because SPI1/0 shares conflicts with I2C1/0 */
131-
arduino_spi: &spi2 {
132-
compatible = "nordic,nrf-spim";
133-
status = "okay";
134-
pinctrl-0 = <&spi2_default>;
135-
pinctrl-1 = <&spi2_sleep>;
136-
pinctrl-names = "default", "sleep";
137-
};
138-
139-
&gpio0 {
140-
status = "okay";
141-
};
142-
143-
&gpio1 {
144-
status = "okay";
145-
};
146-
147-
zephyr_udc0: &usbd {
148-
compatible = "nordic,nrf-usbd";
149-
status = "okay";
15015
};

boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
identifier: arduino_nano_33_ble
2-
name: Arduino Nano 33 BLE (Sense)
2+
name: Arduino Nano 33 BLE
33
type: mcu
44
arch: arm
55
toolchain:
@@ -17,4 +17,4 @@ supported:
1717
- uart
1818
- usb_cdc
1919
- usb_device
20-
- watchdog
20+
- watchdog
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2020 Jefferson Lee
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/dts-v1/;
7+
#include <nordic/nrf52840_qiaa.dtsi>
8+
#include "arduino_nano_33_ble-common.dtsi"
9+
#include "arduino_nano_33_ble-pinctrl.dtsi"
10+
#include "arduino_nano_r3_connector.dtsi"
11+
12+
/ {
13+
model = "Arduino Nano 33 BLE Sense";
14+
compatible = "arduino,arduino_nano_33_ble_sense";
15+
};
16+
17+
&i2c1 {
18+
hts221: hts221@5f {
19+
compatible = "st,hts221";
20+
status = "okay";
21+
reg = <0x5f>;
22+
label = "HTS221";
23+
};
24+
25+
lps22hb: lps22hb-press@5c {
26+
compatible = "st,lps22hb-press";
27+
status = "okay";
28+
reg = <0x5c>;
29+
label = "LPS22HB";
30+
};
31+
32+
apds9960: apds9960@39 {
33+
compatible = "avago,apds9960";
34+
status = "okay";
35+
reg = <0x39>;
36+
label = "APDS9960";
37+
int-gpios = <&gpio0 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
38+
};
39+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
identifier: arduino_nano_33_ble_sense
2+
name: Arduino Nano 33 BLE Sense
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
supported:
10+
- adc
11+
- ble
12+
- i2c
13+
- ieee802154
14+
- pwm
15+
- serial
16+
- spi
17+
- uart
18+
- usb_cdc
19+
- usb_device
20+
- watchdog

0 commit comments

Comments
 (0)