Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/tinyusb: fix USB speed selection for STM32 boards with HS PHY #18926

Merged
merged 3 commits into from
Nov 18, 2022

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Nov 17, 2022

Contribution description

This PR again fixes the USB speed selection for STM32 boards with HS PHY, which was still incorrect with PR #18906. It fixes also the problem after CLOCK_HSE has been renamed CONFIG_CLOCK_HSE.

If the HS port of the STM32 is used together with a HS-PHY enabled by the module periph_usbdev_hs_utmi or periph_usbdev_hs_ulpi, OPT_MODE_HIGH_SPEED must be set as CFG_TUSB_RHPORT1_MODE. Otherwise the built-in on-chip FS-PHY is used and OPT_MODE_DEFAULT_SPEED should be set as CFG_TUSB_RHPORT1_MODE.

Using CFG_TUD_MAX_SPEED for this selection, as provided in PR #18906, works for stm32f429i-disc1 where the HS port is used with the on-chip FS PHY, but not for boards such as stm32f746g-disco or stm32f723e-disco where the HS port is used with an HS PHY.

Testing procedure

The HS port should work for all three mentioned boards with this PR:

BOARD=stm32f429i-disc1 make -j8 -C tests/pkg_tinyusb_cdc_msc flash
USEMODULE=periph_usbdev_hs_utmi BOARD=stm32f723e-disco make -j8 -C tests/pkg_tinyusb_cdc_msc flash
USEMODULE=periph_usbdev_hs_ulpi BOARD=stm32f746g-disco make -j8 -C tests/pkg_tinyusb_cdc_msc flash

Without this PR, the test works for stm32f429i-disc1 but not for stm32f723e-disco and stm32f746g-disco

Issues/PRs references

Fixes PR #18906

@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Area: pkg Area: External package ports Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Nov 17, 2022
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 17, 2022
@gschorcht
Copy link
Contributor Author

@benpicco I had to push another fix c42b6d6 for change I found after rebasing the PR. CLOCK_HSE was renamed to CONFIG_CLOCK_HSE. Ist the ACK still valid?

@benpicco
Copy link
Contributor

Is the ACK still valid?

sure!

@riot-ci
Copy link

riot-ci commented Nov 17, 2022

Murdock results

✔️ PASSED

600421d tests/pkg_tflite-micro: fix the out of ROM problem for stm32fdiscovery

Success Failures Total Runtime
117847 0 117848 02h:20m:05s

Artifacts

@gschorcht
Copy link
Contributor Author

Oops, the error in Murdock is completely unrelated to this PR 🤔 How can this happen?

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Nov 18, 2022
@gschorcht
Copy link
Contributor Author

Oops, the error in Murdock is completely unrelated to this PR thinking How can this happen?

I pushed a fix for it as part of this PR.

@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 18, 2022
@benpicco benpicco merged commit 29812d0 into RIOT-OS:master Nov 18, 2022
@gschorcht gschorcht deleted the pkg/tinyusb_fix_speed_stm32 branch November 24, 2022 13:28
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Area: pkg Area: External package ports Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants