cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB09KE PAwR Setting Maximum Connection Interval

Davide Dalfra
Associate III

Hello Folks,

 

I started playing with STM32WB09 after some difficulties related to entering in bootloader mode (thanks again to the community) and i wanted to try setting the maximum SCAN_INTERVAL + maximum CONNECTION_INTERVAL to see the best low power footprint i can obtain.

All the setting i'm playing with are in app.conf.h and are basically those:

#define PAWR_NUM_SUBEVENTS              4
#define PAWR_SUBEVENT_INTERVAL_MS       30
#define PAWR_RESPONSE_SLOT_DELAY_MS     2.5
#define PAWR_RESPONSE_SLOT_SPACING_US   500
#define PAWR_NUM_RESPONSE_SLOTS         8

#define PAWR_INTERVAL_MS                (PAWR_SUBEVENT_INTERVAL_MS * PAWR_NUM_SUBEVENTS + 200)
   
#define SCAN_INTERVAL_MS                2000
#define SCAN_WINDOW_MS                  100
#define CONNECTION_INTERVAL_MS          200
#define SUPERVISION_TIMEOUT_MS          500

 

Strating from the Broadcaster example, i'm able to set the maximum "SCAN_INTERVAL_MS" up to 32000ms (32s).
I can see that from the power consumption footprint the system wake up every 32s scanning for observers.

However i'm getting a strange behavior while changing the CONNECTION_INTERVAL_MS.
The maximum working value i obtained experimentally is 200 or lower. 

The call where this defines is used, to configure the lower hardware level is in app.ble.c

status = aci_gap_set_connection_configuration(LE_1M_PHY_BIT,
                                                (CONNECTION_INTERVAL_MS*100)/125, (CONNECTION_INTERVAL_MS*100)/125,
                                                0u,
                                                SUPERVISION_TIMEOUT_MS/10,
                                                2, 2);  

  if (status == BLE_STATUS_SUCCESS)
  {
    APP_DBG_MSG("==>> aci_gap_set_connection_configuration Success , result: 0x%02x\n", status);
  }
  else
  {
    APP_DBG_MSG("==>> aci_gap_set_connection_configuration Failed , result: 0x%02x\n", status);
    Error_Handler();
  } 

As per AN6142 the maximum value configurable on this call, for "Connection_Interval_Min" and "Connection_Interval_Max" is 0x0C80  (corresponding to 4s).

DavideDalfra_0-1746808467748.png

Even by setting raw values on the aci_gap_set_connection_configurationnothing changes as i always get correct return values (0x00) ;however the next call which is to aci_gap_start_procedure failed with return code 0x12.

status = aci_gap_start_procedure(GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC, LE_1M_PHY_BIT, 0, 0);
  if (status != BLE_STATUS_SUCCESS)
  {
    APP_DBG_MSG("aci_gap_start_procedure - fail, result: 0x%02X\n", status);
    Error_Handler();
  }
  else
  {
    APP_DBG_MSG("==>> aci_gap_start_procedure (auto connection) - Success\n");
  }  

UART Debug is as follows:

SYSTEM RESET!!!!!!!!!<LF>
<LF>
  Success: aci_hal_set_tx_power_level command<LF>
  Success: aci_gatt_srv_profile_init command<LF>
  Success: aci_gap_init command<LF>
  Static Random Bluetooth Address: e5:f9:53:f8:b3:22<LF>
  Success: Gap_profile_set_dev_name - Device Name<LF>
  Success: Gap_profile_set_appearance - Appearance<LF>
  Success: aci_gap_set_io_capability command<LF>
  Success: aci_gap_set_security_requirements command<LF>
  Success: aci_gap_configure_filter_accept_and_resolving_list command<LF>
  Success: aci_gap_set_le_event_mask command<LF>
==>> End BLE_Init function<LF>
==>> Success: aci_gap_set_advertising_configuration<LF>
==>> Success: hci_le_set_periodic_advertising_parameters_v2<LF>
==>> Success: hci_le_set_periodic_advertising_enable<LF>
==>> Success: hci_le_set_extended_advertising_enable<LF>
==>> aci_gap_add_devices_to_filter_accept_and_resolving_list - Success<LF>
==>> aci_gap_set_scan_configuration - Success<LF>
==>> aci_gap_set_connection_configuration Success , result: 0x00<LF>
aci_gap_start_procedure - fail, result: 0x12<LF>
<LF>
<LF>
SYSTEM RESET!!!!!!!!!<LF>
<LF>
  Success: aci_hal_set_tx_power_level command<LF>
  Success: aci_gatt_srv_profile_init command<LF>
  Success: aci_gap_init command<LF>
  Static Random Bluetooth Address: e5:f9:53:f8:b3:22<LF>
  Success: Gap_profile_set_dev_name - Device Name<LF>
  Success: Gap_profile_set_appearance - Appearance<LF>
  Success: aci_gap_set_io_capability command<LF>
  Success: aci_gap_set_security_requirements command<LF>
  Success: aci_gap_configure_filter_accept_and_resolving_list command<LF>
  Success: aci_gap_set_le_event_mask command<LF>
==>> End BLE_Init function<LF>
==>> Success: aci_gap_set_advertising_configuration<LF>
==>> Success: hci_le_set_periodic_advertising_parameters_v2<LF>
==>> Success: hci_le_set_periodic_advertising_enable<LF>
==>> Success: hci_le_set_extended_advertising_enable<LF>
==>> aci_gap_add_devices_to_filter_accept_and_resolving_list - Success<LF>
==>> aci_gap_set_scan_configuration - Success<LF>
==>> aci_gap_set_connection_configuration Success , result: 0x00<LF>
aci_gap_start_procedure - fail, result: 0x12<LF>
<LF>
<LF>
SYSTEM RESET!!!!!!!!!<LF>



Anyone already encountered similar problem?

 

Regards

Davide

 



0 REPLIES 0