samples: logging: Add support for UART over Bluetooth LE NUS

Tested and working with nrf52840dk/nrf52840.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
This commit is contained in:
Luis Ubieda 2024-03-06 13:48:13 -05:00 committed by Carles Cufí
parent 0beefffd1b
commit 1347a7e820
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,17 @@
/*
* Copyright (c) 2024 Croxel, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
chosen {
zephyr,console = &bt_nus_console_uart;
};
bt_nus_console_uart: bt_nus_console_uart {
compatible = "zephyr,nus-uart";
rx-fifo-size = <1024>;
tx-fifo-size = <1024>;
};
};

View File

@ -0,0 +1,16 @@
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_NUS=y
CONFIG_UART_BT=y
CONFIG_BT_NUS_AUTO_START_BLUETOOTH=y
# Bluetooth optimizations to allow larger data packets.
CONFIG_BT_RX_STACK_SIZE=2048
CONFIG_BT_L2CAP_TX_MTU=512
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_BUF_ACL_TX_SIZE=502
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

View File

@ -29,6 +29,21 @@ tests:
- CONFIG_LOG_BACKEND_RTT=y
- CONFIG_USE_SEGGER_RTT=y
sample.logger.bt:
platform_allow:
- nrf52840dk/nrf52840
integration_platforms:
- nrf52840dk/nrf52840
tags:
- logging
- bluetooth
filter: CONFIG_DT_HAS_ZEPHYR_NUS_UART_ENABLED
arch_exclude:
- posix
extra_args:
- OVERLAY_CONFIG="overlay-bt.conf"
- DTC_OVERLAY_FILE="bt.overlay"
sample.logger.usermode:
integration_platforms:
- mps2/an385