Disable system reset on USB connect/disconnect

Post here first, or if you can't find a relevant section!
Post Reply
mcu8484
Posts: 13
Joined: Tue Oct 20, 2020 1:11 am

Disable system reset on USB connect/disconnect

Post by mcu8484 »

Does anyone know how to disable automatic system reset on USB CDC connect/disconnect in stm32duino?

Thanks
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 26
Location: Prudnik, Poland

Re: Disable system reset on USB connect/disconnect

Post by GonzoG »

There is no such thing. STMs do not need to reset on USB connect like AVR Arduino boards.
If your board resets then it's rather hardware related.
mcu8484
Posts: 13
Joined: Tue Oct 20, 2020 1:11 am

Re: Disable system reset on USB connect/disconnect

Post by mcu8484 »

There is no HW triggering reset. The issue appears to be the stm32duino USB CDC driver which takes a long time (>1s) in its ISR when the USB host connects/disconnects leading to watchdog timeout reset. Disabling the watchdog is not an option.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Disable system reset on USB connect/disconnect

Post by ag123 »

use a longer timeout for watchdog reset?
jacobli
Posts: 42
Joined: Fri Jun 11, 2021 3:40 am

Re: Disable system reset on USB connect/disconnect

Post by jacobli »

Do you want to directly disable automatic reset?
mcu8484
Posts: 13
Joined: Tue Oct 20, 2020 1:11 am

Re: Disable system reset on USB connect/disconnect

Post by mcu8484 »

jacobli wrote: Fri Jun 02, 2023 9:42 am Do you want to directly disable automatic reset?
Yes but I need to keep the watchdog active and not longer than 1s. I am guessing that the stm32duino USB CDC driver is doing some handshaking with the host when USB connect/disconnect but taking too long and triggers the watchdog reset.

It would be helpful if someone who knows the stm32duino USB CDC driver internals can point out a potential solution (e.g. where to insert watchdog reset call, etc.).
Post Reply

Return to “General discussion”