diff --git a/boards/arm/nicenano/Kconfig b/boards/arm/nicenano/Kconfig new file mode 100644 index 0000000000000..ec36afc5779e3 --- /dev/null +++ b/boards/arm/nicenano/Kconfig @@ -0,0 +1,10 @@ +# nRF52840 DK NRF52840 board configuration + +# Copyright (c) 2016 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_NICENANO diff --git a/boards/arm/nicenano/Kconfig.board b/boards/arm/nicenano/Kconfig.board new file mode 100644 index 0000000000000..c68f8ecb51682 --- /dev/null +++ b/boards/arm/nicenano/Kconfig.board @@ -0,0 +1,8 @@ +# nRF52840 DK NRF52840 board configuration + +# Copyright (c) 2016 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_NICENANO + bool "Nice!Nano" + depends on SOC_NRF52840_QIAA diff --git a/boards/arm/nicenano/Kconfig.defconfig b/boards/arm/nicenano/Kconfig.defconfig new file mode 100644 index 0000000000000..f56666ab62d08 --- /dev/null +++ b/boards/arm/nicenano/Kconfig.defconfig @@ -0,0 +1,14 @@ +# nRF52840 DK NRF52840 board configuration + +# Copyright (c) 2016 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NICENANO + +config BOARD + default "nicenano" + +config BT_CTLR + default BT + +endif # BOARD_NICENANO diff --git a/boards/arm/nicenano/board.cmake b/boards/arm/nicenano/board.cmake new file mode 100644 index 0000000000000..79e6ad42e2b4d --- /dev/null +++ b/boards/arm/nicenano/board.cmake @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 +set(OPENOCD_NRF5_SUBFAMILY "nrf52") +board_runner_args(jlink "--device=nrf52" "--speed=4000") +board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfjprog.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) diff --git a/boards/arm/nicenano/nicenano.dts b/boards/arm/nicenano/nicenano.dts new file mode 100644 index 0000000000000..c3a976f889a0a --- /dev/null +++ b/boards/arm/nicenano/nicenano.dts @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2017 Linaro Limited + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Nice!Nano"; + compatible = "nordic,adafruit,nicenano"; + + 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; + }; + +leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + label = "Red Led"; + }; +}; + + arduino_header: connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <2 0 &gpio0 2 0>, /* PIN_002 — P0.02 */ + <3 0 &gpio0 3 0>, /* PIN_003 — P0.03 */ + <4 0 &gpio0 4 0>, /* PIN_004 — P0.04 */ + <5 0 &gpio0 5 0>, /* PIN_005 — P0.05 */ + <6 0 &gpio0 6 0>, /* PIN_SERIAL1_TX + PIN_006 — P0.06 */ + <7 0 &gpio0 7 0>, /* PIN_007 — P0.07 */ + <8 0 &gpio0 8 0>, /* PIN_SERIAL1_RX + PIN_008 — P0.08 */ + <9 0 &gpio0 9 0>, /* PIN_009 — P0.09 */ + <10 0 &gpio0 10 0>, /* PIN_010 — P0.10 */ + <11 0 &gpio0 11 0>, /* PIN_011 — P0.11 */ + <12 0 &gpio0 12 0>, /* PIN_012 — P0.12 */ + <13 0 &gpio0 13 0>, /* PIN_013 — P0.13 */ + <14 0 &gpio0 14 0>, /* PIN_014 — P0.14 */ + <15 0 &gpio0 15 0>, /* PIN_015 — P0.15 */ + <16 0 &gpio0 16 0>, /* PIN_016 — P0.16 */ + <17 0 &gpio0 17 0>, /* PIN_017 — P0.17 */ + <18 0 &gpio0 18 0>, /* PIN_018 — P0.18 */ + <19 0 &gpio0 19 0>, /* PIN_019 — P0.19 */ + <20 0 &gpio0 20 0>, /* PIN_020 — P0.20 */ + <21 0 &gpio0 21 0>, /* PIN_021 — P0.21 */ + <22 0 &gpio0 22 0>, /* PIN_022 — P0.22 */ + <23 0 &gpio0 23 0>, /* PIN_023 — P0.23 */ + <24 0 &gpio0 24 0>, /* PIN_024 — P0.24 */ + <25 0 &gpio0 25 0>, /* PIN_025 — P0.25 */ + <26 0 &gpio0 26 0>, /* PIN_026 — P0.26 */ + <27 0 &gpio0 27 0>, /* PIN_027 — P0.27 */ + <28 0 &gpio0 28 0>, /* PIN_028 — P0.28 */ + <29 0 &gpio0 29 0>, /* PIN_029 — P0.29 */ + <30 0 &gpio0 30 0>, /* PIN_030 — P0.30 */ + <31 0 &gpio0 31 0>, /* PIN_031 — P0.31 */ + <32 0 &gpio1 0 0>, /* PIN_100 — P1.00 */ + <33 0 &gpio1 1 0>, /* PIN_101 — P1.01 */ + <34 0 &gpio1 2 0>, /* PIN_102 — P1.02 */ + <35 0 &gpio1 3 0>, /* PIN_103 — P1.03 */ + <36 0 &gpio1 4 0>, /* PIN_104 — P1.04 (SDA) */ + <37 0 &gpio1 5 0>, /* PIN_105 — P1.05 */ + <38 0 &gpio1 6 0>, /* PIN_106 — P1.06 (SCL) */ + <39 0 &gpio1 7 0>, /* PIN_107 — P1.07 (SS) */ + <40 0 &gpio1 8 0>, /* PIN_108 — P1.08 */ + <41 0 &gpio1 9 0>, /* PIN_109 — P1.09 */ + <42 0 &gpio1 10 0>, /* PIN_110 — P1.10 */ + <43 0 &gpio1 11 0>, /* PIN_111 — P1.11 (SCK) */ + <44 0 &gpio1 12 0>, /* PIN_112 — P1.12 */ + <45 0 &gpio1 13 0>, /* PIN_113 — P1.13 (MOSI) */ + <46 0 &gpio1 14 0>, /* PIN_114 — P1.14 */ + <47 0 &gpio1 15 0>; /* PIN_115 — P1.15 (MISO) */ + }; + + 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 { + led0 = &led0; + bootloader-led0 = &led0; + }; +}; + +&adc { + status = "okay"; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + status = "okay"; + current-speed = <115200>; + tx-pin = <6>; + rx-pin = <8>; + rx-pull-up; + rts-pin = <5>; + cts-pin = <7>; + cts-pull-up; +}; + +arduino_serial: &uart1 { + status = "okay"; + current-speed = <115200>; + rx-pin = <33>; + rx-pull-up; + tx-pin = <34>; +}; + +arduino_i2c: &i2c0 { + compatible = "nordic,nrf-twi"; + status = "okay"; + sda-pin = <36>; + scl-pin = <38>; +}; + +&i2c1 { + compatible = "nordic,nrf-twi"; + /* Cannot be used together with spi1. */ + /* status = "okay"; */ + sda-pin = <30>; + scl-pin = <31>; +}; + +&pwm0 { + status = "okay"; + ch0-pin = <13>; + ch0-inverted; +}; + +&spi0 { + compatible = "nordic,nrf-spi"; + /* Cannot be used together with i2c0. */ + /* status = "okay"; */ + sck-pin = <43>; + mosi-pin = <45>; + miso-pin = <47>; +}; + +&spi1 { + compatible = "nordic,nrf-spi"; + status = "okay"; + sck-pin = <31>; + mosi-pin = <30>; + miso-pin = <40>; +}; + +&spi2 { + compatible = "nordic,nrf-spi"; + status = "disabled"; + sck-pin = <19>; + mosi-pin = <20>; + miso-pin = <21>; +}; + +&qspi { + status = "okay"; + sck-pin = <19>; + io-pins = <20>, <21>, <22>, <23>; + csn-pins = <17>; + mx25r64: mx25r6435f@0 { + compatible = "nordic,qspi-nor"; + reg = <0>; + /* MX25R64 supports only pp and pp4io */ + writeoc = "pp4io"; + /* MX25R64 supports all readoc options */ + readoc = "read4io"; + sck-frequency = <8000000>; + label = "MX25R64"; + jedec-id = [c2 28 17]; + sfdp-bfp = [ + e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb + ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 + 10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 68 44 + 30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff + ]; + size = <67108864>; + has-dpd; + t-enter-dpd = <10000>; + t-exit-dpd = <35000>; + }; +}; + +arduino_spi: &spi3 { + status = "okay"; + sck-pin = <43>; + miso-pin = <47>; + mosi-pin = <45>; + cs-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; /* Pin 39 = P1.07 = SS */ +}; + +&flash0 { + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x000000000 0x0000C000>; + }; + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000C000 0x00067000>; + }; + slot1_partition: partition@73000 { + label = "image-1"; + reg = <0x00073000 0x00067000>; + }; + scratch_partition: partition@da000 { + label = "image-scratch"; + reg = <0x000da000 0x0001e000>; + }; + + /* + * 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>; + }; + }; +}; + +zephyr_udc0: &usbd { + compatible = "nordic,nrf-usbd"; + status = "okay"; +}; diff --git a/boards/arm/nicenano/nicenano.yaml b/boards/arm/nicenano/nicenano.yaml new file mode 100644 index 0000000000000..d3fde55de570f --- /dev/null +++ b/boards/arm/nicenano/nicenano.yaml @@ -0,0 +1,27 @@ +identifier: nicenano +name: nicenano +type: mcu +arch: arm +ram: 256 +flash: 1024 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - arduino_gpio + - arduino_i2c + - arduino_spi + - ble + - counter + - gpio + - i2c + - i2s + - ieee802154 + - pwm + - spi + - usb_cdc + - usb_device + - watchdog + - netif:openthread diff --git a/boards/arm/nicenano/nicenano_defconfig b/boards/arm/nicenano/nicenano_defconfig new file mode 100644 index 0000000000000..6911498b79153 --- /dev/null +++ b/boards/arm/nicenano/nicenano_defconfig @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_NICENANO=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable RTT +CONFIG_USE_SEGGER_RTT=y + +# enable GPIO +CONFIG_GPIO=y + +# enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# additional board options +CONFIG_GPIO_AS_PINRESET=y