Dwm1001c: dw1000 init problem


I am working with DWM1001C and the deca_device driver provided by decawave/qorvo.
My devices have a power switch and sometimes (about 1 in 40 times) my devices get stuck (see code snipped below) after switching the power on.

The code snipped below shows the first part of the setup/init function and is very similar to the example code provided by decawave (ex_01b_tx_sleep).

After switching the power on, the device of course cannot be in deep sleep mode, so reading devid should not fail - or am I missing something?

SPI, ranging, power supply and everything else is working reliably for hours and days…

Any help would be appreciated.

nrf_gpio_cfg_input(DW1000_IRQ, NRF_GPIO_PIN_NOPULL);

port_set_dw1000_slowrate();  // Set SPI clock to 2MHz

if(dwt_readdevid() != DWT_DEVICE_ID) // Device was in deep sleep (the first read fails)
	// Need to keep chip select line low for at least 500us


	if(dwt_readdevid() != DWT_DEVICE_ID)
		while (1) {};


//remaining setup/initialization followed by twr procedure

Hi @looki
that could be caused by a lot of think. It would be better to try if for a few times and if it keeps failing then try to reset the DW and try it again.