Distance between tags


I am using dwm1001 devkit. I am trying to develop a nrf52832 firmware with dw1000 driver.
I am trying to make a firmware which can be measure between 2 similar tags.
I tried to make some kind a 2 sided tag which becomes tag and anchor with a simple NRF timer. For this purpose I used ss_twr_init and ss_twr_resp examples from here.
Tags perfectly does ss_init part but when it comes to reponder example
ret = dwt_starttx(DWT_START_TX_DELAYED);
part fail every time and but works with the ret = dwt_starttx(DWT_START_TX_IMMEDIATE);
but as u can estimate with this tags can not calculate distance correctly.

I could not fix this error or saw any example code which is trying to do same thing.

Best regards,

Hey there only with that i coulnd help much…
Did you configure the delayed timers ? Respecting the each function from the decawave api theres some implementations / config’s you neeed to consider. (Dont remenber well all of them).
On the decawave website there is a section where you can donwload the firmware sampels and the respective documentation.
Keep on and try it.

Hello ruigomes,

I have checked both example. There is only 2 different part between initializer and responder example.

initializer example has these lines;

  /* Set expected resp    onse's delay and timeout. 
      * As this example only handles one incoming frame with always the same delay and timeout, those values can be set here once for all. */
      dwt_setrxtimeout(65000); // Maximum value timeout with DW1000 is 65ms  

reponder example has these lines:

  /* Set preamble timeout for expected frames.  */

  dwt_setrxtimeout(0);    // set to NO receive timeout for this simple example   

I could not figure it out from here.

Thank you for your interest :slight_smile:


Hey there!

Sorry i cant help without more “info”.

1 - Did you try out the direct example init and repond without any modification? It works?

2 - Did you change the size of message or delays?

3 - Did you debug the responder side to notice if you get any error from the reception? Read the regist when you try → ret = dwt_starttx(DWT_START_TX_DELAYED);

Sorry about this questions, but could make you notice something…

I remenber something like that happening to me and i remenber was the delays values. I used an excel sheet to more or less acquire the values for the delays correctly and then working on them to reduce them.

Hope i could help.

Hello ruigomes,

1- I can calculate distance with examples on 2 different dwm1001. I also add some BLE examples in it. But these separate examples works completely fine. I am currently using every delay as default in the example since I have no knowledge about it. It works thats why I am so confusing its works when they separate but when I mixed them in the while(1) loop responder part dont work as I mention before.

2- I havent change anything about delays or message size.

3- After and before calling dwt_starttx(DWT_START_TX_DELAYED) function status reg value still remains same 0x802F02 =

Also ret code is -1.

I am really great full for your questions and your interest. You can ask everything. Error could be in everywhere because I am pretty new on dwm1000 devices.

Best regards,

Ok, this might be a silly question/idea but, did you try to change the id msg for each different device?

I mean with the example you can see that the message as an id on both sides that is the same. You need to have 3 id’s so both “3” devices knows wich one is communicating and if there is “something for me”. (tx_poll_msg and rx_resp_msg)

I dont know if that was the cause of that… I belive is after the 0xCA, 0xDE bytes…
See the documentation about the message format bytes…

For example, my tag as an x00 byte for an id, my anchor1 as 0x01 and the other anchor2 is 0x02.
So you need to “create” a protocol to communicate your tag with all your anchors devices.(A to B then B responds to A), (A to C then C responds to A).

I’m only saying this because that i read that you can run the examples separately (A to B and A to C) but not together.


Hi ruigomes,

I recently discover when dwt_starttx(DWT_START_TX_DELAYED) working steadly status register should be look like:

which is different from below which is mine.

And I look for these different register bits. And I found these register bits are;

I think these register bits’ statuses causes error. Now I am reading and digging more about it.

Best Regards,

Hey there! Nice thats a starting ! Good Luck!


I found the error I was forgetting overwriting

/* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000’s wait for response feature. */

I added this and my project worked.

Thank you ruigomes for your interest :slight_smile: