Hi,
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
nrf_gpio_pin_clear(SPI_CS_PIN);
nrf_delay_ms(1);
nrf_gpio_pin_set(SPI_CS_PIN);
deca_sleep(5);
if(dwt_readdevid() != DWT_DEVICE_ID)
{
//PROBLEM HERE
while (1) {};
}
}
reset_DW1000();
//remaining setup/initialization followed by twr procedure