Skip to content
Commit 21da8c27 authored by Milind Paranjpe's avatar Milind Paranjpe Committed by Fabio Baltieri
Browse files

drivers: usb: mcux: Deinit then Init endpoint HAL during config



The USB device subsystem driver's set_interface() function calls
usb_dc_ep_configure() followed by usb_dc_ep_enable(). When
switching between alternate settings of a configuration's
interface, set_endpoint() can be followed by reset_endpoint() on
an endpoint. Some time later, set_endpoint() can be called again
on the same endpoint. This results in the HAL's
kUSB_DeviceControlEndpointInit function being called twice in a
row, which causes a memory allocation error. A simple solution is
to call the HAL's kUSB_DeviceControlEndpointDeinit function
before calling kUSB_DeviceControlEndpointInit. This overcomes the
memory allocation error.

Signed-off-by: default avatarMilind Paranjpe <mparanjpe@yahoo.com>
parent 8dffa45e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment