Skip to content

Conversation

@ccli8
Copy link
Contributor

@ccli8 ccli8 commented Dec 23, 2025

This adds support for Nuvoton NuMaker m333x HSUSBD and makes other fixes as below:

  1. Add config for disabling USB on unplug for soc supporting this feature
  2. Fix control out failure with FIFO flush timing in HSUSBD
  3. Fix compile error on m2l31x
  4. Fix submit condition to meet updated msc class driver which requests submit data to be multiple of sector size

Change to retrieve Setup packet by the copy which is readily copied
from H/W register in ISR

Signed-off-by: Chun-Chieh Li <[email protected]>
Some SoC series allow USB function to be disabled temporarily on unplug,
and then enabled back on re-plug. Add support for such configuration
option in DT and UDC driver.

Signed-off-by: Chun-Chieh Li <[email protected]>
For HSUSBD, Control transfer with Data OUT stage will break. This is
caused by FIFO flush which cannot be done timely even though in Setup
token interrupt handler. For this, error recovery with FIFO is not
done in Setup token/packet handler and rely on USB reset handler to do
it as catch-all.

Signed-off-by: Chun-Chieh Li <[email protected]>
With USBD and HSUSBD re-organized, SoC must have USBD and HSUSBD at
the same time to pass compile. However, M2L31 just has USBD and meets
compile error with HSUSBD unsupported. To avoid adding too many
conditional (#if condition) code for the error, create one dummy
HSUSBD device definition for M2L31 to pass compile.

Signed-off-by: Chun-Chieh Li <[email protected]>
Add support for Nuvoton NuMaker M3331 series HSUSBD device driver

Signed-off-by: Chun-Chieh Li <[email protected]>
Fix submit condition for non-control transfer. Do submit when any
of the following conditions is met:
1. Transfer buffer (net_buf) is full
2. Last packet size is less than mps
3. Isochronous transfer

USB mass may request C1 for sector size (512 bytes)-aligned and C2
for CBW (13 bytes).

Signed-off-by: Chun-Chieh Li <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants