Skip to main content
Visitor II
November 22, 2024
Question

How to Configure Micro Controller as USB Host and Device with Single WorkSpace

  • November 22, 2024
  • 3 replies
  • 1945 views

Hello,

           we have Custom PCB Board which Build's around Stm32F4 Series Micro Controller.

In which we have Two USB Port, One Connected with External ULPI (High Speed 480mb/s) Another Connected with internal ULPI (full Speed 12mb/s). And we are Using CDC workspace for Configuring Host and Device on Different Different Port with Different Workspace.

So Now we have Requirement to Develop the Software for Both USB as HOST and USB as Device with There Respective Port.

We want External ULPI as HOST (480 Mb/s) and Internal ULPI as Device(12 Mb/s) but right now For HOST there is Different workspace and for Device there is Different workspace with their Default Configuration of High Speed and Full Speed. So how we can Handle Both Condition in Single Workspace with their Respective Port Configuration.

Thank You 

Aman

 

    This topic has been closed for replies.

    3 replies

    Super User
    November 22, 2024

    We want External ULPI as HOST (480 Mb/s) and Internal ULPI as Device(480 Mb/s) 

    No STM32F4 models have internal high speed ULPI. Not as device and not as host.

     

    AGond.2Author
    Visitor II
    November 23, 2024

    Hello ,

    As I Read in stm32f4 Datasheet, there it was Written PA11 and PA12 Used AF as USB_FS_DM and USB_FS_DP Respectively. 

    So it Means Smt32f4 Module have Internal ULPI.

    Am i Correct ?

    Visitor II
    November 23, 2024

    To handle both USB host and device on different ports in a single workspace, you can configure the STM32F4 USB stack to support both modes. Use conditional initialization to set the external ULPI as the host (480 Mb/s) and the internal ULPI as the device (12 Mb/s). Implement dynamic mode switching based on the active port, ensuring each USB port is initialized with its respective configuration. This approach allows you to manage both ports within a single workspace efficiently.

    Super User
    November 23, 2024

    Ok after editing it is clear. If you don't find a ready example of host and device in one project, get two examples and carefully merge them manually. The USB controllers are independent.

     

     

    AGond.2Author
    Visitor II
    November 25, 2024

    Thank you for Your Response

    Technical Moderator
    November 26, 2024

    Hi @AGond.2 

    You can check datasheet to find out the block diagram of the chip and figure out PHYs embedded in the MCU. STM32F72x for example embeds ULPI PHY for high-speed operations.