Hello,
Whenever we reset our custom board with the USB cable plugged in and powered, the NRF_POWER->USBREGSTATUS has a value of 1. It will not go to a value of 3 (OUTPUTRDY bit is set) until we re-plug the USB cable. Therefore, we only see the APP_USBD_EVT_POWER_DETECTED event, and not the APP_USBD_EVT_POWER_READY event. This causes our device to not enumerate (as serial port) on the host PC. When we reset the device, and then plug in the cable everything works fine and we get the ready event.
Is this normal behavior, or is there something wrong with our initialization? See the relevant code below.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//In sdk_config.h
#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1
int main(void)
{
nrfx_err_t err_code;
//......
cli_init();
usbd_init();
ble_init();//Initialises the softdevice
//......
for(;;) {
idle_state_handle();
nrfx_wdt_channel_feed(main_loop_wdt_channel);
}
}