From 2f3a9e0c3263455b0efdfc98a1c92383c9c97b59 Mon Sep 17 00:00:00 2001 From: dezlidezlidezli Date: Mon, 1 Mar 2021 20:37:33 +1100 Subject: [PATCH] commit --- app/boards/arm/ahokore_v2/CMakeLists.txt | 8 ++ app/boards/arm/ahokore_v2/Kconfig | 7 ++ app/boards/arm/ahokore_v2/Kconfig.board | 6 + app/boards/arm/ahokore_v2/Kconfig.defconfig | 31 ++++++ app/boards/arm/ahokore_v2/ahokore_defconfig | 20 ++++ app/boards/arm/ahokore_v2/board.cmake | 5 + app/boards/arm/ahokore_v2/nice_nano.dts | 115 ++++++++++++++++++++ app/boards/arm/ahokore_v2/nice_nano.yaml | 15 +++ 8 files changed, 207 insertions(+) create mode 100644 app/boards/arm/ahokore_v2/CMakeLists.txt create mode 100644 app/boards/arm/ahokore_v2/Kconfig create mode 100644 app/boards/arm/ahokore_v2/Kconfig.board create mode 100644 app/boards/arm/ahokore_v2/Kconfig.defconfig create mode 100644 app/boards/arm/ahokore_v2/ahokore_defconfig create mode 100644 app/boards/arm/ahokore_v2/board.cmake create mode 100644 app/boards/arm/ahokore_v2/nice_nano.dts create mode 100644 app/boards/arm/ahokore_v2/nice_nano.yaml diff --git a/app/boards/arm/ahokore_v2/CMakeLists.txt b/app/boards/arm/ahokore_v2/CMakeLists.txt new file mode 100644 index 00000000..00952c30 --- /dev/null +++ b/app/boards/arm/ahokore_v2/CMakeLists.txt @@ -0,0 +1,8 @@ +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/ahokore_v2/Kconfig b/app/boards/arm/ahokore_v2/Kconfig new file mode 100644 index 00000000..66077154 --- /dev/null +++ b/app/boards/arm/ahokore_v2/Kconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_AHOKORE diff --git a/app/boards/arm/ahokore_v2/Kconfig.board b/app/boards/arm/ahokore_v2/Kconfig.board new file mode 100644 index 00000000..1c62b202 --- /dev/null +++ b/app/boards/arm/ahokore_v2/Kconfig.board @@ -0,0 +1,6 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config BOARD_AHOKORE + bool "ahokore" + depends on SOC_NRF52840_QIAA diff --git a/app/boards/arm/ahokore_v2/Kconfig.defconfig b/app/boards/arm/ahokore_v2/Kconfig.defconfig new file mode 100644 index 00000000..1bdb726a --- /dev/null +++ b/app/boards/arm/ahokore_v2/Kconfig.defconfig @@ -0,0 +1,31 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if BOARD_AHOKORE + +config BOARD + default "ahokore" + +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 + +config ZMK_BATTERY_VOLTAGE_DIVIDER + default y + +endif # BOARD_AHOKORE diff --git a/app/boards/arm/ahokore_v2/ahokore_defconfig b/app/boards/arm/ahokore_v2/ahokore_defconfig new file mode 100644 index 00000000..d6566fba --- /dev/null +++ b/app/boards/arm/ahokore_v2/ahokore_defconfig @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: MIT + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_AHOKORE=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/ahokore_v2/board.cmake b/app/boards/arm/ahokore_v2/board.cmake new file mode 100644 index 00000000..fa847d50 --- /dev/null +++ b/app/boards/arm/ahokore_v2/board.cmake @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT + +board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") +include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) diff --git a/app/boards/arm/ahokore_v2/nice_nano.dts b/app/boards/arm/ahokore_v2/nice_nano.dts new file mode 100644 index 00000000..5efde4b2 --- /dev/null +++ b/app/boards/arm/ahokore_v2/nice_nano.dts @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +/dts-v1/; +#include +#include "arduino_pro_micro_pins.dtsi" + +/ { + model = "nice!nano"; + compatible = "nice,nano"; + + chosen { + zephyr,code-partition = &code_partition; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds { + compatible = "gpio-leds"; + blue_led: led_0 { + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + 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"; + label = "BATTERY"; + io-channels = <&adc 2>; + output-ohms = <2000000>; + full-ohms = <(2000000 + 806000)>; + }; +}; + +&adc { + status = "okay"; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + compatible = "nordic,nrf-twi"; + sda-pin = <17>; + scl-pin = <20>; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + tx-pin = <6>; + rx-pin = <8>; +}; + +&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>; + + sd_partition: partition@0 { + label = "softdevice"; + reg = <0x00000000 0x00026000>; + }; + code_partition: partition@26000 { + label = "code_partition"; + reg = <0x00026000 0x000c6000>; + }; + + /* + * The flash starting at 0x000ec000 and ending at + * 0x000f3fff is reserved for use by the application. + */ + + /* + * Storage partition will be used by FCB/LittleFS/NVS + * if enabled. + */ + storage_partition: partition@ec000 { + label = "storage"; + reg = <0x000ec000 0x00008000>; + }; + + boot_partition: partition@f4000 { + label = "adafruit_boot"; + reg = <0x000f4000 0x0000c000>; + }; + }; +}; diff --git a/app/boards/arm/ahokore_v2/nice_nano.yaml b/app/boards/arm/ahokore_v2/nice_nano.yaml new file mode 100644 index 00000000..8d65db6d --- /dev/null +++ b/app/boards/arm/ahokore_v2/nice_nano.yaml @@ -0,0 +1,15 @@ +identifier: ahokore +name: ahokore_v2 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - usb_device + - ble + - ieee802154 + - pwm + - watchdog