I have the following files:
test_board.dts
/dts-v1/;
#include <nordic/nrf52833_qiaa.dtsi>
#include "test_board-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Custom Board auto generated by nRF Connect for VS Code";
compatible = "Zana,ZanaValve-Board";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;
};
motor {
compatible = "gpio-leds";
nsleep: motor_nsleep {
gpios = <&gpio1 0 (GPIO_ACTIVE_HIGH)>;
};
};
leds {
compatible = "gpio-leds";
led0: pairing_led {
gpios = <&gpio1 4 (GPIO_ACTIVE_LOW)>;
};
led1: error_led {
gpios = <&gpio1 6 (GPIO_ACTIVE_LOW)>;
};
led2: open_status_led {
gpios = <&gpio0 18 (GPIO_ACTIVE_LOW)>;
};
led3: close_status_led {
gpios = <&gpio0 19 (GPIO_ACTIVE_LOW)>;
};
};
mypwm {
compatible = "pwm-leds";
my_pwm0: my_pwm_0 {
pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>,
<&pwm0 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>,
<&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};
buttons {
compatible = "gpio-keys";
button_pairing: pairing {
gpios = <&gpio1 2 (GPIO_ACTIVE_LOW)>;
label = "Pairing button";
zephyr,code = <INPUT_KEY_0>;
};
button_open: open {
gpios = <&gpio1 13 (GPIO_ACTIVE_LOW)>;
label = "GB Open limmit switch";
zephyr,code = <INPUT_KEY_1>;
};
button_close: close {
gpios = <&gpio1 15 (GPIO_ACTIVE_LOW)>;
label = "GB Close limmit switch";
zephyr,code = <INPUT_KEY_2>;
};
button_control_1: control_1 {
gpios = <&gpio0 3 (GPIO_ACTIVE_LOW)>;
label = "Control limmit switch 1";
zephyr,code = <INPUT_KEY_3>;
};
button_control_2: control_2 {
gpios = <&gpio0 5 (GPIO_ACTIVE_LOW)>;
label = "Control limmit switch 2";
zephyr,code = <INPUT_KEY_4>;
};
};
arduino_adc: analog-connector {
compatible = "arduino,uno-adc";
#io-channel-cells = <1>;
io-channel-map = <0 &adc 1>, /* A0 = P0.3 = AIN1 */
<1 &adc 2>, /* A1 = P0.4 = AIN2 */
<2 &adc 4>, /* A2 = P0.28 = AIN4 */
<3 &adc 5>, /* A3 = P0.29 = AIN5 */
<4 &adc 6>, /* A4 = P0.30 = AIN6 */
<5 &adc 7>; /* A5 = P0.31 = AIN7 */
};
/* These aliases are provided for compatibility with samples */
aliases {
nsleep = &nsleep;
led0 = &led0;
led1 = &led1;
led2 = &led2;
led3 = &led3;
my-pwm0 = &my_pwm0;
pairing = &button_pairing;
open = &button_open;
close = &button_close;
control1 = &button_control_1;
control2 = &button_control_2;
bootloader-led0 = &led0;
mcuboot-led0 = &led0;
watchdog0 = &wdt0;
};
};
&adc {
status = "okay";
};
&uicr {
gpio-as-nreset;
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&uart1 {
current-speed = <115200>;
pinctrl-0 = <&uart1_default>;
pinctrl-1 = <&uart1_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c0 {
compatible = "nordic,nrf-twi";
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c1 {
compatible = "nordic,nrf-twi";
/* Cannot be used together with spi1. */
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&spi0 {
compatible = "nordic,nrf-spi";
/* Cannot be used together with i2c0. */
/* status = "okay"; */
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
};
&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
};
&spi2 {
compatible = "nordic,nrf-spi";
status = "disabled";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
};
&ieee802154 {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(48)>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000c000 DT_SIZE_K(220)>;
};
slot1_partition: partition@43000 {
label = "image-1";
reg = <0x00043000 DT_SIZE_K(220)>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007a000 DT_SIZE_K(24)>;
};
};
};
test_board-pinctrl.dtsi
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RTS, 0, 5)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 0, 8)>,
<NRF_PSEL(UART_CTS, 0, 7)>;
bias-pull-up;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 0, 8)>,
<NRF_PSEL(UART_RTS, 0, 5)>,
<NRF_PSEL(UART_CTS, 0, 7)>;
low-power-enable;
};
};
uart1_default: uart1_default {
group1 {
psels = <NRF_PSEL(UART_RX, 1, 1)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 1, 2)>;
};
};
uart1_sleep: uart1_sleep {
group1 {
psels = <NRF_PSEL(UART_RX, 1, 1)>,
<NRF_PSEL(UART_TX, 1, 2)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
<NRF_PSEL(TWIM_SCL, 0, 27)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
<NRF_PSEL(TWIM_SCL, 0, 27)>;
low-power-enable;
};
};
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
<NRF_PSEL(TWIM_SCL, 0, 31)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
<NRF_PSEL(TWIM_SCL, 0, 31)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>,
<NRF_PSEL(PWM_OUT1, 1, 1)>, // P1.01 motor enable
<NRF_PSEL(PWM_OUT2, 1, 3)>; // P1.03 motor phase
nordic,invert;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>,
<NRF_PSEL(PWM_OUT1, 1, 1)>, // P1.01 motor enable
<NRF_PSEL(PWM_OUT2, 1, 3)>; // P1.03 motor phase
low-power-enable;
};
};
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 29)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 29)>;
low-power-enable;
};
};
spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 31)>,
<NRF_PSEL(SPIM_MOSI, 0, 30)>,
<NRF_PSEL(SPIM_MISO, 1, 8)>;
};
};
spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 31)>,
<NRF_PSEL(SPIM_MOSI, 0, 30)>,
<NRF_PSEL(SPIM_MISO, 1, 8)>;
low-power-enable;
};
};
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 19)>,
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
<NRF_PSEL(SPIM_MISO, 0, 21)>;
};
};
spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 19)>,
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
<NRF_PSEL(SPIM_MISO, 0, 21)>;
low-power-enable;
};
};
qspi_default: qspi_default {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
<NRF_PSEL(QSPI_IO0, 0, 20)>,
<NRF_PSEL(QSPI_IO1, 0, 21)>,
<NRF_PSEL(QSPI_IO2, 0, 22)>,
<NRF_PSEL(QSPI_IO3, 0, 23)>,
<NRF_PSEL(QSPI_CSN, 0, 17)>;
nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
};
qspi_sleep: qspi_sleep {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
<NRF_PSEL(QSPI_IO0, 0, 20)>,
<NRF_PSEL(QSPI_IO1, 0, 21)>,
<NRF_PSEL(QSPI_IO2, 0, 22)>,
<NRF_PSEL(QSPI_IO3, 0, 23)>;
low-power-enable;
};
group2 {
psels = <NRF_PSEL(QSPI_CSN, 0, 17)>;
low-power-enable;
bias-pull-up;
};
};
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
low-power-enable;
};
};
};