2018-04-02 02:30 PM
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_MODEInterestingly, 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_MODEAs 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?Thanks everyone!
2018-04-02 03:04 PM
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
2018-04-02 05:42 PM
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!
2018-04-02 08:02 PM
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.
2018-04-04 08:44 AM
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!
2018-04-04 12:53 PM
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
2018-04-04 03:23 PM
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!
2018-04-04 04:12 PM
I don't know, I don't use either.
JW