From 1f9f140c741dbd0e23ba1651ef5881046ce45635 Mon Sep 17 00:00:00 2001 From: Sven Herrmann Date: Sun, 5 Feb 2023 12:25:57 +0100 Subject: [PATCH] boards: acn52832: Add support for acn52832 The aconno acn52832 is a small module featuring the nRF52832 SOC. Signed-off-by: Sven Herrmann --- CODEOWNERS | 1 + boards/arm/acn52832/Kconfig.board | 8 ++ boards/arm/acn52832/Kconfig.defconfig | 14 +++ boards/arm/acn52832/acn52832-pinctrl.dtsi | 21 ++++ boards/arm/acn52832/acn52832.dts | 88 ++++++++++++++ boards/arm/acn52832/acn52832.yaml | 10 ++ boards/arm/acn52832/acn52832_defconfig | 23 ++++ boards/arm/acn52832/board.cmake | 6 + boards/arm/acn52832/doc/index.rst | 134 ++++++++++++++++++++++ boards/arm/acn52832/pre_dt_board.cmake | 7 ++ 10 files changed, 312 insertions(+) create mode 100644 boards/arm/acn52832/Kconfig.board create mode 100644 boards/arm/acn52832/Kconfig.defconfig create mode 100644 boards/arm/acn52832/acn52832-pinctrl.dtsi create mode 100644 boards/arm/acn52832/acn52832.dts create mode 100644 boards/arm/acn52832/acn52832.yaml create mode 100644 boards/arm/acn52832/acn52832_defconfig create mode 100644 boards/arm/acn52832/board.cmake create mode 100644 boards/arm/acn52832/doc/index.rst create mode 100644 boards/arm/acn52832/pre_dt_board.cmake diff --git a/CODEOWNERS b/CODEOWNERS index b8fc0672056..9646139b0eb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -99,6 +99,7 @@ /boards/arm/96b_stm32_sensor_mez/ @Mani-Sadhasivam /boards/arm/96b_wistrio/ @Mani-Sadhasivam /boards/arm/arduino_due/ @ioannisg +/boards/arm/acn52832/ @sven-hm /boards/arm/bbc_microbit_v2/ @LingaoM /boards/arm/bl5340_dvk/ @lairdjm /boards/arm/bl65*/ @lairdjm diff --git a/boards/arm/acn52832/Kconfig.board b/boards/arm/acn52832/Kconfig.board new file mode 100644 index 00000000000..6e19e79560a --- /dev/null +++ b/boards/arm/acn52832/Kconfig.board @@ -0,0 +1,8 @@ +# aconno acn52832 board configuration + +# Copyright (c) 2023 Sven Herrmann +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ACN52832 + bool "aconno ACN52832" + depends on SOC_NRF52832_QFAA diff --git a/boards/arm/acn52832/Kconfig.defconfig b/boards/arm/acn52832/Kconfig.defconfig new file mode 100644 index 00000000000..e389aadf6e7 --- /dev/null +++ b/boards/arm/acn52832/Kconfig.defconfig @@ -0,0 +1,14 @@ +# aconno acn52832 board configuration + +# Copyright (c) 2023 Sven Herrmann +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_ACN52832 + +config BOARD + default "acn52832" + +config BT_CTLR + default BT + +endif # BOARD_ACN52832 diff --git a/boards/arm/acn52832/acn52832-pinctrl.dtsi b/boards/arm/acn52832/acn52832-pinctrl.dtsi new file mode 100644 index 00000000000..05590a893fd --- /dev/null +++ b/boards/arm/acn52832/acn52832-pinctrl.dtsi @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Sven Herrmann + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = , + ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/boards/arm/acn52832/acn52832.dts b/boards/arm/acn52832/acn52832.dts new file mode 100644 index 00000000000..1e01221f652 --- /dev/null +++ b/boards/arm/acn52832/acn52832.dts @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 Sven Herrmann + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "acn52832-pinctrl.dtsi" + +/ { + model = "Aconno ACN52832 Module"; + compatible = "aconno,acn52832"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,bt-mon-uart = &uart0; + zephyr,bt-c2h-uart = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led0; + watchdog0 = &wdt0; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; + label = "LD1A red"; + }; + led1: led_1 { + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + label = "LD1B green"; + }; + led2: led_2 { + gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; + label = "LD1C blue"; + }; + }; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&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>; + }; + }; +}; diff --git a/boards/arm/acn52832/acn52832.yaml b/boards/arm/acn52832/acn52832.yaml new file mode 100644 index 00000000000..72e04b829f9 --- /dev/null +++ b/boards/arm/acn52832/acn52832.yaml @@ -0,0 +1,10 @@ +identifier: acn52832 +name: aconno acn52832 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb + - xtools +ram: 64 +flash: 512 diff --git a/boards/arm/acn52832/acn52832_defconfig b/boards/arm/acn52832/acn52832_defconfig new file mode 100644 index 00000000000..6b1ae1a7ba7 --- /dev/null +++ b/boards/arm/acn52832/acn52832_defconfig @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52832_QFAA=y +CONFIG_BOARD_ACN52832=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# enable GPIO +CONFIG_GPIO=y + +# enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable P0_21 as RST +CONFIG_GPIO_AS_PINRESET=y + +CONFIG_PINCTRL=y diff --git a/boards/arm/acn52832/board.cmake b/boards/arm/acn52832/board.cmake new file mode 100644 index 00000000000..ddd57ab8839 --- /dev/null +++ b/boards/arm/acn52832/board.cmake @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(nrfjprog "--nrf-family=NRF52") +board_runner_args(jlink "--device=nrf52" "--speed=4000") +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/acn52832/doc/index.rst b/boards/arm/acn52832/doc/index.rst new file mode 100644 index 00000000000..d40bc402f16 --- /dev/null +++ b/boards/arm/acn52832/doc/index.rst @@ -0,0 +1,134 @@ +.. _acn52832: + +acn52832 +######## + +Overview +******** + +The acn52832 is a module in a small form factor which features the Nordic Semiconductor +nRF52832 ARM Cortex-M4F CPU and the following devices: + +* :abbr:`ADC (Analog to Digital Converter)` +* CLOCK +* FLASH +* :abbr:`GPIO (General Purpose Input Output)` +* :abbr:`I2C (Inter-Integrated Circuit)` +* :abbr:`MPU (Memory Protection Unit)` +* :abbr:`NVIC (Nested Vectored Interrupt Controller)` +* :abbr:`PWM (Pulse Width Modulation)` +* RADIO (Bluetooth Low Energy) +* :abbr:`RTC (nRF RTC System Clock)` +* :abbr:`SPI (Serial Peripheral Interface)` +* :abbr:`UART (Universal asynchronous receiver-transmitter)` +* :abbr:`WDT (Watchdog Timer)` + +See `acn52832 website`_ for more information about the board and `Nordic infocenter`_ for more +information about the SoC. + +Hardware +******** + +Additionally to the SoC the board provides an on-board antenna with a RF matching circuit, +two external oscillators with 32 MHz and 32.768 kHz, load capacitors, a tag-connector +and a RGB-LED. + +Connections +=========== + +Pinout +------ + ++-------+-------------+--------------------+---------------+ +| PIN # | Tag-Connect | NRF52832 Functions | Configuration | ++=======+=============+====================+===============+ +| 1 | 5 | GND | | ++-------+-------------+--------------------+---------------+ +| 2 | | P0.25 | | ++-------+-------------+--------------------+---------------+ +| 3 | | P0.26 | | ++-------+-------------+--------------------+---------------+ +| 4 | | P0.27 | | ++-------+-------------+--------------------+---------------+ +| 5 | | P0.28/AIN4 | | ++-------+-------------+--------------------+---------------+ +| 6 | | P0.29/AIN5 | | ++-------+-------------+--------------------+---------------+ +| 7 | | P0.30/AIN6 | | ++-------+-------------+--------------------+---------------+ +| 8 | | P0.31 | | ++-------+-------------+--------------------+---------------+ +| 9 | | P0.02/AIN0 | | ++-------+-------------+--------------------+---------------+ +| 10 | | P0.03/AIN1 | | ++-------+-------------+--------------------+---------------+ +| 11 | | P0.04/AIN2 | | ++-------+-------------+--------------------+---------------+ +| 12 | 5 | GND | | ++-------+-------------+--------------------+---------------+ +| 13 | 5 | GND | | ++-------+-------------+--------------------+---------------+ +| 14 | | P0.05/AIN3 | | ++-------+-------------+--------------------+---------------+ +| 15 | | P0.06 | UART_RX | ++-------+-------------+--------------------+---------------+ +| 16 | | P0.07 | UART_TX | ++-------+-------------+--------------------+---------------+ +| 17 | | P0.08 | | ++-------+-------------+--------------------+---------------+ +| 18 | | NFC1/P0.09 | | ++-------+-------------+--------------------+---------------+ +| 19 | | NFC2/P0.10 | | ++-------+-------------+--------------------+---------------+ +| 20 | | P0.11 | | ++-------+-------------+--------------------+---------------+ +| 21 | | P0.12 | | ++-------+-------------+--------------------+---------------+ +| 22 | | P0.14/TRACEDATA[3] | | ++-------+-------------+--------------------+---------------+ +| 23 | 1 | VCC | | ++-------+-------------+--------------------+---------------+ +| 24 | 1 | VCC | | ++-------+-------------+--------------------+---------------+ +| 25 | | P0.15/TRACEDATA[2] | | ++-------+-------------+--------------------+---------------+ +| 26 | | P0.16/TRACEDATA[1] | | ++-------+-------------+--------------------+---------------+ +| 27 | | P0.17 | | ++-------+-------------+--------------------+---------------+ +| 28 | 6 | P0.18/TRACEDATA[0] | | ++-------+-------------+--------------------+---------------+ +| 29 | | P0.19 | | ++-------+-------------+--------------------+---------------+ +| 30 | | P0.20/TRACECLK | | ++-------+-------------+--------------------+---------------+ +| 31 | 3 | P0.21/RESET | | ++-------+-------------+--------------------+---------------+ +| 32 | 1 | VCC | | ++-------+-------------+--------------------+---------------+ +| 33 | 2 | SWDIO | | ++-------+-------------+--------------------+---------------+ +| 34 | 4 | SWDCLK | | ++-------+-------------+--------------------+---------------+ +| 35 | 5 | GND | | ++-------+-------------+--------------------+---------------+ + +RGB-LED +------- + ++------+-------+--------------+ +| LED | Color | NRF52832 Pin | ++======+=======+==============+ +| led0 | red | P0.22 | ++------+-------+--------------+ +| led1 | green | P0.24 | ++------+-------+--------------+ +| led2 | blue | P0.23 | ++------+-------+--------------+ + +References +********** +.. target-notes:: + +.. _acn52832 website: https://aconno.de/products/acn52832/ +.. _Nordic infocenter: https://infocenter.nordicsemi.com/ diff --git a/boards/arm/acn52832/pre_dt_board.cmake b/boards/arm/acn52832/pre_dt_board.cmake new file mode 100644 index 00000000000..3369c21d3af --- /dev/null +++ b/boards/arm/acn52832/pre_dt_board.cmake @@ -0,0 +1,7 @@ +# Copyright (c) 2022 Nordic Semiconductor +# SPDX-License-Identifier: Apache-2.0 + +# Suppress "unique_unit_address_if_enabled" to handle the following overlaps: +# - power@40000000 & clock@40000000 & bprot@40000000 +# - acl@4001e000 & flash-controller@4001e000 +list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")