Skip to content

Conversation

@code-fiasco
Copy link

Summary

Add a TinyUSB USB menu option for Generic STM32F4 boards to improve compatibility with the Adafruit TinyUSB Arduino library.

This PR fixes/implements the following bugs/features

Feature

  • Adds a TinyUSB USB menu option for GenF4 boards in boards.txt
  • Enables ARDUINO_ARCH_TINYUSB via build.usb_flags when selected

Non-breaking

  • Existing USB options and behavior are unchanged unless TinyUSB is explicitly selected

Motivation

I have completed the STM32 port files for the Adafruit TinyUSB Arduino library and a pull request has been submitted upstream to include them after testing.

Without a dedicated USB menu option in the STM32 core, using TinyUSB currently requires sketch-level workarounds or manual defines. Adding a TinyUSB option in boards.txt allows the core to expose the required build flag cleanly and consistently.

This change enables TinyUSB to work across all STM32F4 boards using the Generic core configuration, simplifying usage and improving compatibility.

While this approach could be extended to other STM32 families in the future, testing for this change has currently been limited to an STM32F411 BlackPill board.

Validation

  • CI build passes
  • Tested on STM32F411 BlackPill
  • Verified TinyUSB CDC works without requiring sketch-level #define workarounds

Code formatting

  • No source formatting changes required (boards.txt only)
  • CI AStyle unaffected

Closing issues

  • N/A

Allows user to make use of TinyUSB if using Generic F4 boards.
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.

1 participant