Skip to main content
chen
Associate II
August 28, 2013
Question

STM32_USB-Host-Device_Lib_V2.1.0 working?

  • August 28, 2013
  • 3 replies
  • 964 views
Posted on August 28, 2013 at 13:01

Hi

Help, I have been trying to get the STM32_USB-Host-Device_Lib_V2.1.0 working as a Virtual Com Port/CDC on a STM32F407 in Atollic TrueStudio. No RTOS - bare infinite loop in main.

The code compiles and run OK. USB driver code initializes OK.

However, when I connect the USB up to a Windows7(64bit) PC, the device fails to enumerate properly.

I used MS logman utility to trace what the USB negotiating is happeneing.

The device is detect OK by the Hub.

Host is told about device.

Speed is detected (Full Speed ie USB1)

End point connection is established.

Host requests Descriptor

device replies STALL

Hub Closes Endpoint connection

Process repeats 3 times.

I found the endpoint code in usb_dcd_int.c

I found the code which opens the end point connections.

I found the code which is suppose to send the descriptor.

What I do no know is why the code to send the descriptor is not being executed.

Does anyone know why not?

I also do not know why the code is replying with 'stall'

Maybe his is part of the problem.

    This topic has been closed for replies.

    3 replies

    chen
    chenAuthor
    Associate II
    August 28, 2013
    Posted on August 28, 2013 at 17:12

    Hi

    I have sorted my problem out now.

    I worked out that I was not getting USB interrupts for sending or receiving

    control packets.

    Could not figure out why!

    A colleague of mine told me to look carefully at the chip configuration.

    Eventually, I worked out that the internal clock config was not right.

    I was using the configuration for the Discovery board.

    voltr
    Associate II
    January 2, 2014
    Posted on January 02, 2014 at 19:57

    Did you fixed this problem ? It looks that I have similar one.

    chen
    chenAuthor
    Associate II
    January 3, 2014
    Posted on January 03, 2014 at 09:42

    Hi

    Yes, I did. It was due to incorrect clock freq selection.

    As I said to you in the other thread - the USB peripheral MUST be clocked

    correctly (needs 48MHz) or it will not work!