STM32CubeWBA BLE Timing Profiling

Revision as of 18:13, 19 April 2024 by Registered User (Draft Drift time)

1. Introduction

2. Link Layer Drift Time

To adjust the BLE Link Layer timing with the right value, it requires a profile of a specific timing called the DRIFT_TIME. It corresponds to the time between the Radio IRQ and the beginning of the Link Layer event setup. It can be impacted by the system process and the active clock frequency. Please find below the step to follow to configure the DRIFT_TIME value :

2.1. GPIO and signals setup

The DTB RADIO_IRQ, TX_ON and the debug IO of the RT Debug module DBG_IO_PROFILE_END_DRIFT_TIME. - The RADIO_IRQ GPIO indicates the beginning of the DRIFT_TIME - The DBG_IO_PROFILE_END_DRIFT_TIME indicates the end of the DRIFT_TIME. - The TX_ON GPIO indicates the RF activity. As the DRIFT_TIME to measure, is the one which occurs just before the RF Activity (TX_ON) (cf. figure 1) (Please refer to the XXX note to setup configure those GPIOs)


2.2. Run Bluetooth scenario

For broadcaster role, the DRIFT_TIME can be measured during an Advertising event. For observer role, the DRIFT_TIME can be measured before a Scan window. For other roles, the DRIFT_TIME can be measured during a connection event.

2.3. Measure the DRIFT_TIME duration

Once the GPIO configured and the scenario executed, the DRIFT_TIME can be profiled as described below. - Identify the RF activity of the scenario (detailed in the point 2.) and identify the foregoing RADIO_IRQ as shown in the figure 1. - Start the measure at the rising edge of the RADIO_IRQ signal - Stop the measure at the falling edge of the DBG_IO_PROFILE_END_DRIFT_TIME signal Figure 1 : Signal identification


Figure 2 : DRIFT_TIME measurement

2.4. Define the DRIFT_TIME value

Once the DRIFT_TIME measured in microseconds, the value will be computed to have the number of cycles required for the DRIFT_TIME, using the following formula:

With: - T_drift_time is the DRIFT_TIME duration measured previously in microsecond. - T_cycle is the duration of the Link Layer sleep clock cycle ~30.52us (clock at 32.768kHz) - V_drift_time is the value to set in the Link Layer and corresponds to the number of cycles required for the DRIFT_TIME. - V_margin is the number of cycles added to allow preemption of the Link Layer setup. The minimum margin recommended is 3 cycles (~91.5us).

2.5. Set the DRFIT_TIME

Call the XXX function with V_drift_time as parameter in the ll_sys_reset function.

2.6. Example

For an application which supports Central or Peripheral Role :

- T_drift_time = 186us - V_drift_time = CEIL(186 / 30.52) + 3 = 10 Call the XXX function to set the new DRIFT_TIME value.

void ll_sys_reset( void )

{

   XXX( 10 );

}


Note :

  • Add note on default value.
  • problem with STOP MODE impact ?
No categories assignedEdit