cancel
Showing results for 
Search instead for 
Did you mean: 

HCI_DISCONNECTION_COMPLETE_EVT_CODE not generated

BH.1
Associate II

I am running into some trouble with a STM32WB while using a custom GATT server and attempting to disconnect from an Android device. The core issue is that the CPU2 has turned on the HSE. This is known because the HSERDY bit is set while the HSEON bit is off. This is causing ~0.5mA of extra current draw.

 

Below is what I have investigated:

Scenario 1:

I am attempting to disconnect from an Android device by calling aci_gap_terminate(connectionHandle, 0x13) which returns 0x00. After terminating the connection I expect to see a HCI_DISCONNECTION_COMPLETE_EVT_CODE event generated in SVCCTL_App_Notification() as stated in an5270. The Android device observes and reacts to the disconnection. I believe this leaves CPU2 in a bad state as calling aci_hal_get_link_status(status, link_handle) returns 0x02 and the corresponding link handle. In an5270 a return status of 0x02 says that the STM32WB is connected in the peripheral role.

 

Is my understanding correct that I should see a HCI_DISCONNECTION_COMPLETE_EVT_CODE after calling aci_gap_terminate() with the correct handle?

Why am I seeing that the STM32WB is connected in the peripheral role when the connection to the Android device has been broken?

 

Scenario 2:

When I disconnect from the STM32WB55 through the Android ST BLE Toolbox app I do see the HCI_DISCONNECTION_COMPLETE_EVT_CODE event generated in the SVCCTL_App_Notification() function.

 

Why does one form of disconnection generate the HCI_DISCONNECTION_COMPLETE_EVT_CODE event but the other does not?

0 REPLIES 0