Skip to main content
Treacy Yao
Associate III
November 20, 2019
Solved

re-enumerate USB on STM32F103

  • November 20, 2019
  • 3 replies
  • 1612 views

CDC function run normally. But if MCU reboot(For example, USB connect to PC and reboot MCU), USB will not recongnized. It will return to normal if I remove USB then insert it again.

So I want to add re-enumerate function to let device re-enumerate though USB always in PC.

  1. How to modify the code to realize re-enumerate function?
  2. I try to set PA12 low to high before USB init. Device cannot run. Maybe blocking
This topic has been closed for replies.
Best answer by Uwe Bonnes

If you want a work-around that is not standard compliant, switch PA12 to GPIO/Open Drain, set it low for about 10 ms, and than set up USB. This works for Bl*ckm*gic debug probes.

3 replies

Uwe Bonnes
Uwe BonnesBest answer
Chief
November 20, 2019

If you want a work-around that is not standard compliant, switch PA12 to GPIO/Open Drain, set it low for about 10 ms, and than set up USB. This works for Bl*ckm*gic debug probes.

Treacy Yao
Associate III
November 20, 2019

I tried. But if I add low PA12 to my code(MX_GPIO_Init). Then my FW cannot run. I don't know why

waclawek.jan
Super User
December 4, 2019

> Then my FW cannot run.

What does it mean? Debug. Find out, what does it exactly do.

JW