Hi!
I am attempting to configure a nrf5340 dk as a central to receive BLE notifications. The code is based on the central_hr sample.
The notifications i am attempting to receive are 20 bytes of accelerometer data sent every 1000ms from another development kit and and works fine to read with an iOS app and STM32WB CubeMonRF.
I consistently get this error after gatt_write_ccc is executed(including thread analyzer output):
I have attempted to adjusting the stack size of multiple threads to various amounts with no luck, which has been the solution to similar problems i found.
Modifications from the central_hr sample are:
- Devices are filtered by name and connects to the device with a matching complete name
- Discovery is skipped, and subscribe_params are defined directly in the code (defined based on this)
prf.conf:
CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y CONFIG_BT_GATT_CLIENT=y #CONFIG_BT_RX_STACK_SIZE=2048 CONFIG_BT_AUTO_PHY_UPDATE=y CONFIG_BT_AUTO_DATA_LEN_UPDATE=y CONFIG_BT_BUF_ACL_RX_SIZE=502 CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_CONN_TX_MAX=10 CONFIG_BT_L2CAP_TX_BUF_COUNT=10 CONFIG_BT_L2CAP_TX_MTU=498 CONFIG_BT_BUF_ACL_TX_SIZE=502 CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_DK_LIBRARY=y CONFIG_DK_LIBRARY_DYNAMIC_BUTTON_HANDLERS=y #CONFIG_MAIN_STACK_SIZE=1024 CONFIG_HEAP_MEM_POOL_SIZE=2048 # This example requires more workqueue stack CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_BT_RX_STACK_SIZE=4096 CONFIG_LOG_MODE_MINIMAL=n CONFIG_LOG_BACKEND_UART=y # GATT debug messages CONFIG_BT_DEBUG_GATT=y CONFIG_THREAD_NAME=y CONFIG_THREAD_ANALYZER=y CONFIG_THREAD_ANALYZER_USE_PRINTK=y CONFIG_THREAD_ANALYZER_AUTO=y CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
hci_rpmsg.conf:
CONFIG_BT_DEBUG_LOG=y #CONFIG_BT_RX_STACK_SIZE=2048 #CONFIG_MAIN_STACK_SIZE=1024 #CONFIG_HEAP_MEM_POOL_SIZE=2048 # This example requires more workqueue stack #CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 #CONFIG_BT_BUF_ACL_TX_SIZE=251 #CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 #CONFIG_BT_BUF_ACL_RX_SIZE=251 # # Copyright (c) 2021 Nordic Semiconductor # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # From throughput example CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=4000000 CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 CONFIG_BT_BUF_ACL_RX_SIZE=502 CONFIG_BT_BUF_ACL_TX_SIZE=502 CONFIG_BT_MAX_CONN=2 CONFIG_BT_RX_STACK_SIZE=8192 CONFIG_THREAD_NAME=y CONFIG_THREAD_ANALYZER=y CONFIG_THREAD_ANALYZER_USE_PRINTK=y CONFIG_THREAD_ANALYZER_AUTO=y CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
Best Regards,
Tor Egil