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.
//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); } } void usbd_init(){ ret_code_t ret; static const app_usbd_config_t usbd_config = { .ev_handler = app_usbd_event_execute, .ev_state_proc = usbd_user_ev_handler }; ret = app_usbd_init(&usbd_config); APP_ERROR_CHECK(ret); app_usbd_class_inst_t const * class_cdc_acm = app_usbd_cdc_acm_class_inst_get(&nrf_cli_cdc_acm); ret = app_usbd_class_append(class_cdc_acm); APP_ERROR_CHECK(ret); ret = app_usbd_power_events_enable(); APP_ERROR_CHECK(ret); }Let me know if I am missing some relevant information.