Sometimes it is desired for the USB device to detach and reattach itself to the host. USB device controller driver interface supports detach with usb_dc_detach() function. Subsequently the device can be reattached to the bus by calling usb_dc_attach(). USB device stack sets the control transfer callbacks in usb_enable(). Nordic usb_dc_detach() implementation inadvertedly overwrote registered callbacks with zeroes by clearing endpoint configuration structure. This lead to a NULL pointer dereference during enumeration after device has reattached inself to the host. Preserve the callbacks by removing the eps_ctx_uninit() function. Endpoints runtime data is initialized in usb_dc_attach() so this should pose no problems. Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no> |
||
|---|---|---|
| .. | ||
| device | ||
| CMakeLists.txt | ||
| Kconfig | ||