cancel
Showing results for 
Search instead for 
Did you mean: 

Questions Regarding STMicroelectronics' BLE AOA Direction Finding

Zhangyy
Associate II

### 1. About the STEVAL-IDB012V1 Evaluation Kit
We have purchased the STEVAL-IDB012V1 evaluation kit. On ST's official website, we found a software package for QUUPPA tag emulation using BlueNRG-LP/LPS (en.STSW-QUUPPA-ETAG.zip). After downloading, we extracted it into the BlueNRG SDK (STSW-BNRGLP-DK). However, when I tried to compile the project using Keil, I encountered errors. The error details are shown in Attachment 1.
![](./STEVAL-IDB012V1.png) STEVAL-IDB012V1.png
The version of Keil I am using is 5.40, and the compiler version is 6.09.
I could not find a detailed solution to this issue in your forums or documentation. Additionally, there is no detailed explanation of the purpose of this project, only a brief mention that it is a "QUUPPA tag emulation."

### 2. About PCB Design for STM32WB09
Since the STM32WB09 is a relatively new product, I have not found much information regarding its PCB layout guidelines.
We followed the design guidelines for BlueNRG (`AN5526 - Guidelines for PCB Design on BlueNRG-LP/BlueNRG-LPS/STM32WB0 MCUs - STMicroelectronics`) to design a minimal system board for the STM32WB09.
After testing, it works well, but I would like to eliminate any potential issues arising from the subtle differences between the two chips. Could you provide detailed design guidelines for the STM32WB09?
![](./BLE_ToolBox.jpg) BLE_ToolBox.jpgtwo_wb09.jpg
![](./two_wb09.jpg)

 

### 3. About Antenna Array Design for AOA Base Stations
Regarding the hardware design of the antenna array for AOA base stations, there is a lack of relevant documentation from your side. I had to search for information elsewhere.

 

### 4. About Implementing AOA Positioning Using Code (This is the Most Important Point)
We want to design a base station using the STM32WB09 for direction finding in connectionless scenarios.
However, you have only provided a limited number of APIs, and I cannot see the implementation of these functions.
![](./aoa_hal_api.png) aoa_hal_api.png
I used two custom STM32WB09 development boards to test the `BLE_Beacon_AoA_Tag` and `BLE_Beacon_Scanner_AoA_Locator` examples from the SDK.
I was able to receive IQ data via the serial port, but there is a serious issue:
![](./error.png) error.png
After receiving a small number of IQ samples, the following error is triggered:
```c
case HCI_LE_PERIODIC_ADVERTISING_SYNC_LOST_SUBEVT_CODE:
{
APP_DBG_MSG("Sync lost! Restart the scanner device to get again the Beacon AoA Tag IQ samples !\r\n");

//device_state = START_SCANNING; //TBR???
}
```
I noticed that you might have intended to restart the scanning process, but the code is commented out, and the "TBR???" comment is left in the official SDK release. Is this a hardware design issue causing the connection to drop?

Furthermore, I reviewed the `RM0505 - STM32WB09XE Ultra-Low-Power Wireless 32-bit MCU Arm-Based Cortex-M0 with Bluetooth Low Energy and 2.4 GHz Radio Solution - STMicroelectronics` document, which describes the register design for the STM32WB09. I found some information related to AOA direction finding, but there is still a lack of detailed explanation regarding antenna switching control.
I also studied Texas Instruments' RTLS_Toolbox, where they use timer interrupts and DMA+GPIO to control RF switch toggling, as well as guard times and other AOA-related properties.
Could you provide detailed information and explanations on how this is handled in your system?

Additionally, in STM32CubeMX, I noticed that PB0-PB6 can be configured as `RADIO_ANTENNA` with very high-speed settings. These are clearly intended for antenna switching, but I could not find any documentation on how to use them.

For example, if I want to configure a 4x3 array of 12 antennas, how should I set up my code to cycle through these antennas while accounting for signal instability caused by RF switch toggling, in order to collect accurate IQ data?

I am an independent developer, and after the project is completed, I plan to open-source both the hardware and software. I welcome everyone to discuss and collaborate. My email address is 3228558272@qq.com.

 

 

 

2 REPLIES 2
Zhangyy
Associate II

is there any one who can relpy me? i need your help!

 

Zhangyy
Associate II

i notic that in your project `BLE_Beacon_Scanner_AoA_Locator`. in ble_app.c PB1 and PB2 were configure as the antenna switch gpio

 /* Need to call this function to set GPIOs used for antenna switching in case of AoA. */
ret = aci_hal_set_antenna_switch_parameters(0x06, /* ANTENNA_ID_1 and ANTENNA_ID_2 enabled */
1, /* Left-shift ANTENNA ID signal by one bit to exclude ANTENNA_ID_0 (PB0 is used for UART). */
0x00, /* Default antenna ID */
1); /* RF_ACTIVITY signal enabled on PB7. */

however

case HCI_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHED_SUBEVT_CODE:
	  {
		  hci_le_periodic_advertising_sync_established_event_rp0 *p_periodic_adv_sync;
		  p_periodic_adv_sync = (hci_le_periodic_advertising_sync_established_event_rp0 *) p_meta_evt->data;
		  tBleStatus ret;
		  uint8_t antenna_ids[] = SWITCHING_PATTERN;

		  uint16_t sync_handle = p_periodic_adv_sync->Sync_Handle;

		  APP_DBG_MSG("hci_le_periodic_advertising_sync_established_event --> EVENT\r\n");

		  /* Scanning is no more needed. Disable it. */
		  ret = aci_gap_terminate_proc(GAP_OBSERVATION_PROC);
		  if (ret != BLE_STATUS_SUCCESS)
		  {
		    APP_DBG_MSG("aci_gap_terminate_proc() failed:0x%02x\r\n", ret);
		   }
		  else
		  {
		    APP_DBG_MSG("aci_gap_terminate_proc --> SUCCESS\r\n");
		  }

		  ret = hci_le_set_connectionless_iq_sampling_enable(sync_handle,
                                                                      ENABLE,
                                                                      CTE_SLOT_1us,
                                                                      0, /* Report all CTEs*/
                                                                      sizeof(antenna_ids),
                                                                      antenna_ids);
		   if (ret != BLE_STATUS_SUCCESS)
		   {
		     APP_DBG_MSG("hci_le_set_connectionless_iq_sampling_enable() failed:0x%02x\r\n", ret);
		   }
		   else
		   {
		     APP_DBG_MSG("hci_le_set_connectionless_iq_sampling_enable --> SUCCESS\r\n");
		   }
          
      }
      break;

in this case antenna_ids is SWITCHING_PATTERN and

#define SWITCHING_PATTERN               {0x00, 0x01}

they mean that PB0 and PB1 were configure as antenna switch gpio

 

is there any wrong with me ?