espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.51k stars 7.26k forks source link

Max TCB for gatt_if reached (IDFGH-2109) #4271

Closed wcauchois closed 4 years ago

wcauchois commented 4 years ago

Environment

Problem Description

I have an application that's acting as a BLE GATT client and connecting to up to 3 peripherals. Sometimes I get the following log message:

E (614233) BT_GATT: Max TCB for gatt_if [5] reached.

Where 5 is one of the client interfaces. After this, GATTC opens on that interface fail repeatedly. Does anyone know what this error message means or how I can investigate this further?

Alvin1Zhang commented 4 years ago

@wcauchois Thanks for reporting the issue. Would you please help provide more details as suggested in the issue template? Information like elf, sdk configuration, backtrace, log outputs, commit ID, and etc. would help us debug further. Thanks.

wcauchois commented 4 years ago

Thanks for the reply @Alvin1Zhang. Here's my sdkconfig and some more comprehensive logs: https://gist.github.com/wcauchois/f0d0df5d26c19f24b895b1c5d1f84936

To give some color to the logs: my code is pretty similar to the GATT client tutorial, wherein I maintain a profile_tab with the connection ID. To sanity check things, I have those STATUS logs which just print out the profile tab gatt IFs and conn IDs every second.

GYC-Espressif commented 4 years ago

Hello. Sorry for the late reply. From your sdkconfig and logs, I found you try to connect more than four devices but config in menuconfig is just for four, so you can not connect the device and got the error log "Max TCB for gatt_if reached". If you want to connect more than four devices you need to change the menuconfig of both host option → Component config → Bluetooth → Bluedroid Options → BT/BLE MAX ACL CONNECTIONS(1~7)and controller option → Component config → Bluetooth → Bluetooth controller → BLE Max Connections.

Alvin1Zhang commented 4 years ago

@wcauchois Thanks for reporting, will close due to short of feedback, feel free to reopen with more details. Thanks.