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

Parents
  • 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

Reply
  • 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

Children
  • Good morning Elfving,

    Thank you for your response. I understand that the custom HW and bare-metal application makes it hard to support. This is for now just a proof-of-concept that I had previously managed to get it running with NCS, so now I am trying to only use the bare minimum (dm static library, cmsis and math.h). Since last week, I havent tinkered with it much more. Here are some of my thoughts and maybe you could clarify some points:

    - does the dm library assume I have the BT stack implemented / do I need to have the nrf softdevice flashed? (I assume it justs needs to control the radio peripheral)

    - as I do get remote rssi values (see screenshot), can I assume radio control is set up correctly? the rssi values change slightly for every few rangings.

    - dm_status always returns successful, according to the dm library, what condition must be satisfied to return success?

    - does the prebuilt dm library have some sort of debug logging incorporated that I could make use of?

    - is further configuration required? (I've incorporated all dependencies mentioned: cmsis, math.h)

    Yes I do have a few DKs lying around. I will try to build the application for the DK in the next few days and let you know if the same happens there. In the mean time, I would be grateful for any other tips you might have! Thank you!

    Best regards,

    Mickael

Related