This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USBD Detected Event not being triggered in SDK 15.3

We have ported from SDK v15 to v15.3 but now have a problem getting the USBD to start. 

Below is a sort of pseudo-copy of our USB init routine which is working for us on v15.

APP_USBD_CDC_ACM_GLOBAL_DEF(m_app_cdc_acm, _svUserEvents, CDC_COM_INTERFACE, CDC_COM_DATA_INTERFACE,
    CDC_COM_EPIN, CDC_COM_DATA_EPIN, CDC_COM_DATA_EPOUT, APP_USBD_CDC_COMM_PROTOCOL_NONE);

static const app_usbd_config_t usbd_config = { .ev_state_proc = eventsCallback };

void usbd_init ( void ) {
    app_usbd_init(&usbd_config);

    const app_usbd_class_inst_t* class_cdc_acm = app_usbd_cdc_acm_class_inst_get(&m_app_cdc_acm);

    app_usbd_class_append(class_cdc_acm);

    app_usbd_power_events_enable();
}


As you can see we are using the power events to start the driver on a USB connected/detected event. I have been able to confirm that the required power and clock interrupt is enabled, as nrfx_power_clock_irq_handler() executes for some clock events. However inside nrfx_power_irq_handler() the following conditional never evaluates as true:

if ((0 != (enabled & NRF_POWER_INT_USBDETECTED_MASK)) &&
        nrf_power_event_get_and_clear(NRF_POWER_EVENT_USBDETECTED))


I have attached the sdk_config.h as I suspect it I have just missed something in the configuration.

 sdk_config.h

I hope this is enough information to get started, happy to provide further information if needed! 

Many thanks,

Chris
Parents Reply Children
Related