Hi Support Team,
I tried the BLE communication with the Nordic UART Service (NUS) and used the code in the 'Bluetooth Low Energy Fundamentals Lesson 4 - Exercise 3' course.
The default MTU size was too small for my application. I preferred not to change the code in the hci_rpmsg on the netCore, so I added the below configuration on the appCore side:
1. In the files \bt-fund-main\lesson4\blefund_less4_exer3_solution\child_image\hci_rpmsg.conf:
#GATT_CLIENT needed for requesting ATT_MTU update CONFIG_BT_GATT_CLIENT=y #PHY update needed for updating PHY request CONFIG_BT_USER_PHY_UPDATE=y #For data length update CONFIG_BT_USER_DATA_LEN_UPDATE=y #This is the maximum data length with Nordic Softdevice controller CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 #These buffers are needed for the data length max. CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_ACL_RX_SIZE=251 #This is the maximum MTU size with Nordic Softdevice controller CONFIG_BT_L2CAP_TX_MTU=247 # Maxmum 2 connections are enough CONFIG_BT_MAX_CONN=2
2. In the \bt-fund-main\lesson4\blefund_less4_exer3_solution\prj.conf:
# # Copyright (c) 2018 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # Enable the UART driver CONFIG_UART_ASYNC_API=y CONFIG_NRFX_UARTE0=y CONFIG_SERIAL=y CONFIG_GPIO=y CONFIG_BT_NUS_UART_BUFFER_SIZE=400 # Make sure printk is printing to the UART console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Nordic_UART_Service" CONFIG_BT_DEVICE_APPEARANCE=833 CONFIG_BT_MAX_CONN=1 CONFIG_BT_MAX_PAIRED=1 CONFIG_BT_RX_STACK_SIZE=2048 # Enable the NUS service # STEP 1 - Enable the Kconfig symbol of the NUS service CONFIG_BT_NUS=y CONFIG_BT_NUS_AUTHEN=n CONFIG_BT_NUS_SECURITY_ENABLED=n # Enable bonding CONFIG_BT_SETTINGS=n CONFIG_FLASH=n CONFIG_FLASH_PAGE_LAYOUT=n CONFIG_FLASH_MAP=n CONFIG_NVS=n CONFIG_SETTINGS=n # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y # This example requires more workqueue stack CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # Config logger CONFIG_LOG=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_BACKEND_UART=n CONFIG_ASSERT=y #########################Added to increase the MTU############################### CONFIG_BT_GATT_CLIENT=y # STEP 8 - Enable PHY updates. CONFIG_BT_USER_PHY_UPDATE=y # STEP 12 - Update Data Length and MTU CONFIG_BT_USER_DATA_LEN_UPDATE=y #CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_BUF_ACL_RX_SIZE=251 CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_L2CAP_TX_MTU=247
But it did not work. Could you help me with the below questions:
(1). Could you help review the above configurations? what was missed for the MTU setting?
(2). I'm a little confused about the configuration alignment on the host and controller sides. For Data Length, MTU, and PHY_UPDATE, which need to align the configuration on both host and controller? which only needs to change single side configuration? In Lesson 3 – Exercise 2, it sets all in the host's prj.conf file.
Thank you very much,
Best regards,
Yanpeng Wu