diff --git a/boards/shields/x_nucleo_wb05kn1/Kconfig.defconfig b/boards/shields/x_nucleo_wb05kn1/Kconfig.defconfig new file mode 100644 index 00000000000..9ca34477181 --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/Kconfig.defconfig @@ -0,0 +1,33 @@ +# Copyright (c) 2024 STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_X_NUCLEO_WB05KN1_UART || SHIELD_X_NUCLEO_WB05KN1_SPI + +if BT + +config SPI + default y + depends on SHIELD_X_NUCLEO_WB05KN1_SPI + +config SPI_STM32_INTERRUPT + default y + depends on SPI + +config BT_SPI + default y + depends on DT_HAS_ST_HCI_SPI_V2_ENABLED + +config BT_H4 + default y + depends on DT_HAS_ZEPHYR_BT_HCI_UART_ENABLED + +config BT_BLUENRG_ACI + default y + +# Disable Flow control +config BT_HCI_ACL_FLOW_CONTROL + default n + +endif # BT + +endif # SHIELD_X_NUCLEO_WB05KN1_UART || SHIELD_X_NUCLEO_WB05KN1_SPI diff --git a/boards/shields/x_nucleo_wb05kn1/Kconfig.shield b/boards/shields/x_nucleo_wb05kn1/Kconfig.shield new file mode 100644 index 00000000000..2beed10e746 --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2024 STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_X_NUCLEO_WB05KN1_UART + def_bool $(shields_list_contains,x_nucleo_wb05kn1_uart) + +config SHIELD_X_NUCLEO_WB05KN1_SPI + def_bool $(shields_list_contains,x_nucleo_wb05kn1_spi) diff --git a/boards/shields/x_nucleo_wb05kn1/boards/nucleo_h563zi.overlay b/boards/shields/x_nucleo_wb05kn1/boards/nucleo_h563zi.overlay new file mode 100644 index 00000000000..3c16686fd63 --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/boards/nucleo_h563zi.overlay @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&spi1_sck_pa5 { + /delete-property/ bias-pull-down; + bias-pull-up; +}; + +&spi1_miso_pg9 { + slew-rate = "high-speed"; +}; + +&spi1_mosi_pb5 { + slew-rate = "high-speed"; +}; + +/ { + chosen { + zephyr,bt-c2h-uart = &usart3; + }; +}; diff --git a/boards/shields/x_nucleo_wb05kn1/boards/nucleo_u575zi_q.overlay b/boards/shields/x_nucleo_wb05kn1/boards/nucleo_u575zi_q.overlay new file mode 100644 index 00000000000..f6ff77a52c7 --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/boards/nucleo_u575zi_q.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&spi1_sck_pa5 { + /delete-property/ bias-pull-down; + bias-pull-up; +}; + +&spi1_miso_pa6 { + slew-rate = "high-speed"; +}; + +&spi1_mosi_pa7 { + slew-rate = "high-speed"; +}; + +&arduino_spi { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; +}; + +/ { + chosen { + zephyr,bt-c2h-uart = &usart1; + }; +}; diff --git a/boards/shields/x_nucleo_wb05kn1/doc/img/x-nucleo-wb05kn1.webp b/boards/shields/x_nucleo_wb05kn1/doc/img/x-nucleo-wb05kn1.webp new file mode 100644 index 00000000000..a9e58836e5c Binary files /dev/null and b/boards/shields/x_nucleo_wb05kn1/doc/img/x-nucleo-wb05kn1.webp differ diff --git a/boards/shields/x_nucleo_wb05kn1/doc/index.rst b/boards/shields/x_nucleo_wb05kn1/doc/index.rst new file mode 100644 index 00000000000..04f8bb5c052 --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/doc/index.rst @@ -0,0 +1,99 @@ +.. _x-nucleo-wb05kn1: + +X-NUCLEO-WB05KN1: BLE expansion board +##################################### + +Overview +******** +The X-NUCLEO-WB05KN1 is a Bluetooth Low Energy evaluation board which allows the +expansion of the STM32 Nucleo boards. +The RF module is FCC (FCC ID: YCP-MB203202) and IC certified (IC: 8976A-MB203202). + +The X-NUCLEO-WB05KN1 is compatible out of the box with the Arduino UNO R3 connector. +The board interfaces with the host microcontroller via UART (default) or SPI peripheral. + +.. image:: img/x-nucleo-wb05kn1.webp + :align: center + :alt: X-NUCLEO-WB05KN1 + +More information about the board can be found at the +`X-NUCLEO-WB05KN1 website`_. + +Configurations +************** + +X-NUCLEO-WB05KN1 can be utilized as a Bluetooth Low-Energy controller shield +with a UART or SPI host controller interface (HCI-UART/HCI-SPI). + +The UART default settings are: + +* Baudrate: 921600 bps +* 8 bits, no parity, 1 stop bit + ++----------+-----------------------+ +| UART Pin | Arduino Connector Pin | ++==========+=======================+ +| RX | D0 | ++----------+-----------------------+ +| TX | D1 | ++----------+-----------------------+ + +.. note:: + Please, bear in mind in order to use SPI interface you need to change the shield firmware + to ``DTM_SPI_WITH_UPDATER_CONTROLLER`` according to the SDK provided by ST at `X-CUBE-WB05N`_. + +IRQ and reset pins are also necessary in addition to SPI pins. + ++----------------+-----------------------+ +| SPI Config Pin | Arduino Connector Pin | ++================+=======================+ +| SCK | D13 | ++----------------+-----------------------+ +| MISO | D12 | ++----------------+-----------------------+ +| MOSI | D11 | ++----------------+-----------------------+ +| CS | D10 | ++----------------+-----------------------+ +| IRQ | A0 | ++----------------+-----------------------+ +| RESET | D7 | ++----------------+-----------------------+ + +More information about X-NUCLEO-WB05KN1 can be found here: + - `X-NUCLEO-WB05KN1 datasheet`_ + +Programming +*********** + +Activate the presence of the shield for the project build by adding the +``--shield x_nucleo_wb05kn1_uart`` or ``--shield x_nucleo_wb05kn1_spi`` when you invoke +``west build`` based on UART or SPI interface: + + .. zephyr-app-commands:: + :zephyr-app: your_app + :board: your_board_name + :shield: x_nucleo_wb05kn1_uart + :goals: build + +or + + .. zephyr-app-commands:: + :zephyr-app: your_app + :board: your_board_name + :shield: x_nucleo_wb05kn1_spi + :goals: build + +References +********** + +.. target-notes:: + +.. _X-NUCLEO-WB05KN1 website: + https://www.st.com/en/evaluation-tools/x-nucleo-wb05kn1.html + +.. _X-CUBE-WB05N: + https://www.st.com/en/embedded-software/x-cube-wb05n.html + +.. _X-NUCLEO-WB05KN1 datasheet: + https://www.st.com/resource/en/datasheet/stm32wb05kn.pdf diff --git a/boards/shields/x_nucleo_wb05kn1/x_nucleo_wb05kn1_spi.overlay b/boards/shields/x_nucleo_wb05kn1/x_nucleo_wb05kn1_spi.overlay new file mode 100644 index 00000000000..43cf2be0d2a --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/x_nucleo_wb05kn1_spi.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,bt-hci = &hci_spi; + }; +}; + +&arduino_spi { + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ + + hci_spi: wb05n@0 { + compatible = "st,hci-spi-v2"; + reg = <0>; + reset-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */ + irq-gpios = <&arduino_header 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* A0 */ + spi-cpol; /* CPOL=1 */ + spi-cpha; /* CPHA=1 */ + spi-hold-cs; + spi-max-frequency = ; /* the maximum supported SPI speed */ + reset-assert-duration-ms = <6>; + status = "okay"; + }; +}; diff --git a/boards/shields/x_nucleo_wb05kn1/x_nucleo_wb05kn1_uart.overlay b/boards/shields/x_nucleo_wb05kn1/x_nucleo_wb05kn1_uart.overlay new file mode 100644 index 00000000000..a0ae0ca0e8b --- /dev/null +++ b/boards/shields/x_nucleo_wb05kn1/x_nucleo_wb05kn1_uart.overlay @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + chosen { + zephyr,bt-hci = &bt_hci_uart; + }; +}; + +&arduino_serial { + current-speed = <921600>; + + bt_hci_uart: bt_hci_uart { + compatible = "zephyr,bt-hci-uart"; + status = "okay"; + }; +};