Skip to content

Commit 818bbea

Browse files
committed
BLE 33 - .overlay updates, enable Wire1, pins match MBED, change AnalogRead to 12 bit
Extra pins: ``` <&gpio0 24 0>, /* D22 LED R */ <&gpio0 16 0>, /* D23 LED G */ <&gpio0 6 0>, /* D24 LED B */ <&gpio1 9 0>, /* D25 LED PWR */ <&gpio0 19 0>, /* D26 INT APDS */ <&gpio0 17 0>, /* D27 PDM PWR */ <&gpio0 26 0>, /* D28 PDM CLK */ <&gpio0 25 0>, /* D29 PDM DIN */ <&gpio0 14 0>, /* D30 SDA2 */ <&gpio0 15 0>, /* D31 SCL2 */ <&gpio1 0 0>, /* D32 I2C_PULL */ <&gpio0 22 0>; /* D33 VDD_ENV_ENABLE */ ``` Note some of these pins are important to enable Wire1 to work. Including enabling power to the sensors as well as to enable the Pull up resistors on the Wire1 object. Added Wire1 object to the list of wire bojects. Set default clock-frequency on the two I2C objects, like the GIGA has defined. Also changed the ADC conversion resolution for all of the channels from 10 bits to 12, as that is I believe the maximum the device supports. So when we pull in the PR for analogRead it should then map down to the resolution the user chooses with analogReadResolution call.
1 parent 205bd78 commit 818bbea

File tree

8 files changed

+1008
-845
lines changed

8 files changed

+1008
-845
lines changed

Diff for: firmwares/zephyr-arduino_nano_33_ble_sense.bin

876 Bytes
Binary file not shown.

Diff for: firmwares/zephyr-arduino_nano_33_ble_sense.elf

-7.05 KB
Binary file not shown.

Diff for: loader/boards/arduino_nano_33_ble_sense.overlay

+39-10
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,19 @@
6666
<&arduino_nano_header 18 0>, /* D18 / A4 / I2C-SDA */
6767
<&arduino_nano_header 19 0>, /* D19 / A5 / I2C-SCL */
6868
<&arduino_nano_header 20 0>,
69-
<&arduino_nano_header 21 0>;
69+
<&arduino_nano_header 21 0>,
70+
<&gpio0 24 0>, /* D22 LED R */
71+
<&gpio0 16 0>, /* D23 LED G */
72+
<&gpio0 6 0>, /* D24 LED B */
73+
<&gpio1 9 0>, /* D25 LED PWR */
74+
<&gpio0 19 0>, /* D26 INT APDS */
75+
<&gpio0 17 0>, /* D27 PDM PWR */
76+
<&gpio0 26 0>, /* D28 PDM CLK */
77+
<&gpio0 25 0>, /* D29 PDM DIN */
78+
<&gpio0 14 0>, /* D30 SDA2 */
79+
<&gpio0 15 0>, /* D31 SCL2 */
80+
<&gpio1 0 0>, /* D32 I2C_PULL */
81+
<&gpio0 22 0>; /* D33 VDD_ENV_ENABLE */
7082

7183
pwm-pin-gpios = <&arduino_nano_header 3 0>,
7284
<&arduino_nano_header 5 0>,
@@ -106,7 +118,7 @@
106118

107119
serials = <&cdc_acm_uart0>, <&uart0>;
108120
cdc-acm = <&cdc_acm_uart0>;
109-
i2cs = <&arduino_nano_i2c>;
121+
i2cs = <&arduino_nano_i2c>, <&i2c1>;
110122
};
111123
};
112124

@@ -120,7 +132,7 @@
120132
zephyr,reference = "ADC_REF_INTERNAL";
121133
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
122134
zephyr,input-positive = <NRF_SAADC_AIN0>; /* P0.02 */
123-
zephyr,resolution = <10>;
135+
zephyr,resolution = <12>;
124136
};
125137

126138
channel@1 {
@@ -129,7 +141,7 @@
129141
zephyr,reference = "ADC_REF_INTERNAL";
130142
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
131143
zephyr,input-positive = <NRF_SAADC_AIN1>; /* P0.03 */
132-
zephyr,resolution = <10>;
144+
zephyr,resolution = <12>;
133145
};
134146

135147
channel@2 {
@@ -138,7 +150,7 @@
138150
zephyr,reference = "ADC_REF_INTERNAL";
139151
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
140152
zephyr,input-positive = <NRF_SAADC_AIN2>; /* P0.04 */
141-
zephyr,resolution = <10>;
153+
zephyr,resolution = <12>;
142154
};
143155

144156
channel@3 {
@@ -147,7 +159,7 @@
147159
zephyr,reference = "ADC_REF_INTERNAL";
148160
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
149161
zephyr,input-positive = <NRF_SAADC_AIN3>; /* P0.05 */
150-
zephyr,resolution = <10>;
162+
zephyr,resolution = <12>;
151163
};
152164

153165
channel@4 {
@@ -156,7 +168,7 @@
156168
zephyr,reference = "ADC_REF_INTERNAL";
157169
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
158170
zephyr,input-positive = <NRF_SAADC_AIN4>; /* P0.28 */
159-
zephyr,resolution = <10>;
171+
zephyr,resolution = <12>;
160172
};
161173

162174
channel@5 {
@@ -165,7 +177,7 @@
165177
zephyr,reference = "ADC_REF_INTERNAL";
166178
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
167179
zephyr,input-positive = <NRF_SAADC_AIN5>; /* P0.29 */
168-
zephyr,resolution = <10>;
180+
zephyr,resolution = <12>;
169181
};
170182

171183
channel@6 {
@@ -174,7 +186,7 @@
174186
zephyr,reference = "ADC_REF_INTERNAL";
175187
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
176188
zephyr,input-positive = <NRF_SAADC_AIN6>; /* P0.30 */
177-
zephyr,resolution = <10>;
189+
zephyr,resolution = <12>;
178190
};
179191

180192
channel@7 {
@@ -183,7 +195,7 @@
183195
zephyr,reference = "ADC_REF_INTERNAL";
184196
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
185197
zephyr,input-positive = <NRF_SAADC_AIN7>; /* P0.31 */
186-
zephyr,resolution = <10>;
198+
zephyr,resolution = <12>;
187199
};
188200
};
189201

@@ -242,3 +254,20 @@
242254
pinctrl-1 = <&pwm2_sleep>;
243255
pinctrl-names = "default", "sleep";
244256
};
257+
258+
&i2c0 {
259+
status = "okay";
260+
pinctrl-0 = <&i2c0_default>;
261+
pinctrl-1 = <&i2c0_sleep>;
262+
pinctrl-names = "default", "sleep";
263+
clock-frequency = <I2C_BITRATE_FAST>;
264+
};
265+
266+
&i2c1 {
267+
status = "okay";
268+
pinctrl-0 = <&i2c1_default>;
269+
pinctrl-1 = <&i2c1_sleep>;
270+
pinctrl-names = "default", "sleep";
271+
clock-frequency = <I2C_BITRATE_FAST>;
272+
};
273+

Diff for: variants/arduino_nano_33_ble_sense/llext-edk/Makefile.cflags

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
LLEXT_CFLAGS = -DKERNEL -D__ZEPHYR__=1 -D__LINUX_ERRNO_EXTENSIONS__ -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__PROGRAM_START -DNRF52840_XXAA -DK_HEAP_MEM_POOL_SIZE=16384 -DLL_EXTENSION_BUILD -fno-strict-aliasing -fstack-protector-all -mstack-protector-guard=global -fno-printf-return-value -fno-common -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wformat -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fstack-usage -specs=picolibc.specs -D_POSIX_THREADS -std=c99 -mlong-calls -mthumb -nodefaultlibs -imacros$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h -imacros$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr/autoconf.h -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/libc/common/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/posix/options/getopt/ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/nrf52/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/usb/device -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/shell/modules/kernel_service/thread/../ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/drivers/usb/common/nrf_usbd_common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/cmsis/CMSIS/Core/Include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/cmsis/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/drivers/include -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/mdk -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/hal_nordic/nrfx/.
1+
LLEXT_CFLAGS = -DKERNEL -D__ZEPHYR__=1 -D__LINUX_ERRNO_EXTENSIONS__ -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__PROGRAM_START -DNRF52840_XXAA -DK_HEAP_MEM_POOL_SIZE=16384 -DLL_EXTENSION_BUILD -fno-strict-aliasing -fstack-protector-all -mstack-protector-guard=global -fno-printf-return-value -fno-common -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wall -Wformat -Wformat-security -Wformat -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fstack-usage -specs=picolibc.specs -D_POSIX_THREADS -std=c99 -mlong-calls -mthumb -nodefaultlibs -imacros$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/zephyr/toolchain/zephyr_stdint.h -imacros$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr/autoconf.h -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/libc/common/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/posix/options/getopt/ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/cpp/minimal/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/nrf52/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/usb/device -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/shell/modules/kernel_service/thread/../ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/drivers/usb/common/nrf_usbd_common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/cmsis/CMSIS/Core/Include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/cmsis/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/drivers/include -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/mdk -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/hal_nordic/nrfx/.
22

3-
LLEXT_ALL_INCLUDE_CFLAGS = -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/libc/common/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/posix/options/getopt/ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/nrf52/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/usb/device -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/shell/modules/kernel_service/thread/../ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/drivers/usb/common/nrf_usbd_common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/cmsis/CMSIS/Core/Include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/cmsis/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/drivers/include -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/mdk -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/hal_nordic/nrfx/.
3+
LLEXT_ALL_INCLUDE_CFLAGS = -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/libc/common/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/posix/options/getopt/ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/cpp/minimal/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/nrf52/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/usb/device -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/shell/modules/kernel_service/thread/../ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/drivers/usb/common/nrf_usbd_common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/cmsis/CMSIS/Core/Include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/cmsis/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/drivers/include -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/mdk -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/hal_nordic/nrfx/.
44

5-
LLEXT_INCLUDE_CFLAGS = -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/libc/common/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/posix/options/getopt/ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/nrf52/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/usb/device -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/shell/modules/kernel_service/thread/../ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/drivers/usb/common/nrf_usbd_common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/cmsis/CMSIS/Core/Include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/cmsis/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/drivers/include -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/mdk -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/hal_nordic/nrfx/.
5+
LLEXT_INCLUDE_CFLAGS = -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/libc/common/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/posix/options/getopt/ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/lib/cpp/minimal/include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/nrf52/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/soc/nordic/common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/usb/device -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/bluetooth -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/subsys/shell/modules/kernel_service/thread/../ -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/drivers/usb/common/nrf_usbd_common/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/cmsis/CMSIS/Core/Include -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/cmsis/. -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/drivers/include -I$(LLEXT_EDK_INSTALL_DIR)/include/modules/hal/nordic/nrfx/mdk -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/modules/hal_nordic/nrfx/.
66

77
LLEXT_GENERATED_INCLUDE_CFLAGS = -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated/zephyr -I$(LLEXT_EDK_INSTALL_DIR)/include/zephyr/include/generated
88

0 commit comments

Comments
 (0)