Skip to content

Commit

Permalink
samples: boards: stm32: Add a sample to support ST BlueNRG GUI app
Browse files Browse the repository at this point in the history
Introduce a sample for BlueNRG-based devices to support interaction with
ST BlueNRG GUI application based on U(S)ART protocol.

Signed-off-by: Ali Hozhabri <[email protected]>
  • Loading branch information
HoZHel authored and carlescufi committed Jun 10, 2024
1 parent 569183b commit d500a3f
Show file tree
Hide file tree
Showing 5 changed files with 534 additions and 0 deletions.
8 changes: 8 additions & 0 deletions samples/boards/stm32/bluetooth/interactive_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(st_interactive_gui)

target_sources(app PRIVATE src/main.c)
37 changes: 37 additions & 0 deletions samples/boards/stm32/bluetooth/interactive_gui/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. _samples_boards_stm32_bluetooth_interactive-gui:
.. zephyr:code-sample:: st_bluetooth_interactive_gui
:name: Bluetooth: ST Interactive GUI
:relevant-api: bluenrg_hci_driver bluetooth

Expose ST BlueNRG Bluetooth network coprocessor over UART

Overview
*********

Expose the Bluetooth network coprocessor via UART to a PC to be used
with the ST BlueNRG GUI app. In this case, the main MCU becomes an intermediate level,
and it passes the data between the host (PC) and controller.

Requirements
************

* A board based on BlueNRG BLE module such as :ref:`disco_l475_iot1_board`
* `BlueNRG GUI`_ application installed on your PC

Default UART settings
*********************

It depends on the board default settings for ``zephyr,bt-c2h-uart`` DTS property.
The UART default settings are:

* Baudrate: 115200 bps
* 8 bits, no parity, 1 stop bit

Building and Running
********************

This sample can be found under :zephyr_file:`samples/boards/stm32/bluetooth/interactive_gui` in the
Zephyr tree.

.. _BlueNRG GUI:
https://www.st.com/en/embedded-software/stsw-bnrgui.html
15 changes: 15 additions & 0 deletions samples/boards/stm32/bluetooth/interactive_gui/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONFIG_CONSOLE=n
CONFIG_STDOUT_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_H4=y
CONFIG_BT_HCI_RAW_H4_ENABLE=y
CONFIG_BT_BUF_ACL_RX_SIZE=255
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
CONFIG_BT_BLUENRG_ACI=n
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
12 changes: 12 additions & 0 deletions samples/boards/stm32/bluetooth/interactive_gui/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sample:
name: Bluetooth ST Interactive GUI
description: Allows BlueNRG-based boards to connect to BlueNRG GUI application via UART
tests:
sample.boards.stm32.bluetooth.interactive_gui:
harness: bluetooth
platform_allow:
- sensortile_box_pro
- disco_l475_iot1
tags:
- uart
- bluetooth
Loading

0 comments on commit d500a3f

Please sign in to comment.