cancel
Showing results for 
Search instead for 
Did you mean: 

How to create USB Host using STM32F4 chip to communicate with USB Modems such as Telit?

Daniel Hailu
Associate II
Posted on August 10, 2017 at 21:11

We need software written that implements a STM32F407 host mode USB driver, able to connect and communicate with USB serial devices that expose multiple virtual devices such as GSM/GPRS modems or Telit.

I wanted to get the drivers and library to use the STM32F chip as a host and connect to the Telit USB Modem.

* Implemented using this GCC toolchain 

* Using the standard STM32 USB base USB libraries

* Thread safe, implemented under FreeRTOS reference sample application

* Each discovered bi-directional stream presented as a stream from the library

Has someone done this before? If so can you help.

#usb-modem #stm32-usb-cdc-host-attached #usb #stm32f4 #usb-host-hs
8 REPLIES 8
Posted on August 11, 2017 at 17:57

You might want to review what USB Host Stack libraries are available from commercial vendors, and if the STM32F4 supports sufficient end-points.

ST maintains a list of consultants/contractors. Other assistance may be available via the FAE assigned to your account.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on August 11, 2017 at 21:42

Thanks for the advice if I were to use the STM32Cube to generate USB Host Stack how can I include DTR for CDC communication and only receive data from the selected USB3 from USB Modems virtual com port? Who is the FAE assigned to my account? 

Posted on August 11, 2017 at 21:52

>>

Who is the FAE assigned to my account? 

Check with the local sales office, or from whom you are purchasing STM32 parts currently. ie distributor, reps, etc.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Lix Paulian
Senior
Posted on August 12, 2017 at 00:15

What you have to do, is to implement the CDC Host part of the USB stack (the examples from ST can be used as a starting point). Then you have to add the specific handler for the class that the Telit implements, because I doubt they are using the standard CDC. I implemented this for a Huawei 3G modem and they use a 'VENDOR_SPECIFIC' interface (0xFF), which is mostly compatible with CDC. In your case with Telit, this might be different, but I would be surprised. If you can 'see' your Telit as a serial port when connected to a PC/Mac/Linux, then it can be done via CDC on the ST too.

Posted on August 14, 2017 at 15:13

Do you have links to the examples in ST?  When implementing this for Huawei 3G modem did you have three or more serial com ports when connecting it to the PC so which one did you choose and how did you implement DTR for the USB modem serial port with the CDC? 

Posted on August 14, 2017 at 22:05

The examples are in the CubeMX packages (e.g. for STM32F407: STM32Cube_FW_F4_V1.15). You must download the package from ST's web site. You will find the USB libraries in the 'Middleware' directory, and an example of USB Host CDC in e.g. Projects/STM324xG_EVAL/Applications/USB_Host/CDC_Standalone. You will have to adapt it for FreeRTOS (not a big deal).

There is support for DTR and other control signals in the ST's example, but you have to add it by yourself. However, I did not use it, as the Huawei modem has separate pins for control signals and I connected them to dedicated pins on the controller. In fact I needed only DCD and RI to wake up the controller when an incoming call or SMS is detected.

The Huawei has three serial ports, but I use only one of them. My project was only a proof of concept and it is not something that I can share, but I plan to re-visit it and offer it as an open source project (not the Huawei part, but the USB-CDC-host part). Moreover, it is based on the CMSIS (Keil) USB low level drivers, and I plan to move it to ST HAL drivers. Unfortunately, I am quite involved in other projects at this time, therefore I can't give you a date when this may happen.

Lix Paulian
Senior
Posted on August 15, 2017 at 17:53

I am sorry, I did not implement these signals, so I am not able to help.

Posted on August 15, 2017 at 17:18

Thanks for the advice. It was helpful. For the DTR signals the example did not implement it. is it under the case 

SET_CONTROL_LINE_STATE: and do you know of examples for implementing it for the USB Modem requires it to receive messages using USB?