BLE connect / immediate disconnect

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaBr_4777916
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Trying to network BLE devices configured in both central/peripheral roles.  A connection problem occurs (infrequently) whereby a peripheral will connect to a central device and then immediately disconnect (before CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT is called).  Disconnect reason 62 is given.  Timing the connect / disconnect events shows there is ~140ms between them, and since the min/max connection intervals are set to 20/30ms on all devices, this suggests the peripheral/slave is not responding to the central/master connection attempts immediately after first connection.  The devices are very close together and there does not seem to be an rssi problem.  I've removed most additional code that I thought could be interfering with the timing of BLE event processing.  Any suggestion on what the problem might be and/or how to debug it?

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

The error "CONNECTION FAILED TO BE ESTABLISHED (0x3E)" indicates that the LL initiated a connection but the connection has failed to be established.
1. Please ensure that the BLE subsystem (BLESS) interrupt has the highest priority.
2. Also, please check on how frequently you are calling Cy_Ble_ProcessEvents() function ? This function must be called at least once for every connection interval or scan interval, whichever is smaller. This function checks the internal task queue in the BLE Stack, and pending operations of the BLE Stack, if any. If you are not calling Cy_Ble_ProcessEvents() function for enough time in the FW, then you can set a timer and call the Cy_Ble_ProcessEvents function inside it.
If you are still facing the issue then please share your project so that we can check at our end.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
3 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

The error "CONNECTION FAILED TO BE ESTABLISHED (0x3E)" indicates that the LL initiated a connection but the connection has failed to be established.
1. Please ensure that the BLE subsystem (BLESS) interrupt has the highest priority.
2. Also, please check on how frequently you are calling Cy_Ble_ProcessEvents() function ? This function must be called at least once for every connection interval or scan interval, whichever is smaller. This function checks the internal task queue in the BLE Stack, and pending operations of the BLE Stack, if any. If you are not calling Cy_Ble_ProcessEvents() function for enough time in the FW, then you can set a timer and call the Cy_Ble_ProcessEvents function inside it.
If you are still facing the issue then please share your project so that we can check at our end.

Thanks,
P Yugandhar.

0 Likes
lock attach
Attachments are accessible only for community members.
DaBr_4777916
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Thanks.  Thanks, the BLE subsystem is being run in 'dualcore' mode, with interrupt priorities shown in the attached image.  The scan/connection intervals are set to 25/20-30ms, and Cy_Ble_ProcessEvents() function is being called on both M0 and M4 cores every few ms.  Could the 'dualcore' operation be causing the problem?

0 Likes
DaBr_4777916
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Sorry, I wasn't aware that 'dualcore' mode is a standard means of implementing the BLE event handler in PSoC6.  Also, it appears CONNECTION FAILED TO BE ESTABLISHED only occurs on device reset before connection is correctly established, and is therefore not affecting desired device operation.  I'll use a packet sniffer to clarify why this particular connection issue occurs, and not take any more of your time with this issue.

0 Likes