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

USBD init with soft device

Hi,

I'm working on SDK 15,

When initializing USBD using function app_usbd_init, I found that if APP_USBD_CONFIG_POWER_EVENTS_PROCESS = 0,

it disabled all USBD event - including Rx and Tx - in my application I do not need the USBD power events (initializing them while soft device is enabled is not supported),

So I tried to eliminate the need to call nrf_drv_power_init (which again is not supported when soft device is enabled),

Does APP_USBD_CONFIG_POWER_EVENTS_PROCESS = 0 prevents usb cdc acm from functioning?

How can I initialize (while soft device already enabled) USBD for only Rx/Tx purpose?

looking  at the code I found the following:

ret_code_t nrf_drv_power_init(nrf_drv_power_config_t const * p_config)
{
#ifdef SOFTDEVICE_PRESENT
    if (nrf_sdh_is_enabled())
    {
        return NRF_ERROR_INVALID_STATE;
    }
#endif
    if (p_config == NULL)
    {
        p_config = &m_drv_power_config_default;
    }

    ret_code_t err_code = nrfx_power_init(p_config);
    if (err_code == NRFX_SUCCESS)
    {
        m_initialized = true;
    }
    return err_code;
}

Regards,

Lior.

Parents Reply
  • OK -

    In all the USB examples USB events are detected by polling (polling task),

    My application works with a battery (softdevice is also active) so I cannot poll USB event all the time,

    So, my question is, when softdevice is active - the only way to handle USB events is by polling them?

    In the softdevice dpecification 1.1 it says that if softdevice is enabled - power interrupts won't rise to the application - while USBD events will,

    I noticed that USBD and power events are somewhat connected - can you please clarify?

    Currently, USB does not work for me when softdevice is enabled - I'm not polling the event with a task - I'm handling the interrupts - please clarify the issue...

    Regards,

    Lior.

Children
Related