summaryrefslogtreecommitdiff
path: root/app/boards/arm
diff options
context:
space:
mode:
authorNick Winans <nick.win999@gmail.com>2020-10-23 00:55:50 -0500
committerGitHub <noreply@github.com>2020-10-23 00:55:50 -0500
commit70ffcca3b42f5dacf5be155a56b11387a7e68b63 (patch)
tree80954a5afb17978ad897e3dde0385cfee0a902c9 /app/boards/arm
parent162c6b77db27c158b05ed65effa8d8ded68ba9b7 (diff)
parent04b7a759f4c676c96da261a724cef1517614dea1 (diff)
Merge branch 'main' into bluetooth/battery-reporting
Diffstat (limited to 'app/boards/arm')
-rw-r--r--app/boards/arm/nice_nano/nice_nano.dts10
-rw-r--r--app/boards/arm/nrf52840_m2/CMakeLists.txt13
-rw-r--r--app/boards/arm/nrf52840_m2/Kconfig10
-rw-r--r--app/boards/arm/nrf52840_m2/Kconfig.board10
-rw-r--r--app/boards/arm/nrf52840_m2/Kconfig.defconfig30
-rw-r--r--app/boards/arm/nrf52840_m2/board.cmake9
-rw-r--r--app/boards/arm/nrf52840_m2/nrf52840_m2.dts97
-rw-r--r--app/boards/arm/nrf52840_m2/nrf52840_m2.yaml15
-rw-r--r--app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig23
-rw-r--r--app/boards/arm/nrfmicro/nrfmicro_11.dts5
-rw-r--r--app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts5
-rw-r--r--app/boards/arm/nrfmicro/nrfmicro_13.dts9
-rw-r--r--app/boards/arm/nrfmicro/pinmux.c11
-rw-r--r--app/boards/arm/planck/Kconfig.defconfig3
-rw-r--r--app/boards/arm/planck/board.cmake3
15 files changed, 241 insertions, 12 deletions
diff --git a/app/boards/arm/nice_nano/nice_nano.dts b/app/boards/arm/nice_nano/nice_nano.dts
index 72804e3..997d195 100644
--- a/app/boards/arm/nice_nano/nice_nano.dts
+++ b/app/boards/arm/nice_nano/nice_nano.dts
@@ -28,6 +28,12 @@
label = "Blue LED";
};
};
+
+ ext-power {
+ compatible = "zmk,ext-power-generic";
+ label = "EXT_POWER";
+ control-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+ };
vbatt {
compatible = "zmk,battery-voltage-divider";
@@ -42,6 +48,10 @@
status = "okay";
};
+&gpiote {
+ status = "okay";
+};
+
&gpio0 {
status = "okay";
};
diff --git a/app/boards/arm/nrf52840_m2/CMakeLists.txt b/app/boards/arm/nrf52840_m2/CMakeLists.txt
new file mode 100644
index 0000000..84b2ab9
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/CMakeLists.txt
@@ -0,0 +1,13 @@
+#
+# Copyright (c) 2020 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
+ COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py
+ -c
+ -b 0x26000
+ -f 0xADA52840
+ -o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2
+ ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
+)
diff --git a/app/boards/arm/nrf52840_m2/Kconfig b/app/boards/arm/nrf52840_m2/Kconfig
new file mode 100644
index 0000000..faff492
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/Kconfig
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2020 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+config BOARD_ENABLE_DCDC
+ bool "Enable DCDC mode"
+ select SOC_DCDC_NRF52X
+ default y
+ depends on BOARD_NRF52840_M2
diff --git a/app/boards/arm/nrf52840_m2/Kconfig.board b/app/boards/arm/nrf52840_m2/Kconfig.board
new file mode 100644
index 0000000..6ade68c
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/Kconfig.board
@@ -0,0 +1,10 @@
+# Maker Diary nrf52840 M.2 board configuration
+#
+# Copyright (c) 2020 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+config BOARD_NRF52840_M2
+ bool "nrf52480_m2"
+ depends on SOC_NRF52840_QIAA
+
diff --git a/app/boards/arm/nrf52840_m2/Kconfig.defconfig b/app/boards/arm/nrf52840_m2/Kconfig.defconfig
new file mode 100644
index 0000000..98fcd08
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/Kconfig.defconfig
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2020 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+if BOARD_NRF52840_M2
+
+config BOARD
+ default "nrf52480_m2"
+
+if USB
+
+config USB_NRFX
+ default y
+
+config USB_DEVICE_STACK
+ default y
+
+endif # USB
+
+config BT_CTLR
+ default BT
+
+config ZMK_BLE
+ default y
+
+config ZMK_USB
+ default y
+
+endif # BOARD_NRF52840_M2
diff --git a/app/boards/arm/nrf52840_m2/board.cmake b/app/boards/arm/nrf52840_m2/board.cmake
new file mode 100644
index 0000000..55b44e2
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/board.cmake
@@ -0,0 +1,9 @@
+#
+# Copyright (c) 2020 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
+
+include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2.dts b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts
new file mode 100644
index 0000000..fb5b0ff
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/nrf52840_m2.dts
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2020 The ZMK Contributors
+ * SPDX-License-Identifier: MIT
+ */
+
+/dts-v1/;
+#include <nordic/nrf52840_qiaa.dtsi>
+
+/ {
+ model = "Makerdiary nRF52840 M.2 module";
+ compatible = "makerdiary,nrf52840_m2";
+
+ chosen {
+ zephyr,code-partition = &code_partition;
+ //zephyr,console = &uart0;
+ //zephyr,bt-mon-uart = &uart0;
+ //zephyr,bt-c2h-uart = &uart0;
+ zephyr,sram = &sram0;
+ zephyr,flash = &flash0;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+ red_led: led_0 {
+ gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
+ label = "Red LED";
+ };
+ green_led: led_1 {
+ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
+ label = "Green LED";
+ };
+ blue_led: led_2 {
+ gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
+ label = "Blue LED";
+ };
+ };
+
+};
+
+&gpio0 {
+ status = "okay";
+};
+
+&gpio1 {
+ status = "okay";
+};
+
+&uart0 {
+ compatible = "nordic,nrf-uart";
+ status = "okay";
+ current-speed = <115200>;
+ tx-pin = <16>;
+ rx-pin = <15>;
+ rts-pin = <14>;
+ cts-pin = <13>;
+};
+
+&usbd {
+ compatible = "nordic,nrf-usbd";
+ status = "okay";
+};
+
+
+&flash0 {
+ /*
+ * For more information, see:
+ * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
+ */
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ boot_partition: partition@0 {
+ label = "adafruit_boot";
+ reg = <0x000000000 0x0000C000>;
+ };
+ code_partition: partition@26000 {
+ label = "code_partition";
+ reg = <0x00026000 0x000d2000>;
+ };
+
+ /*
+ * The flash starting at 0x000f8000 and ending at
+ * 0x000fffff is reserved for use by the application.
+ */
+
+ /*
+ * Storage partition will be used by FCB/LittleFS/NVS
+ * if enabled.
+ */
+ storage_partition: partition@f8000 {
+ label = "storage";
+ reg = <0x000f8000 0x00008000>;
+ };
+ };
+};
diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2.yaml b/app/boards/arm/nrf52840_m2/nrf52840_m2.yaml
new file mode 100644
index 0000000..0a999bb
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/nrf52840_m2.yaml
@@ -0,0 +1,15 @@
+identifier: nrf52840_m2
+name: Makerdiary nRF52840 M.2 module
+type: mcu
+arch: arm
+toolchain:
+ - zephyr
+ - gnuarmemb
+ - xtools
+supported:
+ - adc
+ - usb_device
+ - ble
+ - ieee802154
+ - pwm
+ - watchdog
diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig b/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig
new file mode 100644
index 0000000..e74438b
--- /dev/null
+++ b/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2020 The ZMK Contributors
+# SPDX-License-Identifier: MIT
+#
+
+CONFIG_SOC_SERIES_NRF52X=y
+CONFIG_SOC_NRF52840_QIAA=y
+CONFIG_BOARD_NRF52840_M2=y
+
+# Enable MPU
+CONFIG_ARM_MPU=y
+
+# enable GPIO
+CONFIG_GPIO=y
+
+CONFIG_USE_DT_CODE_PARTITION=y
+
+CONFIG_MPU_ALLOW_FLASH_WRITE=y
+CONFIG_NVS=y
+CONFIG_SETTINGS_NVS=y
+CONFIG_FLASH=y
+CONFIG_FLASH_PAGE_LAYOUT=y
+CONFIG_FLASH_MAP=y
diff --git a/app/boards/arm/nrfmicro/nrfmicro_11.dts b/app/boards/arm/nrfmicro/nrfmicro_11.dts
index 95bd8ad..87c650e 100644
--- a/app/boards/arm/nrfmicro/nrfmicro_11.dts
+++ b/app/boards/arm/nrfmicro/nrfmicro_11.dts
@@ -26,6 +26,11 @@
};
};
+ ext-power {
+ compatible = "zmk,ext-power-generic";
+ label = "EXT_POWER";
+ control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+ };
};
&gpio0 {
diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts
index 85693a8..ea15b81 100644
--- a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts
+++ b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts
@@ -26,6 +26,11 @@
};
};
+ ext-power {
+ compatible = "zmk,ext-power-generic";
+ label = "EXT_POWER";
+ control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+ };
};
&gpio0 {
diff --git a/app/boards/arm/nrfmicro/nrfmicro_13.dts b/app/boards/arm/nrfmicro/nrfmicro_13.dts
index 840014a..ae6c1af 100644
--- a/app/boards/arm/nrfmicro/nrfmicro_13.dts
+++ b/app/boards/arm/nrfmicro/nrfmicro_13.dts
@@ -25,6 +25,12 @@
label = "Blue LED";
};
};
+
+ ext-power {
+ compatible = "zmk,ext-power-generic";
+ label = "EXT_POWER";
+ control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+ };
vbatt {
compatible = "zmk,battery-voltage-divider";
@@ -33,7 +39,10 @@
output-ohms = <2000000>;
full-ohms = <(2000000 + 820000)>;
};
+};
+&adc {
+ status = "okay";
};
&gpio0 {
diff --git a/app/boards/arm/nrfmicro/pinmux.c b/app/boards/arm/nrfmicro/pinmux.c
index 4e330b6..30117d0 100644
--- a/app/boards/arm/nrfmicro/pinmux.c
+++ b/app/boards/arm/nrfmicro/pinmux.c
@@ -14,25 +14,14 @@
static int pinmux_nrfmicro_init(struct device *port) {
ARG_UNUSED(port);
- struct device *p1 = device_get_binding("GPIO_1");
-
#if CONFIG_BOARD_NRFMICRO_13
struct device *p0 = device_get_binding("GPIO_0");
- // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
- gpio_pin_configure(p1, 9, GPIO_OUTPUT);
- gpio_pin_set(p1, 9, 0);
-
#if CONFIG_BOARD_NRFMICRO_CHARGER
gpio_pin_configure(p0, 5, GPIO_OUTPUT);
gpio_pin_set(p0, 5, 0);
#else
gpio_pin_configure(p0, 5, GPIO_INPUT);
#endif
-
-#else
- // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
- gpio_pin_configure(p1, 9, GPIO_OUTPUT);
- gpio_pin_set(p1, 9, 1);
#endif
return 0;
}
diff --git a/app/boards/arm/planck/Kconfig.defconfig b/app/boards/arm/planck/Kconfig.defconfig
index 6f5bf52..913c1c1 100644
--- a/app/boards/arm/planck/Kconfig.defconfig
+++ b/app/boards/arm/planck/Kconfig.defconfig
@@ -11,4 +11,7 @@ config ZMK_KEYBOARD_NAME
config ZMK_USB
default y
+config ZMK_KSCAN_MATRIX_POLLING
+ default y
+
endif # BOARD_PLANCK_REV6
diff --git a/app/boards/arm/planck/board.cmake b/app/boards/arm/planck/board.cmake
index 4843c41..772796d 100644
--- a/app/boards/arm/planck/board.cmake
+++ b/app/boards/arm/planck/board.cmake
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT
+board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
board_runner_args(jlink "--device=STM32F303VC" "--speed=4000")
-include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)