-
Notifications
You must be signed in to change notification settings - Fork 1k
[USBD] Force re-enumeration #426
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
Conversation
Enumeration delay could be redefined using USBD_ENUM_DELAY To disable re-enumeration define USBD_REENUM_DISABLED Use USB_DISC_PIN if defined. Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm not sure if this is directly related to this PR, but on blackpill I've noticed that CDC enumeration doesn't occur unless the user sketch initialises the serial port, ie SerialUSB.begin This means that bootloader tools such as hid_flash.exe cannot see the device without it being forced into perpetual bootloader. I'll do some more testing later minus my bootloader PR to esnure I've not confused this somehow. |
Sorry, for the delay, I'm sick so will not be very present this week. Arduino_Core_STM32/cores/arduino/board.c Line 11 in cfb6fb7
or in the hw_config: do not forget to include: usbd_if.h |
OK I'll give that a try, get well soon!
…On Tue, 5 Feb 2019, 09:34 Frederic Pillon, ***@***.***> wrote:
Sorry, for the delay, I'm sick so will not be very present this week.
Righ the reenumerate is done when the Serial.begin() is performed.
You can try to add it in the init after the hw_config call:
https://github.com/stm32duino/Arduino_Core_STM32/blob/cfb6fb7f77a91ea6663487522ad3dc47ce4150d3/cores/arduino/board.c#L11
or in the hw_config:
https://github.com/stm32duino/Arduino_Core_STM32/blob/4e1c22561ae15c976a42699c97e08c53dbb3f4b7/cores/arduino/stm32/hw_config.c#L57
do not forget to include: usbd_if.h
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#426 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AX0eXgLLGwrERXaS4G4oQjtJ_Qf2XuUKks5vKVAygaJpZM4aeqK_>
.
|
Haven't tested this yet @fpistm I've been a little bit distracted - will try do so today. |
What I guess is that not only the re-enum should be done but also the CDC init to catch or not the magic number right ? |
Yes |
@BennehBoy |
@fpistm sorry, had a very busy day yesterday - I should be able to test the above this evening. |
I've merge this one as independent of issue met with #419. |
Do I still need to make the test? we can submit a fix via PR if needed right? |
I'm currently do an update of the last PR with my code to test. |
I guess 1.5.0 is drawing close then 👍 |
I hope. I really like release it. Anyway @ktand has a last blocking issue. |
Enumeration delay could be redefined using
USBD_ENUM_DELAY
To disable re-enumeration define
USBD_REENUM_DISABLED
Use
USB_DISC_PIN
if defined.Tested with BluePill, MapleMini and Disco F746.
Any comments are welcome.