cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F10x Stop Mode & USB

otmar
Associate II
Posted on October 24, 2014 at 20:11

Hi

I'm using STM32F103 in a battery powered device with USB (external power and data transfer over virtual com)

When i run my device without power down and connect USB to PC everything ok.

But after power down and wake up (RTC) my device isn't recognized from PC.

I'm using FirmLib V2.2.0 (i know bit old).

I enable USB clock, init NVIC and USB_Init(),....

nothing works - also i tried is SetCNTR to reset USB - no chance...

i've searched the forum and half internet - no hit

Knew anybody an example for my task - or perhaps an idea?

would be great if one hat a little bit time to answer

thanx otmar

4 REPLIES 4
zzdz2
Associate II
Posted on October 25, 2014 at 14:02

I enable USB clock, init NVIC and USB_Init(),....

 

Maybe you also need to restart system clock(HSE, PLL).

otmar
Associate II
Posted on October 27, 2014 at 09:58

Hi Knik

I tried to start the same Init Functions as after system start - unfortunately without any other effect. All other peripherials (timer, spi, i2c, ...) are ok    - only USB  :(

Have you another idea - perhaps...

thank you

otmar

zzdz2
Associate II
Posted on October 27, 2014 at 10:05

I think it also may be related to the USB pullup resistor.

If pullup not disabled and later re-enabled the host may be unaware that USB device restarted.

otmar
Associate II
Posted on October 28, 2014 at 08:56

Hi Knik

have tried a lot.. and succeded one step.

the hint you gave me with the NVIC - i started the whoe init from system startup -

and it works - the reason is - i have to insert  a delay  after init.

So the PC recognizes my device - BUT: the port isn't available

:(

bad, very bad

i have also tried to Reset the USB (_SetCNTR(1) & _SetCNTR(0))

thanx for your help

otmar