2025-11-03 5:05 AM - last edited on 2025-11-03 5:12 AM by Andrew Neil
Hey!
I'm trying to create a driver for the STM32U545 for TinyUSB . Currently, theres a driver existing for device mode, and theres driver for the boards using synopsys and not usb_fsdev. I have followed the reference manual, and gotten so far:
hcd_stm32_fsdev.c (the driver itself)
stm32_helpers.h (helper function for different accesses)
It detects the device, and starts sending some data, but then it just stops. Here's full stack trace:
[13:54:09.609] Welcome to our controller!
[13:54:13.617] [0:] USBH Device Attach
[13:54:13.771] Device unplugged while debouncing
[13:54:13.930] [0:] USBH Device Attach
[13:54:14.133] Full Speed
[13:54:14.146] [0:0] Open EP0 with Size = 8
[13:54:14.154] Get 8 byte of Device Descriptor
[13:54:14.162] [0:0] Get Descriptor: 80 06 00 01 00 00 08 00
[13:54:14.176] [:0] on EP 00 with 1 bytes: OK
[13:54:14.185] [:0] on EP 80 with 1 bytes: OK
[13:54:14.193] [0:0] Control data:
[13:54:14.198] 0000: 00 |.|
[13:54:14.215] [:0] on EP 00 with 1 bytes: OK
[13:54:14.224] Set Address = 1
[13:54:14.228] [0:0] Set Address: 00 05 01 00 00 00 00 00
[13:54:14.242] [:0] on EP 00 with 1 bytes: OK
[13:54:14.251] [:0] on EP 80 with 1 bytes: OK
[13:54:14.260] [0:1] Open EP0 with Size = 0
[13:54:14.268] Get Device Descriptor
[13:54:14.274] [0:1] Get Descriptor: 80 06 00 01 00 00 12 00
[13:54:14.288] [:1] on EP 00 with 1 bytes: OK
[13:54:14.297] [:1] on EP 80 with 1 bytes: OK
[13:54:14.305] [0:1] Control data:
[13:54:14.310] 0000: 00 |.|
[13:54:14.327] [:1] on EP 00 with 1 bytes: OK
[13:54:14.336] [0:1] Get Descriptor: 80 06 00 03 00 00 02 00
[13:54:14.350] [:1] on EP 00 with 1 bytes: OK
[13:54:14.359] [:1] on EP 80 with 1 bytes: OK
[13:54:14.367] [0:1] Control data:
[13:54:14.372] 0000: 00 |.|
[13:54:14.389] [:1] on EP 00 with 1 bytes: OK
[13:54:14.398] [0:1] Get Descriptor: 80 06 00 03 00 00 00 00
[13:54:14.412] [:1] on EP 00 with 1 bytes: OK
[13:54:14.421] [:1] on EP 00 with 1 bytes: OK
[13:54:14.430] Get Configuration[0] Descriptor (9 bytes)
[13:54:14.440] [0:1] Get Descriptor: 80 06 00 02 00 00 09 00
[13:54:14.454] [:1] on EP 00 with 1 bytes: OK
[13:54:14.463] [:1] on EP 80 with 1 bytes: OK
[13:54:14.471] [0:1] Control data:
[13:54:14.477] 0000: 00 |.|
[13:54:14.493] [:1] on EP 00 with 1 bytes: OK
[13:54:14.502] Get Configuration[0] Descriptor
[13:54:14.510] [0:1] Get Descriptor: 80 06 00 02 00 00 00 00
[13:54:14.524] [:1] on EP 00 with 1 bytes: OK
[13:54:14.533] [:1] on EP 00 with 1 bytes: OK
[13:54:14.542] Set Configuration = 1
[13:54:14.547] [0:1] Set Configuration: 00 09 01 00 00 00 00 00
[13:54:14.562] [:1] on EP 00 with 1 bytes: OK
[13:54:14.571] [:1] on EP 80 with 1 bytes: OK
[13:54:14.579] [1] Aborted transfer on EP 01
[13:54:14.587] [1] Aborted transfer on EP 81
[13:54:14.595] [1] Aborted transfer on EP 02
[13:54:14.602] [1] Aborted transfer on EP 82
[13:54:14.610] [1] Aborted transfer on EP 03
[13:54:14.618] [1] Aborted transfer on EP 83
[13:54:14.626] [1] Aborted transfer on EP 04
[13:54:14.633] [1] Aborted transfer on EP 84
[13:54:14.641] [1] Aborted transfer on EP 05
[13:54:14.649] [1] Aborted transfer on EP 85
[13:54:14.656] [1] Aborted transfer on EP 06
[13:54:14.664] [1] Aborted transfer on EP 86
[13:54:14.672] [1] Aborted transfer on EP 07
[13:54:14.680] [1] Aborted transfer on EP 87
[13:54:14.687] [1] Aborted transfer on EP 08
[13:54:14.695] [1] Aborted transfer on EP 88
[13:54:14.703] [1] Aborted transfer on EP 09
[13:54:14.711] [1] Aborted transfer on EP 89
[13:54:14.718] [1] Aborted transfer on EP 0A
[13:54:14.726] [1] Aborted transfer on EP 8A
[13:54:14.734] [1] Aborted transfer on EP 0B
[13:54:14.742] [1] Aborted transfer on EP 8B
[13:54:14.749] [1] Aborted transfer on EP 0C
[13:54:14.757] [1] Aborted transfer on EP 8C
[13:54:14.765] [1] Aborted transfer on EP 0D
[13:54:14.772] [1] Aborted transfer on EP 8D
[13:54:14.780] [1] Aborted transfer on EP 0E
[13:54:14.788] [1] Aborted transfer on EP 8E
[13:54:14.796] [1] Aborted transfer on EP 0F
[13:54:14.803] [1] Aborted transfer on EP 8F
[13:54:14.812] Device configured
[13:54:14.816] Parsing Configuration descriptor (wTotalLength = 0)
[13:54:23.786] [0:0:0] USBH DEVICE REMOVED
[13:54:23.793] [0:0:0] unplugged address = 1
I'm looking for any help in making it work, however I dont really know how to troubleshoot more. Every tips is appreciated :)
2025-11-03 5:45 AM
Hi @bartosz_
Please note that TinyUSB is not officially supported by STMicroelectronics. Also, the links you mentioned are currently not accessible on my side.
May I ask if you considered using the ST USB Device Library (ST stack) for your STM32U545? It is fully supported and might simplify development and troubleshooting.
If you have any questions or need guidance on using the ST stack, I would be happy to assist.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-11-03 6:43 AM
Welcome to the forum.
Please see How to write your question to maximize your chances to find a solution for best results.
Rather than links to pastebin, you can attach files to your post, or insert the code in the post.
As @FBL said, TinyUSB isn't supported by ST, but they have a forum here - have you tried asking there?
https://github.com/hathach/tinyusb/discussions
Have you tried a forum search for previous discussions?
2025-11-03 6:47 AM
Hey guys!
Thank you for your response :D
I have uploaded the files to the response here. I have tried asking on tinyusb before, as well as searching trough the whole forums. The ST USB Device Library (ST stack) unfortunately only seems to support device mode AFAIK, and I can't find it in CubeMX. The tinyusb driver I made seems to almost be working, however I suspect I might have misunderstood some of the USB spec for that MCU.