Skip to content

STM32 F4 Support#565

Merged
hathach merged 5 commits intoadafruit:masterfrom
code-fiasco:stm32f4-support
Feb 5, 2026
Merged

STM32 F4 Support#565
hathach merged 5 commits intoadafruit:masterfrom
code-fiasco:stm32f4-support

Conversation

@code-fiasco
Copy link
Contributor

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.

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.
@code-fiasco
Copy link
Contributor Author

The esp32p4 build is failing, but this appears to be affecting all PRs at the moment, not specific to this one. Known issue?

@hathach
Copy link
Member

hathach commented Feb 5, 2026

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");

PS: ah I see, MSC isn't enabled by default.

@code-fiasco
Copy link
Contributor Author

code-fiasco commented Feb 5, 2026 via email

Enable MSC and VENDOR modes in tusb_config_stm32.h
@code-fiasco
Copy link
Contributor Author

code-fiasco commented Feb 5, 2026 via email

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hathach
Copy link
Member

hathach commented Feb 5, 2026

ci failed with esp32p4 is caused by other issue.

@hathach hathach merged commit 2ccf4c2 into adafruit:master Feb 5, 2026
11 of 12 checks passed
@code-fiasco
Copy link
Contributor Author

code-fiasco commented Feb 5, 2026 via email

@hathach
Copy link
Member

hathach commented Feb 6, 2026

great, looking forward to your PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants