drivers: usb_dc_stm32: Fix OUT transfer issue

The driver cannot handle OUT transactions for an endpoint with an
MPS smaller than 64 bytes. To solve the issue, we will not use one
fixed value, EP_MPS, but instead use the actual MPS of an endpoint,
ep_state->ep_mps.

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
This commit is contained in:
Marc Desvaux 2024-01-19 10:38:38 +01:00 committed by Fabio Baltieri
parent 8596ee9337
commit c7cc58ca77
1 changed files with 2 additions and 2 deletions

View File

@ -784,7 +784,7 @@ int usb_dc_ep_enable(const uint8_t ep)
if (USB_EP_DIR_IS_OUT(ep) && ep != EP0_OUT) {
return usb_dc_ep_start_read(ep,
usb_dc_stm32_state.ep_buf[USB_EP_GET_IDX(ep)],
EP_MPS);
ep_state->ep_mps);
}
return 0;
@ -923,7 +923,7 @@ int usb_dc_ep_read_continue(uint8_t ep)
*/
if (!ep_state->read_count) {
usb_dc_ep_start_read(ep, usb_dc_stm32_state.ep_buf[USB_EP_GET_IDX(ep)],
EP_MPS);
ep_state->ep_mps);
}
return 0;