Giovanni wrote:The STM32F3-Discovery is unable to control the USB pull-up resistor that allows to detect the device, it is always ON. After restarting an application or resetting the board is mandatory to disconnect the USB cable and connect it again or the host cannot detect the board again. This is a problem specific to this board only. Giovanni
There is no problem. To disconnect from USB simpy pull down USBD+ USBD- pins and then release them after 1 sec pause.
Not sure if i've got this right, but it appears that post reset, the com port dissapears, a second later re-appears, but still won't let me reconnect to the com port until I pull the cable again.
So not sure what is going on here and if I'm doing it correctly.
I just put it into main.c of my project (I know it's an ugly hack, but it works), into main() where I initialize USB. Didn't test it on windows, though
There are a couple of issues at play on windows 7.
1. You definitely need the extra code to handle the reset and bounce the USB lines. This works as expected (when you test correctly - see point 2) If you don't have it, MCU reset means no com port. 2. In windows, if you have the com port open when you reset the MCU, it will not reconnect until USB disconnected or another MCU reset.
Point 2 is the reason I didn't believe it was working correctly.
The test I was doing was to view the virtual com port output, hit reset, attempt to reconnect to com port and failed. Had I reset again after the failed attempt, it would have connected fine.
If you repeat the process and reset while the com port isn't active, it works 100% of the time. So assuming this is some weird windows / USB issue and not one linked to the device.
Anyway, its working now and I know what is going on.
Now all this has been done because it annoyed me. I'm not going to use the virt com port for any diagnostics output, i'll hook up a usart connector that never drops and I don't have to worry about swapping over USB cables and all that ... but good to know.