Skip to main content
dan10
Associate II
June 9, 2009
Question

Has anyone tried the stm32f102 and got usb working? Can't enumerate.

  • June 9, 2009
  • 2 replies
  • 647 views
Posted on June 09, 2009 at 06:31

Has anyone tried the stm32f102 and got usb working? Can't enumerate.

    This topic has been closed for replies.

    2 replies

    dan10
    dan10Author
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:14

    An update:

    If I look on the scope I see the lines being pulled low and high, this stops after about a second and then windows reports unrecognised device, the exact same software works perfectly on the STM32F103 but not the 102??

    Any ideas?

    dan10
    dan10Author
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:14

    I am using the stm32f102c8 processor. Iv got all the hardware I am using apart from the USB, which I had running fine on the stm32f103.

    If I look at the USB d+ pin it is constantly held high, and I don't see any data what so ever appear. The d- pin remains low.

    Iv checked the clock speed is running at 48MHz by outputing it the the PA8 pin. (I have 8 MHz xtal, PLL x6 = 48. and USB RCC is set to DIV1.

    All that happens is the code gets stuck in while ( pInformation->Current_Configuration == 0 )

    and UNKNOWN device appears in the windows device manager. I have tried everything, iv altered the stack and heap sizes, I am using the USB dev kit library v1.00. The USB interrupt does fire when first powering on.

    When i use the debugger on the stm32f103 the USB_Istr() routine runs correctly and i can reach breakpoints at this point in the code (where *** = breakpoint)

    if (wIstr & ISTR_SOF & wInterrupt_Mask)

    {

    *** _SetISTR((u16)CLR_SOF);

    *** bIntPackSOF++;

    #ifdef SOF_CALLBACK

    SOF_Callback();

    #endif

    }

    on the STM32f103 this occurs when WINST = 0x1b00 && int mask = 8600

    on the STM32f102 these breakpoints never occur.

    In my HW_Config.c file on the stm32f103 I have not had to configure the gpio pins to alternate function or anything like that. Should I be configuring the USB pins at all?

    I would be very appreciative to hear of any suggestions you may have.

    Regards

    Dan