We as a company trying to do a solution for tracking using DWM1000 modules. We have already made a POC (Proof of Concept) model for the testing.
All Tags and Anchors was based on STM32 MCUs and the initial firmware developers have used the dwm1000 driver provided by the manufacturers themselves.
That firmware worked on the POC hardware and gave approximately correct results.
The firmware that was written by the developer was kind of convoluted and was really hard to understand what’s going on. Therefore another in-house developer has ported the Arduino-dw1000 library (GitHub - thotro/arduino-dw1000: A library that offers functionality to use Decawave's DW1000 chips/modules with Arduino.) to STM32. It also worked on the POC hardware.
But due to a technical difficulty we had with that library we had to change the library. Because one of the features that we were interested in was no supported by that library. Therefore we fall back to the dwm1000 driver provided by the manufacturers. But this time the firmware developer (myself) re-wrote abstraction layer for that driver from scratch and made it work on the POC hardware.
Since the POC is working and giving the correct results we moved forward to the next stage of the product development which is the prototype phase.
Due to some additional requirements we had to change the POC schematic into a new one and re-wrote the DW1000 driver’s abstraction layer in C++ for modularity.
New DWM1000 schematic block
After we manufacture the boards and assemble it we did the initial test with the dw1000 driver which has the C++ abstraction layer. Sadly we couldn’t even get the Device ID (0xDECA3001) from the register.
The data coming into the STM32 through the MISO line was really unstable. Therefore the hardware team had to remove the PULLPUP resistor on the MISO line to make it stable. By stable I mean proper Square wave signal.
Even after that MISO line PULLUP resistor removal the DeviceID was not correct.
Eventhough the DeviceID registry is not a registry that needed SPI CLOCK to be less than 3MHz. we had to reduce the SPI CLOCK speed to 1.4MHz to make the STM32 talk to DWM1000.
That was the case in,
• DW1000 driver with C++ abstraction layer
• DW1000 driver with pure C abstraction layer
• DW1000 driver with the given examples
• Arduino-DW1000 library
After the SPI clock was reduced to 1.4MHz. the STM32 was able to talk to DWM1000 module and was able to get the DeviceID successfully.
Then we tried to do the ranging between 2 of the PCBs. One PCBs running Two-Way-Ranging-Initiator and other running the Two-Way-Ranging-Responder.
This codebase was a C++ abstraction of the DW1000 driver. But the Ranging was not occurring. Therefore we tried,
• DW1000 driver with Pure C
• DW1000 two-way-ranging example
• Arduino-DW1000 library
All above attempts were failed on getting ranging.
Therefore we tried another Arduino based library which is a fork from the previously mentioned Arduino-DW1000 library (GitHub - F-Army/arduino-dw1000-ng: Arduino driver and library to use Decawave's DW1000 IC and relative modules.)
For our surprise it did worked without any issues. Therefore the firmware developer (myself) ported that library to STM32 HAL and indeed it worked. Gave the correct results.
Once we were sure the DWM1000 modules on our PCBs were working correctly. We assembled the rest of the product and tried testing again.
For our surprise the ranging didn’t work at all. It’s the same firmware we tested before we assemble the PCBs inside the enclosures.
Since we know that the firmware worked before assembly we tried again and again few times.
The ranging happens like once every 10 times for few seconds and then nothing.
No interrupts are occurring, Ranging requests are timing out.
Today also we tested. For few minutes the ranges were coming. But they were wrong. The ranges gave from the responder side was -30000.000 meters. Which is clearly wrong. But when we re-ran the debugger then after that nothing came. Not even the wrong distances.
I did few things,
• Compiled and flashed the simple_rx and simple_tx example codes
STM32 devkits can run the code without any issues and the devkits receives the packets that are being sent by the “sender”.
• Increased the DWT_TIME_UUS and other time based variables in twr_responder and twr_initiator example codes
Additional Information,
MCU : STM32F4
CPU Clock : 64MHz
SPI Clock : MIN: 1.4MHz, MAX: 16MHz
Channels tried : 2 and 5
PRF tried : 16MHz and 64MHz
Data rates tried : 110K, 850K
Nothing seems to make the ranging work. But in all above test cases the “Simple_RX” and “Simple_TX” example works without any issues. But the ranging examples doesn’t