usb host contr stm32

dev
Tue Dec 12, 2017 3:32 am
Hi,
i was looking for the option for usb host controller from stm32f.

I want to use usb stick and collect some data from stm32. i need some advise for selecting controller.

Should i go with ftdi chip (no firmware required)which provide host functionality with some interface. So, should i go with micro controller with built in host(firmware required).


ag123
Tue Dec 12, 2017 4:03 am
You can use a sd card with stm32, u’d just needs to search the forum for those threads

dev
Tue Dec 12, 2017 4:10 am
Thanks ag123.
I thought of using SD card but my PC don’t have MMC reader. I want to connect it to one of Machine which send data through UART.
Pendrive would be easy to connect to PC or to Mobile to check data.

vargham
Tue Dec 12, 2017 10:15 am
http://www.st.com/en/development-tools/ … inder.html

Check USB OTG_FS in Peripheral Choice. There will be a list on the right with all STM32 MCUs with the selected feature.


Pito
Tue Dec 12, 2017 10:47 am
There are cheap usb/sdcard readers like
https://www.kingston.com/en/flash/readers/fcr-mrg2
That would be the fastest and easiest way, imho (stm32->sdcard->usb_reader->PC).
There is a lot of topics on stm32 to sdcard data logging here and it works from BPill up.

ag123
Tue Dec 12, 2017 1:26 pm
and some card sellers actually bundle a reader especially for the higher capacity cards that cost a little more

mrburnette
Wed Dec 13, 2017 3:26 pm
[dev – Tue Dec 12, 2017 4:10 am] –
Thanks ag123.
I thought of using SD card but my PC don’t have MMC reader. I want to connect it to one of Machine which send data through UART.
Pendrive would be easy to connect to PC or to Mobile to check data.

This surely seems to be an unusual response… is there more going on here that would preclude you from using one of those inexpensive USB adapters?

If you are doing data collection, I agree it would be easier to just plug in the STM32F1xx and have it enumerate over USB. But the “Maple STM32F1xx boards” do not have this native capability, so SD is the only (simple) option. One of the STM32F4xx boards in the blue footprint may serve your needs, however. There are also STM32F1xx boards with Bluetooth and/or WiFi chips which could support wireless connectivity to the PC.

Ray


stevestrong
Wed Dec 13, 2017 7:19 pm
Have you ever considered to use a CH376 module? It interfaces directly a USB stick, so you don’t need USB host functionality.
http://arduinobasics.blogspot.de/2015/0 … odule.html
I have tested one of these and it really works, but do not expect high access speed.

RogerClark
Wed Dec 13, 2017 7:23 pm
I recall messing around with some “mass storage” code well over a year ago, and I susoect I posted to the forum about it.

There are significant efforts going on at the moment to support USB HID and I susoect that USB mass storage could be added once the HID code is stable.

However at the moment I don’t think any of the cores have the option of USB mass storage built in


dev
Fri Dec 15, 2017 2:50 pm
@stevestrong , CH376 Module is good option to think for that not need to worry about enumeration and hub.

@Roger, If i am not wrong,You are talking about STM32F1xxx as Device which can work as composite device.

i thinking about stm32f4 board which is time consuming…


RogerClark
Fri Dec 15, 2017 6:46 pm
Steve

Several people investigated a composite device, ( specifically one that did not need drivers on Windows ) but they could not make it work on Windows 7.

BlackMagic Probe seems to enumerate as 2 Serial ports and also DFU , at the same time, ( but needs drivers on Windows)

But, On BMP, the DFU device does not seem to be functional at the same time as the serial devices.

I think perhaps it was Dan Drown ( @ddrown) who investigated USB serial. You could google for his posts and perhaps PM him


ddrown
Fri Dec 15, 2017 11:03 pm
Just to make sure I understand what you are asking for:

1. STM32F4x USB serial device, connected to a host that is sending the data
2. The STM32F4x writes that serial data to a USB pen drive on the STM32F4x’s second USB bus

Does that cover it?


ag123
Sat Dec 16, 2017 2:53 am
i’m thinking that in terms of stm32f4 usb host mode, 1 of those ways is perhaps to start with stm32generic core or st’s stm32duino core, review the examples from cubemx etc provided by ST and one could implement usb host functionality. it probably isn’t ‘impossible’ just that it’d take one effort to do so.

arpruss
Sat Dec 16, 2017 5:02 am
[RogerClark – Fri Dec 15, 2017 6:46 pm] –
Several people investigated a composite device, ( specifically one that did not need drivers on Windows ) but they could not make it work on Windows 7.

Just to follow up on this, my black pill running my USB composite library works in HID mode (Keyboard is what I tested) with Windows 7 without any driver, but the serial function doesn’t work on Windows 7, at least without a driver.


stevestrong
Sat Dec 16, 2017 9:28 am
[dev – Tue Dec 12, 2017 3:32 am] –
Hi,
i was looking for the option for usb host controller from stm32f.

I want to use usb stick and collect some data from stm32. i need some advise for selecting controller.

Looking at the original post it seems to me that @dev wants to use the F4 as USB host, to which he would connect an USB (memory) stick.

I would also take the approach pointed out by @ag123.
Or just use as interface a CH376S module.


Leave a Reply

Your email address will not be published. Required fields are marked *