STS error on DWM3220 message exchange

Hello,

I’m working on an RTLS project and I have a custom DWM3220 based device with two antennas acting as an anchor and a DWM3000 based device acting as a tag. I’m quite new to UWB and I used the examples from DW3XXX_API to work with the devices. I want to obtain PDOA values on the anchor side using examples 01h and 02h but so far I’m not able to get STS working.

This is my configuration:
{
.channel = DWM_CHANNEL_5,
.tx_preamble_length = DWM_PREAMBLE_LENGTH_128,
.rx_pac = DWM_PAC_8,
.tx_preamble_code = DEFAULT_PREAMBLE_CODE,
.rx_preamble_code = DEFAULT_PREAMBLE_CODE,
.sfd_type = DWM_SFD_TYPE_DW_8,
.data_rate = DWM_DATA_RATE_6M8,
.phr_mode = DWM_PHR_MODE_STANDARD,
.phr_rate = DWM_PHR_RATE_STANDARD,
.sfd_timeout = (129 + 8 - 8),
.sts_mode = (DWM_STS_MODE_1 | DWM_STS_MODE_SUPER_DETERMINISTIC),
.sts_length = DWM_STS_LENGTH_256,
.pdoa_mode = DWM_PDOA_MODE_3,
}

Function dwt_readstsquality() always returns -230 and STS quality is 0.
I tried setting STS key and iv as the default values before each tx/rx and it did not work.

Is there something wrong with the configuration or what could be the issue? Thank you!

Hello. The issue was with my code. PDoA values are coming now.

Hi, i think to have the same issue. Do you obtain correct values for the angles?

Hello, yes, I obtain correct values, with some variations of course. In the code that I was using there was a bug with the defines so I thought that STS was enabled but in fact it was not.

When i calculate the angle i obtain strange values: seems to be doubled.
Do you occure in the same problem? Can i ask you wich formula did you use to convert the pdoa values into deg angles?
Mine is: deg_value=pdoa_value180/(2048pi)
Thx and have a nice day

Hi,
Based on
https://www.researchgate.net/profile/Igor-Dotlic/publication/322408155_Angle_of_arrival_estimation_using_decawave_DW1000_integrated_circuits/links/5a5cd5430f7e9b4f783965fd/Angle-of-arrival-estimation-using-decawave-DW1000-integrated-circuits.pdf
the formula for obtaining the angle of arrival from the PDoA value is:
image
where alpha is your PDoA, lamdba is the carrier wavelentgh and d is your antenna pitch. The result will be in radians and to convert in degrees you have to multiply by 180 and then divide by Pi.