Understanding how use API Functions of DW1000 with DWM1001 firmware

I have a DWM1001-Dev board with a Raspberry Pi. I was reading the DWM1001 Firmware User Guide and on section 2.2 I’ve noticed that the PANS library of the factory image DWM1001_PANS_R2.0 contain the DW1000 Driver. On the section 2.3.3 it says that

Decawave’s DW1000 API driver. For details please see DW1000 Software API Guide

So I would like to understand if I’m flashing that firmware was I able to use the API function provided in the DW1000 DEVICE DRIVER APPLICATION PROGRAMMING INTERFACE (API) GUIDE?

For instance, if I want to read the CIR buffer with the function dwt_readdiagnostics, Am I able to do that? Or do I need to compile a new firmware from the source code provided by Decawave with the function I need from the DW1000 API?

Basically, I’m not understanding how to use the function provided by the DW1000 API to the DWM1001-Dev board

You have here PANS SW component, which includes basic driver deca_device; API examples with deca_device and hardware target platform dwm1001.

When dwm1001 combined with PANS, that is an MDEK. And no, in MDEK you cannot in general get a direct access to the deca_device and read ACC.

When Dwm1001 combined + API examples, you can run a number of quite simple examples and exercise basic functions from deca_driver. Yes, you can read ACC here. But with this examples you cannot do TWR with PANS.

For studying purposes I would recommend to use EVB1000 + PC Decaranging. That would be the best out-of-the-box experience to read and see Accumulators and have another direct access to the DW chip.

Potentially you can run the Usb2Spi code on the dwm1001, but that is tricky, DE aranging may or may not support such hack and you really need to understand the embedded programming. Tip: use TREK1000 or EVB1000 project to extract the usb2spi protocol.

1 Like

So basically, I need to write my own “example” that manage the TWR; so, creating a frame, sending it, recieving it and reading ACC.

Is it correct?

And, in this scenario, can I use directly the function of the DW1000 API or do I need to rewrite them (at least the one I need) inside the source code of my “example”?

You can use EVB1000, TREK1000, or the API Examples with Simple TWR to get the TWR code. On top of that code, you just require to read ACC and send it to the desired output.

Note, ACC is 4Kb and you need to adjust all timings to reflect time required sending ACC over UART/USB.