cancel
Showing results for 
Search instead for 
Did you mean: 

HCI_LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS return Unknown HCI command

oga
Associate II

hi all

I'm working on a P-NucleoSTM32WB board

I've try BLE_p2pServer_Ext exemple with CM0 loaded with stack_full_extended.bin and it works well

on the other hand I've a simple Custom app that works well

after tweaking .ld file for getting it to work with extended stack on CM0 it works ok

I've added adv_ext_app.c/h from exemple but at ADV_EXT_Start() call the

 

 

 hci_le_read_number_of_supported_advertising_sets(&adv_set_count_supported)

 

 

returns status 1 (Unknown HCI command)

I've isolated this in a button press call and it's same

 

 

	void Custom_Switch1_Action(void)
	{
		APP_DBG_MSG("-- Switch 1 \n");
		APP_DBG_MSG(" \n\r");
	
		tBleStatus status = BLE_STATUS_INVALID_PARAMS;
		uint8_t adv_set_count_supported;
	
		uint8_t HCI_Version;
		uint16_t HCI_Subversion;
		uint8_t LMP_Version;
		uint16_t Company_Identifier;
		uint16_t LMP_Subversion;
	
		status = hci_read_local_version_information(&HCI_Version,&HCI_Subversion,&LMP_Version,&Company_Identifier,&LMP_Subversion);
		APP_DBG_MSG("Hci Version Read status %u \n HCI_Version \t%u \n HCI_SubVersion \t%u \n LMP_Version \t%u \n Company Id \t%u\n LMP_SubVersion \t%u\n",
				status ,
				HCI_Version,
				HCI_Subversion,
				LMP_Version,
				Company_Identifier,
				LMP_Subversion);
		status = hci_le_read_number_of_supported_advertising_sets(&adv_set_count_supported);
		APP_DBG_MSG("Supported Adv Set Count Status %u \n Adv Supported : %d\n",status ,adv_set_count_supported);
	}

 

 

this task is well registered in HCI calling tasks

 

 

/**< Add in that list all tasks that may send a ACI/HCI command */
typedef enum
{
  CFG_TASK_ADV_CANCEL_ID,
#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0 )
  CFG_TASK_CONN_UPDATE_REG_ID,
#endif
  CFG_TASK_HCI_ASYNCH_EVT_ID,
  /* USER CODE BEGIN CFG_Task_Id_With_HCI_Cmd_t */
  CFG_TASK_SW1_BUTTON_PUSHED_ID,
  CFG_TASK_SW2_BUTTON_PUSHED_ID,
  CFG_TASK_SW3_BUTTON_PUSHED_ID,
  /* USER CODE END CFG_Task_Id_With_HCI_Cmd_t */
  CFG_LAST_TASK_ID_WITH_HCICMD,                                               /**< Shall be LAST in the list */
} CFG_Task_Id_With_HCI_Cmd_t;
void Custom_APP_Init(void)
{
  /* USER CODE BEGIN CUSTOM_APP_Init */
	UTIL_SEQ_RegTask(1<< CFG_TASK_SW1_BUTTON_PUSHED_ID, UTIL_SEQ_RFU, Custom_Switch1_Action);
	UTIL_SEQ_RegTask(1<< CFG_TASK_SW2_BUTTON_PUSHED_ID, UTIL_SEQ_RFU, Custom_Switch2_Action);
	UTIL_SEQ_RegTask(1<< CFG_TASK_SW3_BUTTON_PUSHED_ID, UTIL_SEQ_RFU, Custom_Switch3_Action);
  /* USER CODE END CUSTOM_APP_Init */
  return;
}

 

 

 and the result is

[custom_app.c][Custom_Switch1_Action][84] -- Switch 1

[custom_app.c][Custom_Switch1_Action][85]

[custom_app.c][Custom_Switch1_Action][97] Hci Version Read status 0
HCI_Version 12
HCI_SubVersion 117
LMP_Version 12
Company Id 48
LMP_SubVersion 8821

[custom_app.c][Custom_Switch1_Action][105] Supported Adv Set Count Status 1
Adv Supported : 0

if I flash back BLE_p2pServer_Ext exemple all works well

to tweek .ld file and addapt my app to Full_Extended stack I've folowed this wiki page

https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB_BLE_Wireless_Stack#STM32WB5x-2FSTM32WB3x

I've missed something but what ??

thank's for any help

 

 

 

 

 

 

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

An application has to give some specific parameters to the stack to use extended advertising. These parameters are located in app_conf.h file.

  • CFG_BLE_OPTIONS mask must have SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV and SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 defined.
  • Having two parameters allows to define the capacity of the stack for this feature, transmitted into ble_init_cmd_packet stucture.
    • CFG_BLE_MAX_ADV_SET_NBR is the max number of advertising set supported, up to 8 on STM32WB5x and up to 3 on STM32WB1x.
    • CFG_BLE_MAX_ADV_DATA_LEN is the max data length of each advertising set, up to 1650.

Can you check these points in your application?

You can refer to the following wiki page for more information on STM32WB Bluetooth® LE advertising extensions.

Best Regards