This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HS USB device with no external Phy on stm32f2xx

Folks

reviewing my code and the recent changes to the RL libs etc

I use the HS USB as a device in the bootloader code and the FS as a host in the application

At the time I wrote the code there was no Keil driver for the HS port if did not use an external Phy

I have had a attempt at now removing the ST code and just using the Keil RL libs and so far its failed to work as expected ( the PC does not recognise the USB device attached)
Plus once its started and I want to return to the bootloader I get endless hard faults ( which I have not seen before )

So I am assuming someone out there has a working version

When you config the USB what settings do you use

e.g.

#define __OTG_HS_EMBEDDED_PHY

HS or not
size of the data package 512 or 64

Looking at the examples and boards I am not aware of one that does not use the external UPLI phy

So can anyone help out and point me in the right direction ?

  • Did you try with define __OTG_HS_EMBEDDED_PHY ?

  • 0) Start with "MCBSTM32F200 HS" configuration

    1) __OTG_HS_EMBEDDED_PHY
    Add this macro to the top of usbd_STM32F2xx_HS.c
    #define __OTG_HS_EMBEDDED_PHY

    2) Get_Descriptor( Device Qualifier )
    Add this declaration to one of your source file, to suppress device speed warning of Windows.
    const U8 *USBD_DeviceQualifier = NULL;

    This method is not a good one, because Get_Descriptor( Device Qualifier ) is not STALLed.
    But there is no other easy way on the current RL-USB device stack.

    3) USBD_xxx_HS_WMAXPACKETSIZE of the endpoints for each class

    This macro defines the max packet size of each endpoint descriptor.
    This figure has to be tuned for full-speed.

    usbd_STM32F2xx_FS.c
    
    #define USBD_HID_HS_WMAXPACKETSIZE  4       // <--- any figure in 1..64
    #define USBD_MSC_HS_WMAXPACKETSIZE  512     // <--- 64
    #define USBD_CDC_ACM_HS_WMAXPACKETSIZE1 512 // <--- 64
    

    Tsuneo

  • Tsuneo

    Thank you for your reply

    I will follow your advise and let you know how I got on

    you mention that the HS port has been tuned for HS but am I correct in understanding that the HS port can also act as FS device.

    In light of later versions of windows eg 7 etc would it allways be better to use the device as HS device eg does the PC controlling the device allways first try to connect at HS first with chirps before then trying to connect at FS to the device connected

    thanks
    Danny

  • > you mention that the HS port has been tuned for HS but am I correct in understanding that the HS port can also act as FS device.

    The OTG_HS of STM32F2/F4 works in High-Speed, just when an external ULPI PHY is attached to the chip. Without any external PHY, OTG_HS still works in Full-speed device or Full-/Low-speed host (with right connections), but it doesn't work in High-spee.

    > In light of later versions of windows eg 7 etc would it allways be better to use the device as HS device eg does the PC controlling the device allways first try to connect at HS first with chirps before then trying to connect at FS to the device connected.

    Huh?
    After all, the device is connected to Windows either in HS or in FS.
    Speed requirement of your application and cost around the extra ULPI PHY determine the option you would take.

    Tsuneo