Skip to content

Commit bdd2943

Browse files
soburidani-clopillo79facchinmmjs513
committed
variants: import Nano 33 BLE Sense updates from 0.55.0
Bring in the Nano 33 BLE Sense variant changes from the 0.55.0 delta, including board configuration, extended pin mappings, peripheral setup, sensor power initialization, and example skip metadata. USB has not yet been implemented in this repository, cdc_acm_uart is disabled. Co-authored-by: Daniele Cloralio <d.cloralio@arduino.cc> Co-authored-by: Luca Burelli <l.burelli@arduino.cc> Co-authored-by: Martino Facchin <m.facchin@arduino.cc> Co-authored-by: Mike S <CyberMerln@gmail.com> Co-authored-by: bogdanf132 <bogdan_ivanus@yahoo.com> Co-authored-by: pennam <m.pennasilico@arduino.cc> Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent 53abfbc commit bdd2943

5 files changed

Lines changed: 216 additions & 18 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright (c) Arduino s.r.l. and/or its affiliated companies
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_BT=y
5+
CONFIG_BT_HCI_RAW=y
6+
CONFIG_BT_HCI_RAW_H4=y
7+
CONFIG_BT_HCI_RAW_H4_ENABLE=y
8+
CONFIG_BT_BUF_ACL_RX_SIZE=255
9+
CONFIG_BT_BUF_CMD_TX_SIZE=255
10+
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
11+
CONFIG_BT_MAX_CONN=4
12+
CONFIG_BT_CTLR_ADV_EXT=y
13+
CONFIG_BT_CTLR_ADV_PERIODIC=y
14+
CONFIG_BT_RX_STACK_SIZE=4096
15+
16+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
17+
18+
CONFIG_USB_DEVICE_STACK=y
19+
CONFIG_USB_DEVICE_PRODUCT="Arduino Nano 33 BLE"
20+
CONFIG_USB_DEVICE_MANUFACTURER="Arduino"
21+
CONFIG_USB_DEVICE_VID=0x2341
22+
CONFIG_USB_DEVICE_PID=0x035A
23+
24+
CONFIG_USB_CDC_ACM=y
25+
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=1024
26+
CONFIG_UART_LINE_CTRL=y
27+
CONFIG_CDC_ACM_DTE_RATE_CALLBACK_SUPPORT=y
28+
29+
CONFIG_LOG_BACKEND_UART=y
30+
CONFIG_LOG_BACKEND_UART_AUTOSTART=n
31+
CONFIG_LOG_DEFAULT_LEVEL=2
32+
33+
CONFIG_ADC=y
34+
CONFIG_PWM=y
35+
CONFIG_COUNTER=y
36+
37+
CONFIG_LLEXT_STORAGE_WRITABLE=n
38+
CONFIG_HEAP_MEM_POOL_SIZE=16384
39+
CONFIG_LLEXT_HEAP_SIZE=128
40+
CONFIG_MAIN_STACK_SIZE=16384
41+
42+
CONFIG_FPU=y
43+
44+
CONFIG_STACK_USAGE=n
45+
CONFIG_STACK_SENTINEL=n
46+
CONFIG_STACK_CANARIES=n

variants/arduino_nano_33_ble_nrf52840_sense/arduino_nano_33_ble_nrf52840_sense.overlay

Lines changed: 117 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,69 @@
1+
/*
2+
* Copyright (c) Arduino s.r.l. and/or its affiliated companies
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
//&zephyr_udc0 {
8+
// board_cdc_acm_uart: board_cdc_acm_uart {
9+
// compatible = "zephyr,cdc-acm-uart";
10+
// status = "okay";
11+
// };
12+
//};
13+
14+
&flash0 {
15+
partitions {
16+
compatible = "fixed-partitions";
17+
#address-cells = <1>;
18+
#size-cells = <1>;
19+
20+
boot_partition: partition@0 {
21+
label = "sam-ba";
22+
reg = <0x00000000 0x00010000>;
23+
read-only;
24+
};
25+
26+
code_partition: partition@10000 {
27+
label = "code";
28+
reg = <0x00010000 0x00060000>;
29+
read-only;
30+
};
31+
32+
user_sketch: partition@70000 {
33+
label = "user";
34+
reg = <0x070000 0x88000>;
35+
};
36+
37+
/*
38+
* The flash starting at 0x000f8000 and ending at
39+
* 0x000fffff is reserved for use by the application.
40+
*
41+
* Storage partition will be used by FCB/LittleFS/NVS
42+
* if enabled.
43+
*/
44+
storage_partition: partition@f8000 {
45+
label = "storage";
46+
reg = <0x000f8000 0x00008000>;
47+
};
48+
};
49+
};
50+
51+
/{
52+
// chosen {
53+
// zephyr,log-uart = &log_uarts;
54+
// };
55+
//
56+
// log_uarts: log_uarts {
57+
// compatible = "zephyr,log-uart";
58+
// uarts = <&uart0 &board_cdc_acm_uart>;
59+
// };
60+
};
61+
62+
163
/ {
264
zephyr,user {
65+
pin-enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
66+
367
digital-pin-gpios = <&arduino_nano_header 0 0>,
468
<&arduino_nano_header 1 0>,
569
<&arduino_nano_header 2 0>,
@@ -21,7 +85,19 @@
2185
<&arduino_nano_header 18 0>, /* D18 / A4 / I2C-SDA */
2286
<&arduino_nano_header 19 0>, /* D19 / A5 / I2C-SCL */
2387
<&arduino_nano_header 20 0>,
24-
<&arduino_nano_header 21 0>;
88+
<&arduino_nano_header 21 0>,
89+
<&gpio0 24 0>, /* D22 LED R */
90+
<&gpio0 16 0>, /* D23 LED G */
91+
<&gpio0 6 0>, /* D24 LED B */
92+
<&gpio1 9 0>, /* D25 LED PWR */
93+
<&gpio0 19 0>, /* D26 INT APDS */
94+
<&gpio0 17 0>, /* D27 PDM PWR */
95+
<&gpio0 26 0>, /* D28 PDM CLK */
96+
<&gpio0 25 0>, /* D29 PDM DIN */
97+
<&gpio0 14 0>, /* D30 SDA2 */
98+
<&gpio0 15 0>, /* D31 SCL2 */
99+
<&gpio1 0 0>, /* D32 I2C_PULL */
100+
<&gpio0 22 0>; /* D33 VDD_ENV_ENABLE */
25101

26102
pwm-pin-gpios = <&arduino_nano_header 3 0>,
27103
<&arduino_nano_header 5 0>,
@@ -42,13 +118,13 @@
42118

43119
builtin-led-gpios = <&arduino_nano_header 13 0>;
44120

45-
pwms = <&pwm1 1 255 PWM_POLARITY_NORMAL>,
46-
<&pwm1 2 255 PWM_POLARITY_NORMAL>,
47-
<&pwm1 3 255 PWM_POLARITY_NORMAL>,
48-
<&pwm2 0 255 PWM_POLARITY_NORMAL>,
49-
<&pwm2 1 255 PWM_POLARITY_NORMAL>,
50-
<&pwm2 2 255 PWM_POLARITY_NORMAL>,
51-
<&pwm2 3 255 PWM_POLARITY_NORMAL>;
121+
pwms = <&pwm1 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
122+
<&pwm1 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
123+
<&pwm1 3 PWM_HZ(500) PWM_POLARITY_NORMAL>,
124+
<&pwm2 0 PWM_HZ(500) PWM_POLARITY_NORMAL>,
125+
<&pwm2 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
126+
<&pwm2 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
127+
<&pwm2 3 PWM_HZ(500) PWM_POLARITY_NORMAL>;
52128

53129
io-channels = <&adc 2>,
54130
<&adc 3>,
@@ -59,8 +135,9 @@
59135
<&adc 4>,
60136
<&adc 1>;
61137

62-
serials = <&uart0>;
63-
i2cs = <&arduino_nano_i2c>;
138+
//cdc-acm-serial = <&board_cdc_acm_uart>; /* 'Serial' object is managed by SerialUSB */
139+
serials = <&uart0>; /* 'Serial1' onwards */
140+
i2cs = <&arduino_nano_i2c>, <&i2c1>;
64141
};
65142
};
66143

@@ -74,7 +151,7 @@
74151
zephyr,reference = "ADC_REF_INTERNAL";
75152
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
76153
zephyr,input-positive = <NRF_SAADC_AIN0>; /* P0.02 */
77-
zephyr,resolution = <10>;
154+
zephyr,resolution = <12>;
78155
};
79156

80157
channel@1 {
@@ -83,7 +160,7 @@
83160
zephyr,reference = "ADC_REF_INTERNAL";
84161
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
85162
zephyr,input-positive = <NRF_SAADC_AIN1>; /* P0.03 */
86-
zephyr,resolution = <10>;
163+
zephyr,resolution = <12>;
87164
};
88165

89166
channel@2 {
@@ -92,7 +169,7 @@
92169
zephyr,reference = "ADC_REF_INTERNAL";
93170
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
94171
zephyr,input-positive = <NRF_SAADC_AIN2>; /* P0.04 */
95-
zephyr,resolution = <10>;
172+
zephyr,resolution = <12>;
96173
};
97174

98175
channel@3 {
@@ -101,7 +178,7 @@
101178
zephyr,reference = "ADC_REF_INTERNAL";
102179
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
103180
zephyr,input-positive = <NRF_SAADC_AIN3>; /* P0.05 */
104-
zephyr,resolution = <10>;
181+
zephyr,resolution = <12>;
105182
};
106183

107184
channel@4 {
@@ -110,7 +187,7 @@
110187
zephyr,reference = "ADC_REF_INTERNAL";
111188
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
112189
zephyr,input-positive = <NRF_SAADC_AIN4>; /* P0.28 */
113-
zephyr,resolution = <10>;
190+
zephyr,resolution = <12>;
114191
};
115192

116193
channel@5 {
@@ -119,7 +196,7 @@
119196
zephyr,reference = "ADC_REF_INTERNAL";
120197
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
121198
zephyr,input-positive = <NRF_SAADC_AIN5>; /* P0.29 */
122-
zephyr,resolution = <10>;
199+
zephyr,resolution = <12>;
123200
};
124201

125202
channel@6 {
@@ -128,7 +205,7 @@
128205
zephyr,reference = "ADC_REF_INTERNAL";
129206
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
130207
zephyr,input-positive = <NRF_SAADC_AIN6>; /* P0.30 */
131-
zephyr,resolution = <10>;
208+
zephyr,resolution = <12>;
132209
};
133210

134211
channel@7 {
@@ -137,7 +214,7 @@
137214
zephyr,reference = "ADC_REF_INTERNAL";
138215
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
139216
zephyr,input-positive = <NRF_SAADC_AIN7>; /* P0.31 */
140-
zephyr,resolution = <10>;
217+
zephyr,resolution = <12>;
141218
};
142219
};
143220

@@ -196,3 +273,25 @@
196273
pinctrl-1 = <&pwm2_sleep>;
197274
pinctrl-names = "default", "sleep";
198275
};
276+
277+
&i2c0 {
278+
status = "okay";
279+
pinctrl-0 = <&i2c0_default>;
280+
pinctrl-1 = <&i2c0_sleep>;
281+
pinctrl-names = "default", "sleep";
282+
clock-frequency = <I2C_BITRATE_FAST>;
283+
};
284+
285+
&i2c1 {
286+
status = "okay";
287+
pinctrl-0 = <&i2c1_default>;
288+
pinctrl-1 = <&i2c1_sleep>;
289+
pinctrl-names = "default", "sleep";
290+
clock-frequency = <I2C_BITRATE_FAST>;
291+
};
292+
293+
&rtc2 {
294+
status = "okay";
295+
clock-frequency = <32768>;
296+
prescaler = <1>; // Optional: sets the RTC tick to ~30.5 µs
297+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) Arduino s.r.l. and/or its affiliated companies
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# This file contains a list of examples that are shipped with the core (or used
5+
# by continuous integration tests), but are known to be currently failing for
6+
# this specific variant.
7+
#
8+
# Each line in this file is treated as a regular expression and will be matched
9+
# against the path of each sketch found in this repo. If a match is found, the
10+
# sketch compilation result will be ignored.
11+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) Arduino s.r.l. and/or its affiliated companies
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# This file contains a list of examples that are shipped with the core (or used
5+
# by continuous integration tests), but are not applicable for this variant,
6+
# for example because it uses hardware features not present on the CPU or board.
7+
#
8+
# Each line in this file should contain the path to an example to exclude,
9+
# relative to the root of the repository.
10+
11+
libraries/Arduino_SecureElement
12+
libraries/Camera
13+
libraries/Ethernet
14+
libraries/Storage
15+
libraries/WiFi
16+
libraries/Zephyr_SDRAM
17+
libraries/CAN
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) Arduino s.r.l. and/or its affiliated companies
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "Arduino.h"
8+
#include <hal/nrf_power.h>
9+
#include <zephyr/dt-bindings/gpio/nordic-nrf-gpio.h>
10+
11+
void _on_1200_bps() {
12+
nrf_power_gpregret_set(NRF_POWER, 0, 0xb0);
13+
NVIC_SystemReset();
14+
}
15+
16+
void initVariant(void) {
17+
static const struct gpio_dt_spec enable_sensors =
18+
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), pin_enable_gpios);
19+
if (gpio_is_ready_dt(&enable_sensors)) {
20+
gpio_flags_t flags = enable_sensors.dt_flags | GPIO_OUTPUT_HIGH | GPIO_ACTIVE_HIGH | NRF_GPIO_DRIVE_H0H1;
21+
gpio_pin_configure(enable_sensors.port, enable_sensors.pin, flags);
22+
gpio_pin_set(enable_sensors.port, enable_sensors.pin, HIGH);
23+
delay(500);
24+
}
25+
}

0 commit comments

Comments
 (0)