cancel
Showing results for 
Search instead for 
Did you mean: 

''USB On-The-Go Host'' or ''USB Host''?

Pilot B
Associate II
Posted on April 02, 2018 at 23:30

Hi everyone,

I'm working on a board based on STM32F4XX. We plan to support USB Host on it for communication(CDC). I found there are 'USB On-The-Go Host' and 'USB Host' libraries. I'm not sure which one to use.

First, I downloaded examples from STM32CubeF4

http://www.st.com/en/embedded-software/stm32cubef4.html

  

and found 'STM32Cube_FW_F2_V1.7.0\Middlewares\ST\STM32_USB_Host_Library' V3.2.2. That is the 'USB Host' library.

Later, I also found 'USB on-the-go Host and device library (UM1021)'

http://www.st.com/en/embedded-software/stsw-stm32046.html

This is 'USB On-The-Go Host' library V2.2.0. I found this is very different from the above 'USB Host' Library such as architectures, files and folder structures. For example, this is from usb_conf.h of the sample project:

/****************** USB OTG MODE CONFIGURATION ********************************/

#define USE_HOST_MODE

//#define USE_DEVICE_MODE

//#define USE_OTG_MODE

Interestingly, there is another product in our company that supports 'USB Device'. That product used the 'USB On-The-Go Device' library. So it has this in the usb_conf.h:

/****************** USB OTG MODE CONFIGURATION ********************************/

//#define USE_HOST_MODE

#define USE_DEVICE_MODE

//#define USE_OTG_MODE

As the engineer who worked on that product no longer works for the company any more, I don't know why he used 

'USB On-The-Go Device' library instead of the 'USB Device' library. 

So my questions:

1. Should I use 'USB On-The-Go Host' or 'USB Host' library? Or either one will work?

2. If I'd like to have an eval board to try this USB Host, what is the cheapest board I should use? For example, will this '

STMicroelectronics P-NUCLEO-USB002

' work?

https://www.digikey.ca/products/en/development-boards-kits-programmers/evaluation-and-demonstration-boards-and-kits/787?k=nucleo%2064

 

Thanks everyone!

7 REPLIES 7
Posted on April 03, 2018 at 00:04

For a user facing USB-FS port the STM32F4-DISC1 has a Micro-AB on the south end.

https://www.mouser.com/new/stmicroelectronics/stm32f4discovery/

 

https://www.mouser.com/ProductDetail/STMicroelectronics/STM32F407G-DISC1

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 03, 2018 at 00:42

Hi Clive One,

Thank you so much for your reply.

For the first question, do you know if I should use 

'USB On-The-Go Host' or 'USB Host' library?

Thanks again!

Posted on April 03, 2018 at 03:02

I'm on the peripheral/mass-storage side of the fence, USB host drivers not really my thing, I don't have a useful opinion here.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pilot B
Associate II
Posted on April 04, 2018 at 17:44

Hello everyone,

I'd like to second this question.

Basically, if I need to implement USB Host, should I use the 'USB On-The-Go Host'(UM1021) library or 'USB Host' library(UM1720)?

Thanks!

Posted on April 04, 2018 at 19:53

UM1021 is SPL-based, UM1720 is Cube-based.

SPL is an older 'library', Cube is newer.

(We ought to have a FAQ for this somewhere, btw.)

JW

Posted on April 04, 2018 at 22:23

Hi waclawek.jan,

Thank you so much for your reply. 

So I guess both libraries will work. But which one is better? Or are they equally good?

Thanks again!

Posted on April 04, 2018 at 23:12

I don't know, I don't use either.

JW