Nordic Distance Measurement library - dm_report not being populated

I have successfully managed to incorporate the hard-float build of the library for the nrf52840 into my bare-metal application (custom hardware with an nrf52840) and have been able to get successful rangings (dm_status=NRF_DM_STATUS_SUCCESS) between 2 nodes, one acting as a reflector and the other as an initiator. However the nrf_dm_report_t doesnt get populated except for some values. Every now and then a ranging is unsuccessful, but all successful ones show the same as below. As I cannot dig deeper into the nrf_dm implementation, I was wondering if you could provide me with some insight on what could be going on.

Here is the serial log with the contents of dm_report:

[DM][000000010] I: NRF DM library version: nrf_dm_0.7.5+
[DM][000000011] I: nrf_dm_config_t:
[DM][000000011] I: Role: 1
[DM][000000011] I: Ranging Mode: 1
[DM][000000011] I: RNG Seed: 4294967295
[DM][000000011] I: TX Power (dBm): 4
[DM][000000011] I: Antenna Composition: 0
[DM][000000014] I: I Tones Local: 0, 0, ..., 0
[DM][000000014] I: Q Tones Local: 0, 0, ..., 0
[DM][000000014] I: I Tones Remote: 0, 0, ..., 0
[DM][000000014] I: Q Tones Remote: 0, 0, ..., 0
[DM][000000019] I: SINR Indicators: 0
[DM][000000019] I: Ranging Mode: 1
[DM][000000019] I: Distance Estimates: IFFT: , Phase Slope: , RSSI Openspace: , Best:
[DM][000000025] I: Status: 0
[DM][000000025] I: Link Loss: 42
[DM][000000025] I: RSSI Local: 38
[DM][000000025] I: RSSI Remote: 38
[DM][000000025] I: TX Power Local: 4
[DM][000000025] I: TX Power Remote: 4
[DM][000000025] I: Quality: 0
[DM][000000025] I: RTT Accumulated (ns): 0
[DM][000000025] I: RTT Count: 0
[DM][000000031] I: nrf_status: 0

Here is the code excerpt:

dm_status = nrf_dm_proc_execute(timeout_us);
if (dm_status == NRF_DM_STATUS_SUCCESS)
{
    nrf_dm_populate_report(&dm_report);
    quality = nrf_dm_calc(&dm_report);
    duration = nrf_dm_get_duration_us(&dm_config);
    distance = nrf_dm_high_precision_calc(&dm_report);
    nrf_dm_get_hopping_sequence(&dm_config,hopping_seq);
    dm_print_report(&dm_report);
}

Thank you for your assistance, let me know if you need more details.

BR Mickael

  • Hello Mickael,

    I guess this could be related to the custom HW, the way its linked to your custom app, or the custom configurations you have going on there. Having a bare-metal application can make this a bit harder to support, considering that we mainly support NCS. Though I'll of course try to help you.

    Do you have access to DKs there as well which you can run this on? Have you had the HW reviewed by us before?

    Regards,

    Elfving

Related