I bought a number of DWM3000TR13 v1.4 modules from Aliexpress and I am having some difficulties in getting them to work. The reported ID is fine (DECA0302) but it fails to enter IDLE_RC state whatever I try.
while (!dwt_checkidlerc()){} // hangs
The device is connected as follows:
SPI all pins connected to Master SPI mode on an STM32 using 1Mbps
WAKEUP is connected to ground
RSTN is connected to Open Collector without pullup
IRQ/CSN connected to Input pins on an STM32
EXTON unconnected
I am using the Decawave driver from 2020:
#define DW3000_DEVICE_DRIVER_VER_STRING "DW3000 C0 Device Driver Version 04.00.00"
I have done the usual checks:
Checked all connections
Made sure SPI speed is less than 7Mbps
Check stability of power supply
Check RSTN/SPI protocol using a Logic Analyzer
Checked the rise time of RSTN, tried with external/internal pull-up
Tried calling dwt_initialise before dwt_checkidlerc, this was mentioned in one of the posts
Changed module (twice) just in case I had a bad one
Asked Claude to have a go at trying to change from INIT_RC to IDLE_RC state
Check the various files (reset_DWIC, port.c, deca_device.c etc) from the latest QORVO drivers but found no significant differences.
I might have some really bad luck and bought a bunch of defective/cloned/rejected devices so before I re-order from DigiKey/Mouse is there anything else I can try?
I suggest to fully move to a more recent drivers, as I would expect changes in behaviour between the driver 04.00.00 and the one delivered with the latest QM33 SDK (08.02.02), despite the fact they may not look significant diverging using a diff.
I suggest you significantly reduce the SPI speed to maybe 1 MHz for this test. Can you also send the value of the system register ?
Please also note that Aliexpress is not an official channel partner for Qorvo devices. You can find our authorized channel partners here: How to buy,support & guidance - Qorvo
Thanks for getting back to me so quickly especially given that most companies are closed until the new year.
I printed the status using the code below:
int gpio_example(void)
{
reset_DWIC();
Sleep(2);
printf("Device ID : %08lx\n",dwt_read32bitoffsetreg(DEV_ID_ID, 0));
printf("Sys Status: %08lx\n", (uint32_t)dwt_read16bitoffsetreg(SYS_STATUS_ID, 2U));
while (!dwt_checkidlerc()){}; // Hangs
...
}
which returned:
Device ID : deca0302
Sys Status: 000008c8
Looking at the Sys Status bits it seems I have a supply voltage issue (Bit 19, VWARN) which is strange as I checked the 3.3v rails and added some decoupling but the bit remains set.
Bit 23 SPIRDY indicates that my device is in IDLE_RC mode but dwt_checkidlerc() return 0.
/*! ----------------------------------------------------------------------------------------------------------
* @brief This function checks if the DW3000 is in IDLE_RC state
* input parameters
* output parameters
* return value is 1 if the IDLE_RC bit is set and 0 otherwise
*/
uint8_t dwt_checkidlerc(void)
{
/* Poll DW IC until IDLE_RC event set. This means that DW IC is in IDLE_RC state and ready */
uint32_t reg = ((uint32_t)dwt_read16bitoffsetreg(SYS_STATUS_ID, 2) << 16);
return ( (reg & (SYS_STATUS_RCINIT_BIT_MASK)) == (SYS_STATUS_RCINIT_BIT_MASK));
}
The SYS_STATUS_RCINIT_BIT_MASK=0x1000000UL which checks bit 24 instead of bit 23 SPIRDY?
The latest drivers does the same so I am confused,