Conversation
Adds STM32F4 support to TinyUSB Arduino library byt adding stm32 port files and modifying 'tusb_config.h' to check for STM32 Architecture.
Modified tusb_config_stm32.h to automatically map `Serial` to `SerialTinyUSB` for all STM32 boards, removing the need for users to manually `#define Serial SerialTinyUSB` in every sketch.
|
The esp32p4 build is failing, but this appears to be affecting all PRs at the moment, not specific to this one. Known issue? |
|
hmm, I tried to compile with arduino IDE 2.3.7 but got following issue with adafruit feather stm32f405. Would you share your setup PS: ah I see, MSC isn't enabled by default. |
|
Ah right, I might not have enabled the mass storage class! I kept disabling every other than what I was using when I was debugging it and probably left MSC set to 0. I’ll check soon as I can get to my computer. I’m using an f411 Blackpill here. Have you tried any of the other device modes?
On 5 Feb 2026, at 10:49, Ha Thach ***@***.***> wrote:
hmm, I tried to compile with arduino IDE 2.3.7 but got following issue with adafruit feather stm32f405. Would you share your setup
Adafruit_TinyUSB_Arduino/examples/MassStorage/msc_ramdisk/msc_ramdisk.ino:20:1: error: 'Adafruit_USBD_MSC' does not name a type; did you mean 'Adafruit_USBD_CDC'?
20 | Adafruit_USBD_MSC usb_msc;
| ^~~~~~~~~~~~~~~~~
| Adafruit_USBD_CDC
/home/hathach/Arduino/libraries/Adafruit_TinyUSB_Arduino/examples/MassStorage/msc_ramdisk/msc_ramdisk.ino: In function 'void setup()':
/home/hathach/Arduino/libraries/Adafruit_TinyUSB_Arduino/examples/MassStorage/msc_ramdisk/msc_ramdisk.ino:59:3: error: 'usb_msc' was not declared in this scope
59 | usb_msc.setID("Adafruit", "Mass Storage", "1.0");
|
Enable MSC and VENDOR modes in tusb_config_stm32.h
|
I just updated tusb_config_stm32.h to enable MSC and VENDOR modes, should work now. Let me know if there are any more issues :)
On 5 Feb 2026, at 10:59, Jon W ***@***.***> wrote:
Ah right, I might not have enabled the mass storage class! I kept disabling every other than what I was using when I was debugging it and probably left MSC set to 0. I’ll check soon as I can get to my computer. I’m using an f411 Blackpill here. Have you tried any of the other device modes?
On 5 Feb 2026, at 10:49, Ha Thach ***@***.***> wrote:
hmm, I tried to compile with arduino IDE 2.3.7 but got following issue with adafruit feather stm32f405. Would you share your setup
Adafruit_TinyUSB_Arduino/examples/MassStorage/msc_ramdisk/msc_ramdisk.ino:20:1: error: 'Adafruit_USBD_MSC' does not name a type; did you mean 'Adafruit_USBD_CDC'?
20 | Adafruit_USBD_MSC usb_msc;
| ^~~~~~~~~~~~~~~~~
| Adafruit_USBD_CDC
/home/hathach/Arduino/libraries/Adafruit_TinyUSB_Arduino/examples/MassStorage/msc_ramdisk/msc_ramdisk.ino: In function 'void setup()':
/home/hathach/Arduino/libraries/Adafruit_TinyUSB_Arduino/examples/MassStorage/msc_ramdisk/msc_ramdisk.ino:59:3: error: 'usb_msc' was not declared in this scope
59 | usb_msc.setID("Adafruit", "Mass Storage", "1.0");
|
There was a problem hiding this comment.
perfect, thank you very much for your great work. Adding stm32 seems more straighforward than I expect. This only support f4 otg_fs but it is a great starting point. When I got time, I may expand to other families as well.
PS: tested on my feather stm32f405, I slight changes the tusb_config a bit to make it more generic to more stm32 in the future.
|
ci failed with esp32p4 is caused by other issue. |
|
Great! I’ve actually just got an f103 blue pill today and used it to add F1 support! Haven’t fully tested it yet but now that the port files are there then adding more variants is pretty straightforward. I’ll check out the changes you made to make it more generic. I’ll probably push the changes to my fork tomorrow, but I won’t do another pull request yet as I’ve got a couple more boards coming in the next two weeks, so we’ll be able to add much wider support.
On 5 Feb 2026, at 18:27, Ha Thach ***@***.***> wrote:
@hathach approved this pull request.
perfect, thank you very much for your great work. Adding stm32 seems more straighforward than I expect. This only support f4 otg_fs but it is a great starting point. When I got time, I may expand to other families as well.
PS: tested on my feather stm32f405, I slight changes the tusb_config a bit to make it more generic to more stm32 in the future.
—
Reply to this email directly, view it on GitHub<#565 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/B5JMO4SMPTC2VN7QH7HQUFD4KODPNAVCNFSM6AAAAACS4SUT7OVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTONJYGQ2TAMRXHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
great, looking forward to your PR. |
Adds STM32F4 support to TinyUSB Arduino library by adding stm32 port files and modifying 'tusb_config.h' to check for STM32 Architecture.
Note: Still requires user to modify boards.txt file in STM32 Arduino core.