Skip to content

Commit 85995e5

Browse files
HoZHelcarlescufi
authored andcommitted
boards: shields: Add support for X-NUCLEO-BNRG2A1 shield
Add support for X-NUCLEO-BNRG2A1 which is a BLE expansion board based on the BLUENRG-M2SP. Signed-off-by: Ali Hozhabri <[email protected]>
1 parent d02f86a commit 85995e5

File tree

5 files changed

+140
-0
lines changed

5 files changed

+140
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SHIELD_X_NUCLEO_BNRG2A1
5+
6+
if BT
7+
8+
config SPI
9+
default y
10+
11+
choice BT_HCI_BUS_TYPE
12+
default BT_SPI
13+
endchoice
14+
15+
config BT_BLUENRG_ACI
16+
default y
17+
18+
# Disable Flow control
19+
config BT_HCI_ACL_FLOW_CONTROL
20+
default n
21+
22+
endif # BT
23+
24+
endif # SHIELD_X_NUCLEO_BNRG2A1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_X_NUCLEO_BNRG2A1
5+
def_bool $(shields_list_contains,x_nucleo_bnrg2a1)
Binary file not shown.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.. _x-nucleo-bnrg2a1:
2+
3+
X-NUCLEO-BNRG2A1: BLE expansion board
4+
#####################################
5+
6+
Overview
7+
********
8+
The X-NUCLEO-BNRG2A1 is a Bluetooth Low Energy evaluation board based on the
9+
BlueNRG-M2SP RF module to allow expansion of the STM32 Nucleo boards.
10+
The BlueNRG-M2SP module is FCC (FCC ID: S9NBNRGM2SP) and IC certified
11+
(IC: 8976C-BNRGM2SP).
12+
13+
The X-NUCLEO-BNRG2A1 is compatible with the ST Morpho and Arduino UNO R3
14+
connector layout (the user can mount the ST Morpho connectors, if required). The
15+
X-NUCLEO-BNRG2A1 interfaces with the host microcontroller via the SPI pins, and
16+
the user can change the default SPI clock, the SPI chip select and SPI IRQ by
17+
changing either one resistor or jumper on the evaluation board.
18+
19+
Note : This shield is compatible out of the box with Arduino UNO R3 connectors,
20+
but CS signal is not the standard Arduino SPI_CS signal.
21+
Please refer to "Hardware configuration" section.
22+
23+
.. image:: img/x-nucleo-bnrg2a1.webp
24+
:align: center
25+
:alt: X-NUCLEO-BNRG2A1
26+
27+
More information about the board can be found at the
28+
`X-NUCLEO-BNRG2A1 website`_.
29+
30+
Hardware configuration
31+
**********************
32+
33+
Out of the box, X-NUCLEO-BNRG2A1 shield expects SPI CS to be available on
34+
Arduino pin A1 instead of usual Arduino UNO R3 SPI CS D10.
35+
This is not a problem as CS signal is software driven gpio on Arduino A1
36+
see cs-gpios in x_nucleo_bnrg2a1.overlay
37+
38+
Shield configuration could be modified by moving resistors or changing jumper as
39+
follows:
40+
41+
- SPI SCK: to use D3 instead of D13, short J14 pins 2 and 3
42+
43+
Additionally, depending on your host board, some modifications of the BLE
44+
expansion board could be made:
45+
46+
- CS: To use D1 instead of A1, unmount R76 and mount R86
47+
48+
nucleo_l476rg does not need hardware modifications.
49+
50+
Hardware
51+
********
52+
53+
X-NUCLEO-BNRG2A1 provides a BlueNRG-M2SP chip with the following key features:
54+
55+
- Bluetooth v5.2 compliant
56+
- Embedded BALF-NRG-02D3 integrated matched balun with harmonic filter
57+
- BLE data packet length extension
58+
59+
More information about X-NUCLEO-BNRG2A1 can be found here:
60+
- `X-NUCLEO-BNRG2A1 databrief`_
61+
62+
Programming
63+
***********
64+
65+
You can use the X-NUCLEO-BNRG2A1 as a Bluetooth Low-Energy controller
66+
shield with an SPI host controller interface (HCI-SPI). Activate the presence
67+
of the shield for the project build by adding the ``-DSHIELD`` arg to the
68+
build command:
69+
70+
.. zephyr-app-commands::
71+
:zephyr-app: your_app
72+
:board: your_board_name
73+
:shield: x_nucleo_bnrg2a1
74+
:goals: build
75+
76+
Alternatively, set use of this shield in the project's ``CMakeLists.txt`` file:
77+
78+
.. code-block:: cmake
79+
80+
set(SHIELD x_nucleo_bnrg2a1)
81+
82+
References
83+
**********
84+
85+
.. target-notes::
86+
87+
.. _X-NUCLEO-BNRG2A1 website:
88+
https://www.st.com/en/ecosystems/x-nucleo-bnrg2a1.html
89+
90+
.. _X-NUCLEO-BNRG2A1 databrief:
91+
https://www.st.com/resource/en/data_brief/x-nucleo-bnrg2a1.pdf
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&arduino_spi {
8+
cs-gpios = <&arduino_header 1 GPIO_ACTIVE_LOW>; /* A1 */
9+
10+
bluenrg-2@0 {
11+
compatible = "st,hci-spi-v2";
12+
reg = <0>;
13+
reset-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */
14+
irq-gpios = <&arduino_header 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* A0 */
15+
spi-cpha; /* CPHA=1 */
16+
spi-hold-cs;
17+
spi-max-frequency = <DT_FREQ_M(1)>;
18+
reset-assert-duration-ms = <6>;
19+
};
20+
};

0 commit comments

Comments
 (0)