How to Configure Micro Controller as USB Host and Device with Single WorkSpace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-21 9:39 PM - edited ‎2024-11-23 5:19 AM
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
- Labels:
-
STM32F4 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-22 1:59 PM
> 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-23 5:19 AM
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-23 5:31 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-23 10:44 AM - edited ‎2024-11-23 10:49 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-25 2:16 AM
Thanks For the Response, we don't want Conditional initialization ,it has to be Initialise Upfront One Port as Host and Another Port as Device. Means One Port Always Configure as Device HS and Another Port Always Configure as HOST FS so How we can Merge Configuration File of Both ?
For this anything we can do ?
Thank You
Aman Kumar Gond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-25 2:27 AM
Thank you for Your Response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-25 6:52 AM
> How we can Merge Configuration File of Both ?
The names in the configuration .h files and in cube-generated C files usually have suffixes _HS and _FS for respectively HS and FS USB controller. So combining files for both controllers should not cause lot of conflicts. Of course, manual revision is needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-26 10:00 AM
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.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
