Skip to main content
KKIM.6
Senior
January 3, 2025
Solved

Fail: aci_gap_set_security_requirements command, result: 0x11 error

  • January 3, 2025
  • 1 reply
  • 790 views

Hi. I have a problem with the STM32WB09KE board.

I'm trying to activate Bluetooth LE using this developer board but the BLE init function returns this error massage.

 

Success: aci_hal_write_config_data command - CONFIG_DATA_PUBADDR_OFFSET
Success: aci_hal_set_tx_power_level command
Success: aci_gatt_srv_profile_init command
Success: aci_gap_init command
Public Bluetooth Address: 00:08:e1:2a:12:34
Success: Gap_profile_set_dev_name - Device Name
Success: Gap_profile_set_appearance - Appearance
Success: aci_gap_set_io_capability command
Fail: aci_gap_set_security_requirements command, result: 0x11
==>> End BLE_Init function

Services and Characteristics creation
Success: aci_gatt_srv_add_service command: WB09KES
End of Services and Characteristics Creation 

 

Is there anyone who knows about this? and How to solve this.

In the code, the input value of aci_gap_set_security_requirements() is below.

I don't think this code is wrong because CubeMX automatically makes it.

 

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION;

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = CFG_ENCRYPTION_KEY_SIZE_MIN;

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = CFG_ENCRYPTION_KEY_SIZE_MAX;

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = CFG_BONDING_MODE;

 

ret = aci_gap_set_security_requirements(bleAppContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode,

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode,

CFG_SC_SUPPORT,

CFG_KEYPRESS_NOTIFICATION_SUPPORT,

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin,

bleAppContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax,

GAP_PAIRING_RESP_NONE);

 

 

Best answer by STTwo-32

Hello @KKIM.6 

The aci_gap_set_security_requirements() command return an error with the code 0x11 that means a BLE_ERROR_UNSUPPORTED_FEATURE if KeyPress_Notification_Support is set to 1 but Secure Connection feature is not supported. Those two parameters are configured throw CubeMX and you can solve it by setting the CFG_BLE_SECURE_CONNECTIONS_ENABLED to Enabled (set by default to Disable on CubeMX):

STTwo32_0-1736243930069.png

Best Regards.

STTwo-32

1 reply

STTwo-32
STTwo-32Best answer
Technical Moderator
January 7, 2025

Hello @KKIM.6 

The aci_gap_set_security_requirements() command return an error with the code 0x11 that means a BLE_ERROR_UNSUPPORTED_FEATURE if KeyPress_Notification_Support is set to 1 but Secure Connection feature is not supported. Those two parameters are configured throw CubeMX and you can solve it by setting the CFG_BLE_SECURE_CONNECTIONS_ENABLED to Enabled (set by default to Disable on CubeMX):

STTwo32_0-1736243930069.png

Best Regards.

STTwo-32

KKIM.6
KKIM.6Author
Senior
January 9, 2025

Thanks. The problem has been solved by this modification.