diff --git a/boards/arm/da14695_dk_usb/Kconfig b/boards/arm/da14695_dk_usb/Kconfig new file mode 100644 index 00000000000..38ccd826507 --- /dev/null +++ b/boards/arm/da14695_dk_usb/Kconfig @@ -0,0 +1,4 @@ +# DA14695 Development Kit USB board configuration + +# Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates +# SPDX-License-Identifier: Apache-2.0 diff --git a/boards/arm/da14695_dk_usb/Kconfig.board b/boards/arm/da14695_dk_usb/Kconfig.board new file mode 100644 index 00000000000..67dbe731ffa --- /dev/null +++ b/boards/arm/da14695_dk_usb/Kconfig.board @@ -0,0 +1,8 @@ +# DA14695 Development Kit USB board configuration + +# Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_DA14695_DK_USB + bool "DA14695 Development Kit USB board" + depends on SOC_SERIES_DA1469X diff --git a/boards/arm/da14695_dk_usb/Kconfig.defconfig b/boards/arm/da14695_dk_usb/Kconfig.defconfig new file mode 100644 index 00000000000..8208a705bd8 --- /dev/null +++ b/boards/arm/da14695_dk_usb/Kconfig.defconfig @@ -0,0 +1,11 @@ +# DA14695 Development Kit USB board configuration + +# Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_DA14695_DK_USB + +config BOARD + default "da14695_dk_usb" + +endif # BOARD_DA14695_DK_USB diff --git a/boards/arm/da14695_dk_usb/board.cmake b/boards/arm/da14695_dk_usb/board.cmake new file mode 100644 index 00000000000..fc5981bb391 --- /dev/null +++ b/boards/arm/da14695_dk_usb/board.cmake @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 +# + +board_runner_args(ezflashcli) +board_runner_args(jlink --device=DA14695) +include(${ZEPHYR_BASE}/boards/common/ezflashcli.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/da14695_dk_usb/da14695_dk_usb-pinctrl.dtsi b/boards/arm/da14695_dk_usb/da14695_dk_usb-pinctrl.dtsi new file mode 100644 index 00000000000..d16ad945fa8 --- /dev/null +++ b/boards/arm/da14695_dk_usb/da14695_dk_usb-pinctrl.dtsi @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + uart_default: uart_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart2_default: uart2_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart3_default: uart3_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + i2c_default: i2c_default { + group1 { + pinmux = , + ; + bias-pull-up; + }; + }; + + i2c2_default: i2c2_default { + group1 { + pinmux = , + ; + bias-pull-up; + }; + }; + + spi_controller: spi_controller { + group1 { + pinmux = < SMARTBOND_PINMUX(SPI_CLK, 0, 21) >, + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; + + spi2_controller: spi2_controller { + group1 { + pinmux = < SMARTBOND_PINMUX(SPI2_CLK, 1, 3) >, + ; + output-enable; + }; + group2 { + pinmux = ; + input-enable; + }; + }; +}; diff --git a/boards/arm/da14695_dk_usb/da14695_dk_usb.dts b/boards/arm/da14695_dk_usb/da14695_dk_usb.dts new file mode 100644 index 00000000000..eff5299dcff --- /dev/null +++ b/boards/arm/da14695_dk_usb/da14695_dk_usb.dts @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "da14695_dk_usb-pinctrl.dtsi" +#include + +/ { + model = "DA14695 series Development Kit USB"; + compatible = "renesas,da14695_dk_usb"; + #address-cells = <1>; + #size-cells = <1>; + + chosen { + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &uart; + zephyr,shell-uart = &uart; + zephyr,code-partition = &slot0_partition; + }; + + leds { + compatible = "gpio-leds"; + red_led: led_0 { + gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + }; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpio0 6 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; + label = "Push button switch K1"; + zephyr,code = ; + }; + }; + + mikrobus_header{ + mikrobus-connector-1 { + compatible = "mikro-bus"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 25 0>, /* AN */ + /* Not a GPIO*/ /* RST */ + <2 0 &gpio1 2 0>, /* CS */ + <3 0 &gpio1 3 0>, /* SCK */ + <4 0 &gpio1 4 0>, /* MISO */ + <5 0 &gpio1 5 0>, /* MOSI */ + /* +3.3V */ + /* GND */ + <6 0 &gpio1 6 0>, /* PWM */ + <7 0 &gpio1 7 0>, /* INT */ + <8 0 &gpio1 8 0>, /* RX */ + <9 0 &gpio0 17 0>, /* TX */ + <10 0 &gpio0 18 0>, /* SCL */ + <11 0 &gpio0 19 0>; /* SDA */ + /* +5V */ + /* GND */ + }; + mikrobus-connector-2 { + compatible = "mikro-bus"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio1 9 0>, /* AN */ + /* Not a GPIO*/ /* RST */ + <2 0 &gpio0 20 0>, /* CS */ + <3 0 &gpio0 21 0>, /* SCK */ + <4 0 &gpio0 24 0>, /* MISO */ + <5 0 &gpio0 26 0>, /* MOSI */ + /* +3.3V */ + /* GND */ + <6 0 &gpio1 1 0>, /* PWM */ + <7 0 &gpio0 27 0>, /* INT */ + <8 0 &gpio0 28 0>, /* RX */ + <9 0 &gpio0 29 0>, /* TX */ + <10 0 &gpio0 30 0>, /* SCL */ + <11 0 &gpio0 31 0>; /* SDA */ + /* +5V */ + /* GND */ + }; + }; + + aliases { + led0 = &red_led; + watchdog0 = &wdog; + }; + + sysclk: system-clock { + compatible = "fixed-clock"; + clock-frequency = <32000000>; + #clock-cells = <0>; + }; +}; + +&flash0 { + reg = <0x16000000 DT_SIZE_M(1)>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * Flash area from 0x0000 to 0x2400 is reserved + * for product header added by flasher. + */ + + boot_partition: partition@2400 { + label = "mcuboot"; + reg = <0x000002400 0x00009c00>; + }; + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000c000 0x00076000>; + }; + slot1_partition: partition@80000 { + label = "image-1"; + reg = <0x00082000 0x00076000>; + }; + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 0x00008000>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&uart { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart_default>; + pinctrl-names = "default"; +}; + +&uart2 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart2_default>; + pinctrl-names = "default"; +}; + +&uart3 { + current-speed = <115200>; + status = "okay"; + pinctrl-0 = <&uart3_default>; + pinctrl-names = "default"; +}; + +zephyr_udc0: &usbd { + compatible = "renesas,smartbond-usbd"; + status = "okay"; +}; + +&rc32m { + status = "disabled"; +}; + +&xtal32m { + status = "okay"; +}; + +&xtal32k { + status = "okay"; +}; + +&lp_clk { + clock-src = <&xtal32k>; +}; + +&sys_clk { + clock-src = <&xtal32m>; +}; + +&pll { + status = "okay"; +}; +&i2c { + status = "okay"; + pinctrl-0 = <&i2c_default>; + pinctrl-names = "default"; +}; + +&i2c2 { + status = "okay"; + pinctrl-0 = <&i2c2_default>; + pinctrl-names = "default"; +}; + +&spi { + status = "okay"; + pinctrl-0 = <&spi_controller>; + pinctrl-names = "default"; +}; + +&spi2 { + status = "okay"; + pinctrl-0 = <&spi2_controller>; + pinctrl-names = "default"; +}; + +mikrobus_1_i2c: &i2c {}; + +mikrobus_1_spi: &spi {}; + +mikrobus_1_uart: &uart2 {}; + +mikrobus_2_i2c: &i2c2 {}; + +mikrobus_2_spi: &spi2 {}; + +mikrobus_2_uart: &uart3 {}; diff --git a/boards/arm/da14695_dk_usb/da14695_dk_usb.yaml b/boards/arm/da14695_dk_usb/da14695_dk_usb.yaml new file mode 100644 index 00000000000..1bb6100e339 --- /dev/null +++ b/boards/arm/da14695_dk_usb/da14695_dk_usb.yaml @@ -0,0 +1,16 @@ +identifier: da14695_dk_usb +name: DA14695_DK_USB +type: mcu +arch: arm +ram: 512 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - arduino_gpio + - gpio + - watchdog + - i2c + - spi + - usb_device diff --git a/boards/arm/da14695_dk_usb/da14695_dk_usb_defconfig b/boards/arm/da14695_dk_usb/da14695_dk_usb_defconfig new file mode 100644 index 00000000000..d0a67243034 --- /dev/null +++ b/boards/arm/da14695_dk_usb/da14695_dk_usb_defconfig @@ -0,0 +1,22 @@ +# +# Copyright (c) 2023 Renesas Electronics Corporation and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 +# + +CONFIG_SOC_SERIES_DA1469X=y +CONFIG_SOC_DA14695=y +CONFIG_BOARD_DA14695_DK_USB=y + +CONFIG_HW_STACK_PROTECTION=y + +CONFIG_GPIO=y + +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y + +CONFIG_BUILD_OUTPUT_HEX=n + +CONFIG_I2C=y +CONFIG_I2C_CALLBACK=y diff --git a/boards/arm/da14695_dk_usb/doc/da14695-00hqdevkt-u-usb-board.jpg b/boards/arm/da14695_dk_usb/doc/da14695-00hqdevkt-u-usb-board.jpg new file mode 100644 index 00000000000..1f0c6021e76 Binary files /dev/null and b/boards/arm/da14695_dk_usb/doc/da14695-00hqdevkt-u-usb-board.jpg differ diff --git a/boards/arm/da14695_dk_usb/doc/index.rst b/boards/arm/da14695_dk_usb/doc/index.rst new file mode 100644 index 00000000000..84f5c772d8a --- /dev/null +++ b/boards/arm/da14695_dk_usb/doc/index.rst @@ -0,0 +1,116 @@ +.. _da14695_dk_usb: + +DA14695 Development Kit USB +########################### + +Overview +******** + +The DA14695 Development Kit USB is a low cost development board for DA14695. +The development kit comes with an integrated debugger and an USB hub +to have both the on-chip USB and the J-Link connected via a single port. + +.. figure:: da14695-00hqdevkt-u-usb-board.jpg + :width: 442px + :align: center + :alt: DA14695 Development Kit USB + + DA14695 Development Kit USB (Credit: Renesas Electronics Corporation) + +Hardware +******** + +DA14695 Development Kit USB has two external oscillators. The frequency of +the sleep clock is 32768 Hz. The frequency of the system clock is 32 MHz. + +Supported Features +================== + +The _da14695_dk_usb board configuration supports the following +hardware features: + ++-----------+------------+----------------------+ +| Interface | Controller | Driver/Component | ++===========+============+======================+ +| FLASH | on-chip | flash | ++-----------+------------+----------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+----------------------+ +| MPU | on-chip | arch/arm | ++-----------+------------+----------------------+ +| NVIC | on-chip | arch/arm | ++-----------+------------+----------------------+ +| RTT | Segger | console | ++-----------+------------+----------------------+ +| UART | on-chip | serial | ++-----------+------------+----------------------+ +| SPI | on-chip | spi | ++-----------+------------+----------------------+ + +Other hardware features, including the Configurable MAC (CMAC) controller, +are currently not supported by the port. + +For more information about the DA14695 Development Kit see: + +- `DA14695 DK USB website`_ + +System Clock +============ + +The DA14695 Development Kit USB is configured to use the 32 MHz external oscillator +on the board. + +Connections and IOs +=================== + +The DA14695 Development Kit USB has one LED and one push button which can be used +by applications. The UART is connected to on-board serial converter and accessible +via USB1 port on motherboard. + +The pin connections are as follows: + +* LED (red), = P1.01 +* BUTTON, labeled k1 = P0.06 +* UART RX, connected to J-Link serial = P0.08 +* UART TX, connected to J-Link serial = P0.09 + +Programming and Debugging +************************* + +Applications for the ``da14695_dk_usb`` board configuration can be +built, flashed, and debugged in the usual way. See +:ref:`build_an_application` and :ref:`application_run` for more details on +building and running. + +Flashing +======== + +The DA14695 boots from an external flash connected to QSPI interface. The image +written to flash has to have proper header prepended. The process is simplified +by using dedicated `eZFlashCLI`_ tool that takes care of writing header and can +handle different types of flash chips connected to DA1469x MCU. Follow instructions +on `ezFlashCLI`_ to install the tool. Once installed, flashing can be done in the +usual way. + +.. zephyr-app-commands:: + :zephyr-app: samples/basic/blinky + :board: da14695_dk_usb + :goals: build flash + +Debugging +========= + +The DA14695 Development Kit USB includes a `J-Link`_ adaptor built-in +which provides both debugging interface and serial port. +Application can be debugged in the usual way once DA14695 Development Kit USB +is connected to PC via USB. + +References +********** + +.. target-notes:: + +.. _DA14695 DK USB website: https://www.renesas.com/us/en/products/wireless-connectivity/bluetooth-low-energy/da14695-00hqdevkt-u-smartbond-da14695-bluetooth-low-energy-52-usb-development-kit +.. _DA1469x Datasheet: https://www.renesas.com/eu/en/document/dst/da1469x-datasheet +.. _J-Link: https://www.segger.com/jlink-debug-probes.html +.. _ezFlashCLI: https://github.com/ezflash/ezFlashCLI/