Dear all,
I am using DWM1000 with TI microcontroller. I have everything working so far, but for some reason when I want to have a delayed TX response for the DS-TWR-RESP example, the DW API always returns a DWT_ERROR.
Let me explain my current setup: I have a TREK1000 node that is reprogrammed for the DS-TWR-INIT example, and a TI microcontroller with my ported drivers. The TI microcontroller runs at 80 MHz, and SPI speed is 20 MHz, which are both faster than TREK microcontroller runs at 72 MHz and SPI speed is 18 MHz (although this is not a true one-on-one comparison of course).
When I run the example, it always returns a DWT_ERROR. So when I read the SYS_STATUS after transmission is triggered I get 0x00802f02. If I check the manual, this means that:
(1) CLK PLL is locked
(2) Preamble is detected
(3) SFD is detected
(4) Leading edge detection is performed
(5) PHY header is detected, and
(6) Data frame is ready.
Then I printed the timestamps of a received poll time, expected transmission time and (for debugging purpose) also the system timestamp just after the dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED);
, and shows that the dwt_starttx already throws in an error before the actual transmission.
How could this happen, and what should I improve to fix this? A glimpse of the data (only higher 32 bit are printed):
TX: Response failed.. return code: 00802f02
Received poll time: 407372753
Expected resp time: 408038353
Recorded syst time: 407873832
TX: Response failed.. return code: 00802f02
Received poll time: 657462164
Expected resp time: 658127764
Recorded syst time: 657959886
TX: Response failed.. return code: 00802f02
Received poll time: 907551564
Expected resp time: 908217164
Recorded syst time: 908050362
TX: Response failed.. return code: 00802f02
Received poll time: 1157640953
Expected resp time: 1158306553
Recorded syst time: 1158140794