DW3220 LEDs not working after DEEPSLEEP

We are using a DW3220 with the decawave driver API in our product.


As part of the initialization of the chip we do

/* ... */
	/* RxOK. SFDOK leds, needs to be done first 'cause it overrides the whole
	 * gpio mode mask, rendering dwt_setleds useless if done first. */
	dwt_setgpiomode(GPIO0_FUNC_MASK | GPIO1_FUNC_MASK,
	                DW3000_GPIO_PIN0_RXOKLED | DW3000_GPIO_PIN1_SFDLED);
	/* Rx, Tx leds, Blink on init */

to configure GPIOs for the four LEDs we have on our board. This all works fine, until I actually activate the DEEPSLEEP mode with dwt_entersleep(DWT_DW_IDLE);.
After some time I wakeup the IC again, using

	dwt_wakeup_ic(); /*< implementation of this ensures long-enough wait times after toggle */
		return false;

This also works, and the chips continues to receive and transmit afterwards.

However, the LEDs no longer come on, unless I also do dwt_setleds(DWT_LEDS_ENABLE); after the wakeup.

The LED_CTRL and GPIO_MODE registers are as expected after the wakeup, so I assume some other necessary register is not retained in, or restored from, AON automatically or by the driver.


  • What else do I need to reconfigure after waking up from DEEPSLEEP?
  • Where can I find documentation describing which registers are actually retained in AON?
  • For dwt_configuresleep the API exposes additional flags to pass as the ‘mode’ which are not documented in the AON_DIG_CFG register description. What am I supposed to do with those?

Help is much appreciated! Thank you!

In the mean time I found the answer myself:
DW3000 Family User Manual v1.1: Table 5 on Page 25, in Section Configuraiton Register Preservation.

According to that, both GPIO_MODE and LED_CTRL are preserved in the AON.
In practice I find them to not be restored on wakeup, though.