Skip to main content
OliM
Senior II
November 12, 2025
Question

STM32WB BLE: How to accept a aci_l2cap_connection_update_req_event?

  • November 12, 2025
  • 2 replies
  • 195 views

I am currently working with an STM32WB05N as a co processor to a STM32U5, but I think the basic flow should be the same for all WB products. But I didn't find an AN or example for it.

My device is acting as a central and connecting to a (WB55 based) peripheral which uses aci_l2cap_connection_parameter_update_req. My central receives this though aci_l2cap_connection_update_req_event. So far so good.
But now I want to accept the proposal with aci_l2cap_connection_parameter_update_resp using the same parameters received through the request and Min_CE_Length as well as Max_CE_Length using the same values I used for the original connection opening (and 0x01 for accept). But I get a 0x12 BLE_ERROR_INVALID_HCI_CMD_PARAMS.
What am I doing wrong? (and is there example code for connection update somewhere?)

uint8_t s_Identifier;
uint16_t s_Connection_Interval_Min;
uint16_t s_Connection_Interval_Max;
uint16_t s_Max_Latency;
uint16_t s_Timeout_Multiplier;

void vPendableConnectResp( void * pvParameter1, uint32_t ulParameter2 )
{
 tBleStatus State;
 //accept whatever the peripheral wants
 State = aci_l2cap_connection_parameter_update_resp(s_ConnectionHandle,
 s_Connection_Interval_Min,
 s_Connection_Interval_Max,
 s_Max_Latency,
 s_Timeout_Multiplier,
 BLE_MINIMUM_CE,
 BLE_MAXIMUM_CE,
 s_Identifier,
 1);
 while(State != BLE_STATUS_SUCCESS);
}
void aci_l2cap_connection_update_req_event(uint16_t Connection_Handle,
 uint8_t Identifier,
 uint16_t L2CAP_Length,
 uint16_t Connection_Interval_Min,
 uint16_t Connection_Interval_Max,
 uint16_t Max_Latency,
 uint16_t Timeout_Multiplier)
{
 if(Connection_Handle == s_ConnectionHandle)
 {
 s_Identifier = Identifier;
 s_Connection_Interval_Min = Connection_Interval_Min;
 s_Connection_Interval_Max = Connection_Interval_Max;
 s_Max_Latency = Max_Latency;
 s_Timeout_Multiplier = Timeout_Multiplier;
 //pend to timer function to prevent recursion in task handler
 xTimerPendFunctionCall(vPendableConnectResp, NULL, 0, 0);
 }

}

2 replies

Technical Moderator
November 14, 2025

Hello @OliM ,

Please check this application note in "2.6 L2CAP commands" section that may help you:

AN6142 Introduction to the STM32WB0 Bluetooth® LE wireless interface.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
OliM
OliMAuthor
Senior II
November 18, 2025

What am I supposed to find there? The functions description is just the doxygen export of what I already saw in the code. But there is no description about the flow.
So the Questions remain the same:
1) What in the code above is wrong?
2) Is there example code for connection update somewhere?

ST Employee
November 19, 2025