STM32CubeWBA BLE Timing Profiling

Revision as of 14:44, 7 June 2024 by Registered User (Add figure)

1. Introduction

2. Link Layer Timing

To adjust the BLE Link Layer timing with the right value, it requires a profile of specific timings called the DRIFT_TIME and EXEC_TIME.

The DRIFT_TIME 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.

The EXEC_TIME corresponds to the time required by the Link Layer to prepare the system to configure the next radio event. Please find below the step to follow to configure the DRIFT_TIME and EXEC_TIME values.

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 and DBG_IO_SCHDLR_EXEC_EVNT_PROFILE.

  • 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)
  • The DBG_IO_SCHDLR_EXEC_EVNT_PROFILE rising edge indicates the beginning of the EXEC_TIME and the falling edge indicates the end of the EXEC_TIME.

(Please refer to the XXX note to setup configure those GPIOs)


2.2. Run Bluetooth scenario

For broadcaster role, the DRIFT_TIME and EXEC_TIME can be measured during an Advertising event.

For observer role, the DRIFT_TIME and EXEC_TIME can be measured before a Scan window.

For other roles, the DRIFT_TIME and EXEC_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
Connectivity:STM32CubeWBA BLE Timing Profiling 1717763978699.png

Figure 1 : Signal identification

Connectivity:STM32CubeWBA BLE Timing Profiling 1717763990124.png

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 7 cycles (~183.1us).

2.5. Measure the EXEC_TIME duration

Once the GPIO configured and the scenario executed, the EXEC_TIME can be profiled as described below.

- Identify the RF activity of the scenario (detailed in the point 2.).

- Start the measure at the rising edge of the DBG_IO_SCHDLR_EXEC_EVNT_PROFILE signal

- Stop the measure at the falling edge of the DBG_IO_SCHDLR_EXEC_EVNT_PROFILE signal

Connectivity:STM32CubeWBA BLE Timing Profiling 1717764026129.png

Figure 3: EXEC_TIME measurement

2.6. Define the EXEC_TIME value

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

With:

-       T_exec_time is the EXEC_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_exec_time is the value to set in the Link Layer and corresponds to the number of cycles required for the EXEC_TIME.

Note: No margin needed for exec_time.

2.7. Set the DRFIT_TIME and EXEC_TIME

Call the XXX function with V_drift_time and V_exe _time as parameter in the ll_sys_reset function.

2.8. Example

For an application which supports Central or Peripheral Role :

Connectivity:STM32CubeWBA BLE Timing Profiling 1717763978699.png
Connectivity:STM32CubeWBA BLE Timing Profiling 1717764026129.png
  • T_drift_time = 186us
  • V_drift_time = CEIL(186 / 30.52) + 6 = 13
  • T_exec_time = 445us
  • V_exec_time = CEIL(445 / 30.52) = 15

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