2022-06-30 08:20 AM
Hi,
My custom device with custom firmware don't respond to LL_FEATURE_REQ so the device disconnect.
The connectivity part of my project is very similar to the example BLE_p2p_server, the device start advertising and when I connect to it with the mobile app ST BLE TOOLBOX the connection fail, in wireshark I see the master device is sending LL_FEATURE_REQ but the device doesn't respond.
Can you please help me as I'm stuck for a week now?
I share with you the wireshark logs (remove the .csv extension)
MCU : STM32WB55
Stack: stm32wb5x_BLE_Stack_full_fw.bin v 1.13.1
Thanks by advance for the help.
Solved! Go to Solution.
2022-07-07 09:28 AM
Hello,
For the disconnection, the value 8 means Connection timeout and for return error of aci_gatt_update_char_value, the value 96 means Invalid handle. Maybe, you have a wrong configuration for the role, so the aci_gap_init isn't executed, check your configuration in ble_conf.h file.
Best Regards
2022-07-08 08:52 AM
The issue with the appearance char is resolved, I don't see any other error, but the connection still fail, most of time with error 3E:
user> ble open peripheral
(BLE) Device Information Service (DIS) is added Successfully 000C
(BLE) Manufacturer Name Characteristic Added Successfully 000D
(BLE) Model Number String Characteristic Added Successfully 000F
(BLE) Serial Number String Characteristic Added Successfully 0011
(BLE) Firmware Revision String Characteristic Added Successfully 0013
(BLE) Software Revision String Characteristic Added Successfully 0015
BLE opened
OK
user> ble connect start
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
OK
user> (BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x801
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x802
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x803
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
2022-07-11 06:04 AM
Hello,
The reason 0x3E means Connection Failed to be Established so it's difficult to understand your issue.
Which version of Android or IOS are you using ? And which version of ST BLE Toolbox are you using ? Can you check that you have the latest version please ?
Can you try to perform BLE Air trace to understand the reason of the disconnection ?
Best Regards
2022-07-11 06:25 AM
Hello,
I use:
ST BLE ToolBox v 1.2.1, on the 2 phones, it's the last version as I know.
I attached the wireshark logs, remove the extension ".txt" added to be abble to upload the file.
In this test I tried multiple times the connection, as you can see the app logs below, the first 5 tries failed with reason 8 then switched to reason 0x3E, After the 3 first tests I reset the device.
I used for this test the Xiaomi phone.
(BLE) Successfully Start Low Power Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x802
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x803
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x804
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
Welcome to AOS
(BLE) Wireless Firmware version 1.13.0
(BLE) Wireless Firmware build 5
(BLE) FUS version 1.1.0
(BLE) SHCI_SUB_EVT_CODE_READY - WIRELESS_FW_RUNNING
(BLE) DBGMCU_GetRevisionID= 2001
0d,00:00:00.000255. (APP) Starting application thread
login:
login: ***
user> ble open peri
(BLE) Device Information Service (DIS) is added Successfully 000C
(BLE) Manufacturer Name Characteristic Added Successfully 000D
(BLE) Model Number String Characteristic Added Successfully 000F
(BLE) Serial Number String Characteristic Added Successfully 0011
(BLE) Firmware Revision String Characteristic Added Successfully 0013
(BLE) Software Revision String Characteristic Added Successfully 0015
BLE opened
OK
user> ble connect start
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
OK
user> (BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x801
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x802
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x803
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x804
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0x805
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
2022-07-11 08:32 AM
2022-07-11 08:43 AM
2022-07-12 08:58 AM
Hello,
Can you try with another smartphone with a newer version of Android like Android 12 ?
Best Regards
2022-09-08 01:02 AM
Hello, sorry for the late response due to summer vacations.
I don't have a phone with android 12, but I tried with Iphone 12 IOS 15.6.1 and the result is the same:
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xba
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xbb
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xbc
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xbd
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xbe
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xbf
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xc0
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xc1
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xc2
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xc3
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xc4
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 3e
(BLE) First index in 0 state
(BLE) Successfully Start Fast Advertising
(BLE) HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE for connection handle 0xc5
(BLE)
** DISCONNECTION EVENT WITH CLIENT status 0 - Reason 8
2022-09-12 09:13 AM
Resolved by setting CFG_BLE_LSE_SOURCE to 1 in app_conf.h
Do you have more explanation?