cancel
Showing results for 
Search instead for 
Did you mean: 

Setting SC_KEY_TYPE to debug mode fails in STM32WB55

tmk
Associate II

Hello, 

I want to enable the secure connection key type as 'DEBUG' in STM32WB55 with my custom setup. The cube IDE does not allow this setting in the configuration of .ioc file. I followed this tutorial and added the following line in my code inside the definition of Ble_Hci_Gap_Gatt_Init() function, but it returns with error code 0x12 (Invalid HCI parameters). What am I missing here? 

static const uint8_t SC_KEY_TYPE_DEBUG = 1;
static const uint8_t SC_KEY_TYPE_NORMAL = 0;
  
ret = aci_hal_write_config_data(0x35U, 1, (uint8_t*)&SC_KEY_TYPE_DEBUG);
  if (ret != BLE_STATUS_SUCCESS)
  {
    APP_DBG_MSG("  Fail   : aci_hal_write_config_data command - CONFIG_DATA_SC_KEY_TYPE_OFFSET, result: 0x%x \n", ret);
  }
  else
  {
    APP_DBG_MSG("  Success: aci_hal_write_config_data command - CONFIG_DATA_SC_KEY_TYPE_OFFSET\n");
  }

I am also following AN5270 for development, and the offset to set SC_KEY_TYPE seems to be correct. 

tmk_0-1739237869435.png

This is what I am seeing when I run the code: 

tmk_1-1739238012604.png

I made sure that CFG_SC_SUPPORT is set to 0x02 (supported and mandatory). What am I missing here? 

Any help is appreciated! 

 

0 REPLIES 0