-
Notifications
You must be signed in to change notification settings - Fork 8.4k
stm32wba : ble-802.15.4 concurrent mode integration #97773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vtardy-st
wants to merge
3
commits into
zephyrproject-rtos:main
Choose a base branch
from
vtardy-st:stm32wba_1_7_0_ble_802154_concurrent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
samples/boards/st/bluetooth/ble_hr_802154_echo_client/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| cmake_minimum_required(VERSION 3.20.0) | ||
|
|
||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(st_ble_802154_echo_client) | ||
|
|
||
| target_sources(app PRIVATE src/echo-client.c) | ||
| target_sources(app PRIVATE src/app_ble.c) | ||
| target_sources(app PRIVATE src/udp.c) | ||
|
|
||
| include(${ZEPHYR_BASE}/samples/net/common/common.cmake) |
69 changes: 69 additions & 0 deletions
69
samples/boards/st/bluetooth/ble_hr_802154_echo_client/README.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| .. zephyr:code-sample:: stm32_ble_hr_802154_echo_client | ||
| :name: BLE HR - 802154 Echo client (advanced) | ||
|
|
||
| Implement a Bluetooth |reg| Energy Heart Rate - IEEE 802154 client. | ||
| The BLE Heart Rate (HR) GATT Service generates dummy heart-rate | ||
| values and the 802154 echo client sends IP packets, waits for data | ||
| to be sent back, and verifies it. | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| The sample application implements a concurrent mode BLE - IEEE 802.15.4. | ||
| Both wireless protocols Bluetooth |reg| Energy and IEEE 802.15.4 coexist: | ||
| the application supports simultaneously one Bluetooth |reg| Energy connection | ||
| and one IEEE 802.15.4 connection. | ||
| The 802.15.4 part implements UDP client that will send IPv6 packets, | ||
| wait for the data to be sent back, and then verify it matches | ||
| the data that was sent. | ||
| The BLE part exposes the HR (Heart Rate) GATT Service. Once a device | ||
| connects, it will generate dummy heart-rate values. | ||
|
|
||
| The source code for this sample application can be found at: | ||
| :zephyr_file:`samples/boards/st/bluetooth/ble_hr_802154_echo_client`. | ||
|
|
||
| The IEEE 802.15.4 config of the sample enables support for native | ||
| IEEE 802.15.4 connectivity. | ||
| Note that by default IEEE 802.15.4 L2 uses unacknowledged communication. | ||
| To improve connection reliability, acknowledgments can be enabled with | ||
| shell command: ``ieee802154 ack set``. | ||
|
|
||
| Environment Setup | ||
| ***************** | ||
|
|
||
| This sample has been tested on the STMicroelectonics NUCLEO-WBA65RI board | ||
| (nucleo_wba65ri). | ||
| This board interacts simultaneously with another board embedding an | ||
| echo-server sample with the 802.15.4 overlay (nucleo_wba65ri) and a | ||
| smartphone supporting BLE Heart Rate. | ||
|
|
||
| Building and Running | ||
| ******************** | ||
|
|
||
etienne-lms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Build sample application like this: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/boards/st/bluetooth/ble_hr_802154_echo_client | ||
| :board: nucleo_wba65ri | ||
| :goals: build | ||
| :compact: | ||
|
|
||
| The LED 1 toggles while application is BLE advertising. Once a remote device | ||
| connects, the LED 1 turns ON and application will generate dummy heart-rate values. | ||
| Once remote device disconnects, the application restarts BLE advertising and LED 1 | ||
| toggles. | ||
|
|
||
| Simultaneously, IEEE 802.15.4 feature is enabled. To validate behavior, use another | ||
| board that will be used as a remote server. | ||
| This can be done using echo-server sample application with :file:`overlay-802154.conf`. | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/net/sockets/echo_server | ||
| :board: nucleo_wba65ri | ||
| :gen-args: -DEXTRA_CONF_FILE=overlay-802154.conf | ||
| :goals: build flash | ||
| :compact: | ||
|
|
||
| Once both devices are connected, local device will send IPv6 packets, wait for | ||
| the data to be sent back from the remote echo-server device, and then verify it | ||
| matches the data that was sent. | ||
71 changes: 71 additions & 0 deletions
71
samples/boards/st/bluetooth/ble_hr_802154_echo_client/prj.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Generic networking options | ||
| CONFIG_NETWORKING=y | ||
| CONFIG_NET_UDP=y | ||
| CONFIG_NET_IPV6=y | ||
| CONFIG_NET_IPV4=n | ||
| CONFIG_NET_SOCKETS=y | ||
| CONFIG_ZVFS_POLL_MAX=5 | ||
| CONFIG_NET_CONNECTION_MANAGER=y | ||
|
|
||
| CONFIG_POSIX_API=y | ||
|
|
||
| # Kernel options | ||
| CONFIG_MAIN_STACK_SIZE=2048 | ||
| CONFIG_ENTROPY_GENERATOR=y | ||
| CONFIG_TEST_RANDOM_GENERATOR=y | ||
| CONFIG_INIT_STACKS=y | ||
|
|
||
| # Logging | ||
| CONFIG_NET_LOG=y | ||
| CONFIG_LOG=y | ||
| CONFIG_NET_STATISTICS=y | ||
| CONFIG_PRINTK=y | ||
|
|
||
| # Network buffers | ||
| CONFIG_NET_PKT_RX_COUNT=16 | ||
| CONFIG_NET_PKT_TX_COUNT=16 | ||
| CONFIG_NET_BUF_RX_COUNT=80 | ||
| CONFIG_NET_BUF_TX_COUNT=80 | ||
| CONFIG_NET_CONTEXT_NET_PKT_POOL=y | ||
|
|
||
| # IP address options | ||
| CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3 | ||
| CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=4 | ||
| CONFIG_NET_MAX_CONTEXTS=10 | ||
| CONFIG_NET_IF_MAX_IPV6_COUNT=3 | ||
| CONFIG_NET_IF_MAX_IPV4_COUNT=3 | ||
|
|
||
| # Network shell | ||
| CONFIG_NET_SHELL=y | ||
|
|
||
| # Network Config | ||
| CONFIG_NET_CONFIG_SETTINGS=y | ||
| CONFIG_NET_CONFIG_NEED_IPV6=y | ||
| CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::2" | ||
| CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::1" | ||
| CONFIG_NET_CONFIG_NEED_IPV4=n | ||
| CONFIG_NET_CONFIG_MY_IPV4_ADDR="" | ||
| CONFIG_NET_CONFIG_PEER_IPV4_ADDR="" | ||
| CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 | ||
| CONFIG_NET_RX_STACK_SIZE=2048 | ||
|
|
||
| CONFIG_NET_L2_IEEE802154=y | ||
| CONFIG_NET_L2_IEEE802154_SHELL=y | ||
| CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y | ||
|
|
||
| CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26 | ||
|
|
||
| CONFIG_NET_L2_IEEE802154_FRAGMENT_REASS_CACHE_SIZE=5 | ||
|
|
||
|
|
||
| # Bluetootn configuration | ||
| CONFIG_BT=y | ||
| CONFIG_BT_SMP=y | ||
| CONFIG_BT_PERIPHERAL=y | ||
| CONFIG_BT_DIS=y | ||
| CONFIG_BT_DIS_PNP=n | ||
| CONFIG_BT_BAS=y | ||
| CONFIG_BT_HRS=y | ||
| CONFIG_BT_DEVICE_NAME="Zephyr HR 802154 Echo Client" | ||
| CONFIG_BT_DEVICE_APPEARANCE=833 | ||
| CONFIG_BT_STM32WBA_USE_TEMP_BASED_CALIB=y |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If 2 boards are required, please specify it here.