SPI communication to DWM1001

I I have problems communicating with the DWM1001 using the SPI port.
I tried the USART port and it works well. I need to be faster. I switch to the SPI.
I’m not able to receive answers to my commands.
Each time, I send my TLV request than wait for an answer. I receive the right amount of bite (size). But, when I retrieve the data, I always receive error message 0x01,0xFF, 0XFF…

My questions are:

Do we have to pull down and pull up the CS for each part of the communication? Like CS for TLV request then pull up, CS for Length then pull up, CS for Data then pull up.

Do we have to respect a specific timing? ex: time after ChipSelect, time before ChipDeSelect, time between two parts of the command, time between ChipDeSelect and ChipSelect, time between TLV request and size and data

I tried all possibility I can imagine for SPI timing but it never works.
After your answer, I will try with your advice. I will be able to show you what I do with the logic analyzer. But for now, I can’t show you everything I tried.

If you have a update of the DWM1001 FIRMWARE APPLICATION PROGRAMMING INTERFACE (API) GUIDE it will be appreciate.


I got the same issue here. It doesn’t work when I try it according to the datasheet of dwm1001.

However, I tried this code and was able to get the correct reply once in three times.

[color=#336633][font=Consolas,] tx_data[tx_len++] = 0x10;
tx_data[tx_len++] = 0;[/font][/color]
[color=#336633][font=Consolas,] digitalWrite(_cs, LOW);

for(int i=0; i<9; ++i){
rx_data[i] = SPI.transfer(0xFF);
digitalWrite(_cs, HIGH);[/font][/color]

Hi Fturcotte,

Are you using the host example provided by Decawave ?


I tried to read all I can about SPI in the manual.
I don’t know if I pass beside a good example.
Could you just show me what example you are thinking about.

On the other side, I postpone my task to use the SPI.
I discover that not all commands are available with the SPI.
I’m interested in listeners command like les ans lec.
I think for now, the only way I can receive information about all tag is to use the terminal interface.
Not the best but it does the job.

Francois Turcotte

Hi all,

I am wandering whether you were able to solve the SPI communication issue?



The same problem has occurred in my trial and I figure out it was due to my too long SPI wires which were around 25~30 cm.
Once I shortened the wire length to 10~15 cm, everything went through well.
It is worth a shot.