Skip to content

Commit

Permalink
boards: qorvo: add DWM3001CDK support
Browse files Browse the repository at this point in the history
This doensn't add any drivers for the DWM3001C, but it works with
https://github.com/br101/zephyr-dw3000-decadriver/

Signed-off-by: Mara Furland <mara@fur.land>
  • Loading branch information
Mara Furland authored and mtfurlan committed Sep 25, 2024
1 parent 50720f8 commit 171ff3d
Show file tree
Hide file tree
Showing 12 changed files with 414 additions and 0 deletions.
7 changes: 7 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

if BOARD_DECAWAVE_DWM3001CDK
config BOARD_SERIAL_BACKEND_CDC_ACM
bool "Use USB CDC as serial console backend"
default y

endif # BOARD_DECAWAVE_DWM3001CDK
7 changes: 7 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/Kconfig.decawave_dwm3001cdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DecaWave DWM3001CDK board configuration

# Copyright (c) 2019 Stéphane D'Alu
# SPDX-License-Identifier: Apache-2.0

config BOARD_DECAWAVE_DWM3001CDK
select SOC_NRF52833_QDAA
60 changes: 60 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# DecaWave DWM3001CDK board configuration

# Copyright (c) 2019 Stéphane D'Alu
# SPDX-License-Identifier: Apache-2.0

if BOARD_DECAWAVE_DWM3001CDK

config BT_CTLR
default BT

config I2C
default SENSOR

if BOARD_SERIAL_BACKEND_CDC_ACM

config USB_DEVICE_STACK
default y

config USB_CDC_ACM
default SERIAL

config USB_DEVICE_INITIALIZE_AT_BOOT
default y if CONSOLE

config SHELL_BACKEND_SERIAL_CHECK_DTR
default SHELL
depends on UART_LINE_CTRL

config UART_LINE_CTRL
default SHELL

config USB_DEVICE_REMOTE_WAKEUP
default n

config USB_DEVICE_VID
default 0x2fe3

config USB_DEVICE_PID
default 0x0100

config USB_DEVICE_PRODUCT
default "Zephyr DWM3001 CDK"

if LOG

# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice

endif # LOG

endif # BOARD_SERIAL_BACKEND_CDC_ACM

DT_CHOSEN_ZEPHYR_CONSOLE := zephyr,console

config UART_CONSOLE
default y if $(dt_chosen_enabled,$(DT_CHOSEN_ZEPHYR_CONSOLE)) && CONSOLE

endif # BOARD_DECAWAVE_DWM3001CDK
9 changes: 9 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=nRF52833_xxAA" "--speed=4000")
board_runner_args(pyocd "--target=nrf52833" "--frequency=4000000")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
5 changes: 5 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: decawave_dwm3001cdk
vendor: qorvo
socs:
- name: nrf52833
39 changes: 39 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2022 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/

&pinctrl {
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 24)>,
<NRF_PSEL(TWIM_SCL, 1, 04)>;
bias-pull-up;
};
};

i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 24)>,
<NRF_PSEL(TWIM_SCL, 1, 04)>;
low-power-enable;
};
};

spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>,
<NRF_PSEL(SPIM_MOSI, 0, 8)>,
<NRF_PSEL(SPIM_MISO, 0, 29)>;
};
};

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>,
<NRF_PSEL(SPIM_MOSI, 0, 8)>,
<NRF_PSEL(SPIM_MISO, 0, 29)>;
low-power-enable;
};
};
};
181 changes: 181 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
/*
* Copyright (c) 2019 Stéphane D'Alu

Check warning on line 2 in boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

BLOCK_COMMENT_STYLE

boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts:2 Block comments should align the * on each line
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <nordic/nrf52833_qdaa.dtsi>
#include "decawave_dwm3001cdk-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "Decawave DWM3001CDK";
compatible = "decawave,dwm3001";

chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,uart-mcumgr = &cdc_acm_uart0;
zephyr,bt-mon-uart = &cdc_acm_uart0;
zephyr,bt-c2h-uart = &cdc_acm_uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;
};

leds {
compatible = "gpio-leds";
// led from top of board down
// D20: soemthing related to jlink, red
// D13: DW3000 tx(red)/rx(green)
// green
led0: led_0 {
gpios = <&gpio0 04 GPIO_ACTIVE_LOW>;
label = "D9 LED";
};
// red
led1: led_1 {
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
label = "D12 LED";
};
// red
led2: led_2 {
gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
label = "D11 LED";
};
// blue
led3: led_3 {
gpios = <&gpio0 05 GPIO_ACTIVE_LOW>;
label = "D10 LED";
};
};

buttons {
compatible = "gpio-keys";
// SW1 is connected to P0.18, whicy by default is nRESET and
// will reset the board
button1: button_1 {
gpios = <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Push button switch 1";
zephyr,code = <INPUT_KEY_0>;
};
button2: button_2 {
gpios = <&gpio0 02 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Push button switch 2";
zephyr,code = <INPUT_KEY_1>;
};
};

/* These aliases are provided for compatibility with samples */
aliases {
sw0 = &button1;
sw1 = &button2;
led0 = &led0;
led1 = &led1;
led2 = &led2;
led3 = &led3;
watchdog0 = &wdt0;
accel0 = &lis2dh12;
};

};

&uicr {
gpio-as-nreset;
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};

&i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;

pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
lis2dh12: lis2dh12@19 {
compatible = "st,lis2dh12", "st,lis2dh";
reg = <0x19>;
irq-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
};
};

&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";
cs-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;

pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";

dwm3000@0 {
compatible = "decawave,dw3000";
label = "DW3000";
spi-max-frequency = <1000000>;

reset-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
irq-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
//wakeup-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
//spi-pol-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
//spi-pha-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
reg = <0>;
status = "okay";
};

};

&ieee802154 {
status = "okay";
};

// flash from nrf52833dk_nrf52833
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xC000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x37000>;
};
slot1_partition: partition@43000 {
label = "image-1";
reg = <0x00043000 0x37000>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007A000 0x00006000>;
};
};
};

zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";

cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};

&reg1 {
regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
};
21 changes: 21 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
identifier: decawave_dwm3001cdk
name: Decawave-DWM3001CDK
type: mcu
arch: arm
ram: 128
flash: 512
vendor: decawave
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- usbd
- ble
- gpio
- pwm
- watchdog
- counter
- netif:openthread
13 changes: 13 additions & 0 deletions boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0

# Enable MPU
CONFIG_ARM_MPU=y

# Enable hardware stack protection
CONFIG_HW_STACK_PROTECTION=y

# enable GPIO
CONFIG_GPIO=y

# enable uart driver
CONFIG_SERIAL=y
Binary file not shown.
Loading

0 comments on commit 171ff3d

Please sign in to comment.