Skip to content

[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

Merged
merged 1 commit into from
Feb 12, 2019
Merged

[USBD] Force re-enumeration #426

merged 1 commit into from
Feb 12, 2019

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Feb 1, 2019

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.

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 fpistm mentioned this pull request Feb 1, 2019
5 tasks
@fpistm fpistm self-assigned this Feb 2, 2019
@fpistm fpistm added the enhancement New feature or request label Feb 2, 2019
@fpistm fpistm added this to the 1.5.0 milestone Feb 2, 2019
@BennehBoy
Copy link
Contributor

@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.

@fpistm
Copy link
Member Author

fpistm commented Feb 5, 2019

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:

hw_config_init();

or in the hw_config:

do not forget to include: usbd_if.h

@BennehBoy
Copy link
Contributor

BennehBoy commented Feb 5, 2019 via email

@BennehBoy
Copy link
Contributor

Haven't tested this yet @fpistm I've been a little bit distracted - will try do so today.

@fpistm
Copy link
Member Author

fpistm commented Feb 11, 2019

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 ?

@BennehBoy
Copy link
Contributor

Yes

@fpistm
Copy link
Member Author

fpistm commented Feb 11, 2019

@BennehBoy
Please, Could you test with this branch:
https://github.com/fpistm/Arduino_Core_STM32/tree/USB_reenum_Test

@BennehBoy
Copy link
Contributor

@fpistm sorry, had a very busy day yesterday - I should be able to test the above this evening.

@fpistm fpistm merged commit 3dc530b into stm32duino:master Feb 12, 2019
@fpistm fpistm deleted the USB_Reenum branch February 12, 2019 14:41
@fpistm
Copy link
Member Author

fpistm commented Feb 12, 2019

I've merge this one as independent of issue met with #419.
This will ease test and fix.

@BennehBoy
Copy link
Contributor

Do I still need to make the test? we can submit a fix via PR if needed right?

@fpistm
Copy link
Member Author

fpistm commented Feb 12, 2019

I'm currently do an update of the last PR with my code to test.

@BennehBoy
Copy link
Contributor

I guess 1.5.0 is drawing close then 👍

@fpistm
Copy link
Member Author

fpistm commented Feb 12, 2019

I hope. I really like release it. Anyway @ktand has a last blocking issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants