[171] USB,USBD: USB might not power up

This anomaly applies to IC Rev. Rev 1, build codes QIAA-Cx0, CKAA-Cx0.

It was inherited from the previous IC revision Engineering C nRF52840.

Symptoms

The USBD might not reach its active state. It is also possible that the USBD reaches its active state, but with an increased delay.

Conditions

Firmware enables USBD or exits USBD low power mode (clears USBD->LOWPOWER) and enters System ON IDLE before the USBD module is fully powered up.

Consequences

The USBD sometimes does not function.

Workaround

To enable the USBD (USBD.ENABLE = 1) or to wake the USBD during SUSPEND (USBD.LOWPOWER = 0), apply the following code:

if(*(volatile uint32_t *)0x4006EC00 == 0x00000000)
{
  *(volatile uint32_t *)0x4006EC00 = 0x00009375;
}
*(volatile uint32_t *)0x4006EC14 = 0x000000C0; 
*(volatile uint32_t *)0x4006EC00 = 0x00009375;

NRF_USBD->ENABLE = 0x00000001; // or NRF_USBD->LOWPOWER = 0x00000000;
After receiving the corresponding acknowledgment event (i.e. USBD.EVENTS_USBEVENT with USBD.EVENTCAUSE.READY=1 in case of enabling or USBD->EVENTCAUSE.USBWUALLOWED=1 in case of wakeup), apply the following code:

if(*(volatile uint32_t *)0x4006EC00 == 0x00000000)
{
  *(volatile uint32_t *)0x4006EC00 = 0x00009375;
}
*(volatile uint32_t *)0x4006EC14 = 0x00000000; 
*(volatile uint32_t *)0x4006EC00 = 0x00009375;