Skip to content

Conversation

@kasjer
Copy link
Contributor

@kasjer kasjer commented Nov 4, 2025

STM32F1/F3 do not have internal pull-up resistor on D+ line that can be automatically attached.
Many board have external pull-up resistor that is
connected all the time.
So far when USB_DP_HAS_EXTERNAL_PULL_UP was 1 (default) code was shorting D+ line to the ground as GPIO output for a wile during startup.

It is possible to have external pull-up resistor that is switchable at runtime (via transistor or resistor is just sourced from one of the GPIO pins).
For this purpose now dcd_connect and dcd_disconnect functions are provided that can enabled pull-up resistor in several ways.

With such setup device that is connected to USB just for power does not have to be detected by host system as broken one.

@github-actions github-actions bot added USB All USB work should have this label size/s labels Nov 4, 2025
@kasjer kasjer force-pushed the kasjer/tinyusb-stm32f1-connect-disconnect branch from 84c6ab1 to 9cd53df Compare November 4, 2025 18:39
STM32F1/F3 do not have internal pull-up resistor on D+
line that can be automatically attached.
Many board have external pull-up resistor that is
connected all the time.
So far when USB_DP_HAS_EXTERNAL_PULL_UP was 1 (default)
code was shorting D+ line to the ground as GPIO output
for a wile during startup.

It is possible to have external pull-up resistor that
is switchable at runtime (via transistor or resistor
is just sourced from one of the GPIO pins).
For this purpose now dcd_connect and dcd_disconnect
functions are provided that can enabled pull-up resistor
in several ways.

With such setup device that is connected to USB just
for power does not have to be detected by host system
as broken one.

Signed-off-by: Jerzy Kasenberg <[email protected]>
@kasjer kasjer force-pushed the kasjer/tinyusb-stm32f1-connect-disconnect branch from 9cd53df to facd067 Compare November 5, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s USB All USB work should have this label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant