Skip to content

Commit

Permalink
drivers: udc: stm32: Fix RX FIFO min size
Browse files Browse the repository at this point in the history
On USB HS, the previous lower limit of 64 is too small, the value
160 has been chosen apparently through trial and error.

See 1204aa2 for the original implementation in the old device driver.

Signed-off-by: Tobias Pisani <[email protected]>
  • Loading branch information
topisani committed Dec 7, 2024
1 parent a383276 commit 8e6c8ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/udc/udc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ static void udc_stm32_mem_init(const struct device *dev)
}

/* The documentation is not clear at all about RX FiFo size requirement,
* Allocate a minimum of 0x40 words, which seems to work reliably.
* 160 has been selected through trial and error.
*/
words = MAX(0x40, cfg->ep_mps / 4);
words = MAX(160, cfg->ep_mps / 4);
HAL_PCDEx_SetRxFiFo(&priv->pcd, words);
priv->occupied_mem = words * 4;

Expand Down

0 comments on commit 8e6c8ae

Please sign in to comment.