Channel Sounding – Ranging Data Overwritten and No Distance Update

Hello,

I managed to run the examples for nrf54l15 channel_sounding_ras_initiator.c and reflector on my custom hardware boards. I changed the overlay files to use my own LED and UART for logging. I have only one RF antenna. I also do not have an external LF 32khz crystal, so I added these lines to my prj.conf:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

After starting, I get some results from the initiator, but it does not work 100 percent as I expect.

At the beginning, I get this log:

D: On-demand Ranging Data notification received
D: On-demand Ranging Data notification received
D: On-demand Ranging Data notification received
D: Ack Ranging data for counter 2
I: Distance estimates on antenna path 0: ifft: 0.785345, phase_slope: 0.720688, rtt: 8.246675
I: Sleeping for a few seconds...
I: Distance estimates on antenna path 0: ifft: 0.785345, phase_slope: 0.720688, rtt: 8.246675
I: Sleeping for a few seconds...
I: Ranging data overwritten 3
D: Get Ranging Data Success
...
I: Distance estimates on antenna path 0: ifft: 0.785345, phase_slope: 0.720688, rtt: 8.246675
I: Sleeping for
D: On-demand Ranging Data notification received
D: Ack Ranging data for counter 4

But when I move the reflector farther away, it starts printing this, and the measured distance does not change anymore, even if I move the reflector:

I: Sleeping for a few seconds...
I: Ranging data overwritten 211
I: Distance estimates on antenna path 0: ifft: 0.320133, phase_slope: 1.553719, rtt: 7.424473
I: Sleeping for a few seconds...
I: Ranging data overwritten 212
I: Distance estimates on antenna path 0: ifft: 0.320133, phase_slope: 1.553719, rtt: 7.424473
I: Sleeping for a few seconds...
I: Ranging data overwritten 213

  • What does "Ranging data overwritten" mean here?

  • If I change the main loop delay from the original 5 seconds to for example 200 ms, I never get any measured distance in the log anymore. Why should changing the sleep time matter if the code just checks if (buffer_num_valid != 0)?

It is also strange why there is such a big difference between the results of different methods (rtt, phase, slope, etc.). Could this be caused by unsuitable hardware - for example the antenna?
My HW board:
  


Thank you for any help.

Jan.

Parents
  • Hi,

    The board might give some issues, yes. Please create a private ticket with schematics and gerber files, for our review.

    Have you tried with the custom board only, or do you see similar issues with an nRF54L15 DK?

    What does "Ranging data overwritten" mean here?

    Basically that you have gotten a new set of ranging data.

    If I change the main loop delay from the original 5 seconds to for example 200 ms, I never get any measured distance in the log anymore. Why should changing the sleep time matter if the code just checks if (buffer_num_valid != 0)?

    Ranging might take some time. If you decrease the timeout, you risk timing out before you get the result. In the case of timeout you will not get a result.

    Regards,
    Terje

  • Thank you, but decreasing the timeout in the main loop cannot affect whether the data will be overwritten. It looks more like the CS measurement is running in the background all the time, and the main core does not manage to process - pick up the data. So, the data are overwritten and no new distance can be calculated ?!

Reply Children
  • Hi,

    To be more specific, the "Ranging data overwritten" indicates you have gotten new data without the ranging requestor fetching it. This may happen if the ranging requestor stops or does not fetch data often enough for there to not be any overwrites.

    Regards,
    Terje

  • Hi Terje,
    I am still struggling with this behaviour....

    Please try to specify it more clearly, what exactly does it mean when the initiator says “Ranging data overwritten”? Does it mean that the initiator is not fast enough to process the new incoming data? Does this mean my own user code is too slow? In the callback ranging_data_ready_cb, I am informed that new data is ready and I can read it – so does this mean the CPU is too slow to do this action? Or does it mean some background processes of BLE, CS, etc., which I cannot control as a user?

    My code is almost the same as your ras_initiator example… I do not think my code is so slow that the CPU cannot read/process the data fast enough…

  • Hello,

    There may be a few different reasons, such as:

    A possibility is that the data is not being acknowledged when received, so the peer has to assume it never was received.

    Noise on air could lead to dropped packets in the data transfer, which again would lead to it not being received properly and therefore overwritten.

    It could be that the CS parameters are so that there is not enough ACL time to transfer the data before a new CS procedure is initiated, without more information it's hard to find the root cause.

    When you see the distance has stopped updating, that's because the distance printed is just the last calculated distance, so when no data transfer is successful there are no new distance measurements.

    Kenneth

Related