foldedtoad / dwm3000

Port of Qorvo/Decawave's DWM3000 Module on the DWS3000 Arduino Shield
GNU General Public License v3.0
83 stars 16 forks source link

Unable to read devid #6

Closed pvharmo closed 2 years ago

pvharmo commented 2 years ago

I've been trying to run the example 00 however, the devid reads 6fe50101. I've read DECA0302 once, but now it doesn't work anymore, and I can't figure out what changed. I use the nrf52833-DK which made me think I had to change some configurations and I tried different config_options, but none seems to change the result.

foldedtoad commented 2 years ago

This has something to do with the SPI3 configuration. From logic analyzer traces, the DECA0302 device seems to be using Polarity(0) and Phase(1). I am investigating this now, as I see the same 6fe50101 output also.

foldedtoad commented 2 years ago

The problem is that the nrf52840dk_nrf52840.dts (Device Tree defines for nrf52840) allocate GPIO pins P1.01 and P1.02 to UART1. But the DWM3000 uses those two GPIOs to indicate the SPI Mode. The preferred Mode setting is (0,0) (e.g. Polarity=0, Phase=0).

The solution is to disable the UART1 definition. This is done by introducing a nrf52840dk_nrf52840.overlay into the target project (same level as CMakeList.txt).
See the attached file. nrf52840dk_nrf52840.overlay.pdf

I will update all projects under dwm3000/examples/ soon.

foldedtoad commented 2 years ago

I am closing this issue: the fix has been checked-in. Note that this set of projects (all under the examples/ directory) are now built with Zephyr V2.7: please update to this level.