DW3xxx & QM3xxx SDK v1.0.2 - RangingTxFailed (0x20) Error

Hi there,

I am using the DW3xxx & QM3xxx SDK v1.0.2 with a custom GPIO configuration, but I am encountering the following error:

(.venv) PS D:\gitlab\uwb-qorvo-tools> run_fira_twr -t -1
Default port: COM9
Initializing session 42...
Send Packet(9): 210000052a00000000
Using Fira 2.0 session handle is : 1
Setting session 1 config ...
    DeviceType (0x0):                   0x1
    DeviceRole (0x11):                  0x1
    MultiNodeMode (0x3):                0x0
Session 1 -> Init (StateChangeWithSessionManagementCommands)
    RangingRoundUsage (0x1):            0x2
    DeviceMacAddress (0x6):             0x0
    ChannelNumber (0x4):                0x9
    ScheduleMode (0x22):                0x1
    StsConfig (0x2):                    0x0
    RframeConfig (0x12):                0x3
    ResultReportConfig (0x2e):          0xb
    VendorId (0x27):                    0x708
    StaticStsIv (0x28):                 0x60504030201
    AoaResultReq (0xd):                 0x1
    UwbInitiationTime (0x2b):           0x0
    PreambleCodeIndex (0x14):           0xa
    SfdId (0x15):                       0x2
    SlotDuration (0x8):                 0x960
    RangingInterval (0x9):              0xc8
    SlotsPerRr (0x1b):                  0x19
    MaxNumberOfMeasurements (0x32):     0x0
    HoppingMode (0x2c):                 0x0
    RssiReporting (0x13):               0x0
    BlockStrideLength (0x2d):           0x0
    NumberOfControlees (0x5):           0x1
    DstMacAddress (0x7):                [1]
    KeyRotationRate (0x24):             0x0
    StsLength (0x35):                   0x1
Send Packet(110): 2103006a010000001b000101110101030100010102060200000401092201010201001201032e010b2702080728060102030405060d01012b08000000000000000014010a150102080260090904c80000001b0119320200002c01001301002d010005010107020100240100350101
Starting ranging...
Send Packet(8): 2200000401000000
Session 1 -> Idle (StateChangeWithSessionManagementCommands)
Press <RETURN> to stop
Device -> Active
Session 1 -> Active (StateChangeWithSessionManagementCommands)
Device -> Error
# Ranging Data:
        session handle:         1
        sequence n:         0
        ranging interval:   200 ms
        measurement type:   Twr
        Mac add size:       2
        primary session id: 0x0
        n of measurement:   1
        # Measurement 1:
            status:             RangingTxFailed (0x20)
            mac address:        00:01 hex
            is nlos meas:       Unknown
            distance:           65535.0 cm
            AoA azimuth:        0.0 deg
            AoA az. FOM:        0.0 %
            AoA elevation:      0.0 deg
            AoA elev. FOM:      0.0
            AoA dest azimuth:   0.0 deg
            AoA dest az. FOM:   0.0 %
            AoA dest elevation: 0.0 deg
            AoA dest elev. FOM: 0.0 %
            slot in error:      0
            rssi:               -0.0 dBm

I suspect this could be related to my SPI configuration, which is as follows:

target_compile_definitions(
  ProjectDefinition
  PUBLIC CONFIG_UWB_SPI_INSTANCE=3
         CONFIG_UWB_SPI_FRAME_SIZE=8
         CONFIG_SPI_UWB_IRQ_PRIORITY=3
         CONFIG_SPI_UWB_SCK_GPIO_PORT=0
         CONFIG_SPI_UWB_SCK_GPIO_PIN=6
         CONFIG_SPI_UWB_MOSI_GPIO_PORT=1
         CONFIG_SPI_UWB_MOSI_GPIO_PIN=9
         CONFIG_SPI_UWB_MISO_GPIO_PORT=0
         CONFIG_SPI_UWB_MISO_GPIO_PIN=8
         CONFIG_SPI_UWB_CS_GPIO_PORT=0
         CONFIG_SPI_UWB_CS_GPIO_PIN=12
         CONFIG_DWT_WU_GPIO_PORT=0
         CONFIG_DWT_WU_GPIO_PIN=2
         CONFIG_DWT_IRQ_GPIO_PORT=0
         CONFIG_DWT_IRQ_GPIO_PIN=26
         CONFIG_DWT_RSTN_GPIO_PORT=0
         CONFIG_DWT_RSTN_GPIO_PIN=10
)

Questions:

  1. Could the GPIO configuration cause the RangingTxFailed (0x20) error?
  2. Are there any known issues with SPI instance 3 in this SDK?
  3. How can I debug the ranging failure more effectively?

Hi Qorvo,

Any reply ?

Hi @TanZhiWei ,

If you can communicate with the device until you get RangingTxFailed (0x20) error, then I wouldn’t suspect an SPI issue. Besides, you’re using UART communication in the run_fira_twr command.

I think it is more related to your calibration/configuration of the HW that you have. Do you use a custom design or one of our reference designs?

To check your calibration/configuration, can you perform get_cal -p COM9 all command and share the output here?

Kind regards,
Emre

Hi @Emre_Ozbas_Qorvo

I think it is more related to your calibration/configuration of the HW that you have. Do you use a custom design or one of our reference designs?

Yes, I’m using our own custom design, which is based on the QM33120WDK1 reference design.

To check your calibration/configuration, can you perform get_cal -p COM9 all command and share the output here?

I attempted to run get_cal -p COM9 and encountered the following output:

Recovering params...
Send Packet(6): 2e2b00020000
11:38:26.283 CRITICAL:  UciComError.TimeoutError (0x3): No response from the device (4s timeout)
11:38:26.283 CRITICAL:  TimeoutError (3)

It seems there’s no response from the device within the 4-second timeout window. Could you please advise on possible causes or steps to troubleshoot this issue?

Kind Regrads,
TanZhiWei

Hi @TanZhiWei ,

This indicates that the UART communication is so slow that the device couldn’t print all the calibration parameters before the timeout. You can try to get the calibration parameters one by one just to make sure that we can get a reply from your HW.

Lets try to get a response from your HW by using the command below.

get_device_info -p COM9

Then, perform the following command to get the xtal_trim calibration parameter.

get_cal -p COM9 xtal_trim

Kind regards,
Emre

Hi @Emre_Ozbas_Qorvo ,

Here are the results from the commands you suggested:

(.venv) PS D:\gitlab\uwb-qorvo-tools> get_device_info -p COM9
Pinging device at COM9:
Send Packet(4): 20020000
# Get Device Info:
        status:              Ok (0x0)
        uci version:         2.0.0
        mac version:         2.0.0
        phy version:         2.0.0
        uci test version:    1.1.0
        QMF version:         1.0.0
        OEM version:         0.0.0
        build job:           na
        soc id:              0000504b4232303588b0981c
        device id:           deca0302
(.venv) PS D:\gitlab\uwb-qorvo-tools> get_cal -p COM9 xtal_trim
Send Packet(16): 2e2b000c0100097874616c5f7472696d
255

Kind regards,
Tan Zhi Wei

Hi @TanZhiWei ,

Xtal_trim value of 255 suggests that your custom design isn’t calibrated/configured properly as expected. So this could be the main reason that you get RangingTxFailed errors.

You can try to push one of the configuration JSON files in the QM33 SDK by using the load_cal command, but these calibration files only configure the antenna ports. So you would need to perform a production calibration to be regulatory compliant and get the best performance from our chip. To do that you can have a look at the application note below.

https://www.qorvo.com/products/d/da008216

Kind regards,
Emre

Hi @Emre_Ozbas_Qorvo ,

Thank you for your response. After testing, I can confirm that run_fira_twr executed successfully. However, the ranging results still need calibration.

Kind Regards,
TanZhiWei

1 Like