I have a STM controller with usb host and device functionality, How can i connect Quectel EC25 4G modem with USB to the stm micro controller. Whether configuring stm to USB Host CDC class will detect the 4G modem as Communication Device and i will be able to send AT commands OR some specific modification are required. I'm lost here, how to move forward with this integration, Please help
Asked
Active
Viewed 451 times
0
-
I'm not familiar with the EC25 module. But a quick peak at the datasheet shows that the module also supports UART and I2C. Aren't these interfaces sufficient for your use case, or why would you go to the trouble of implemented a USB host interface? Are are you sure the USB protocol is USB CDC and not some proprietary protocol? – Codo Nov 08 '21 at 14:07
-
It is USB CDC. I was using it this way in my projects. But it is not an easy task and requires a lots of experience – 0___________ Nov 08 '21 at 17:00
-
I'm assuming that in the end you want to use the modem for network communication (TCP/IP). In this case - first make sure that you actually have working communication with the modem - you can send and receive any data through USB. That requires setting up USB Host CDC class that you've described. Then you move on to the other steps - AT commands configuration and integration with some TCP/IP stack of your choice - which I've described here: https://stackoverflow.com/questions/42116869/stm32-lwip-pppos-implementation/42136758#42136758 – J_S Nov 09 '21 at 11:23
1 Answers
1
You have to verify how your modem enumerates and what interfaces it exposes. Keep in mind that some modems can be configured and can exposes different profiles based on its settings.
USB HOST Cdc scans all the interfaces till USBH_MAX_NUM_INTERFACES as setted in your usbd_conf.h. If that profile have a command interface as first CDC interface it should already work, if not, you'll have to modify usbh_cdc.c and force the right interface to be used in the USBH_CDC_InterfaceInit function.
First just check if USBH_MAX_NUM_INTERFACES is high enough and the first CDC interface is a command interface. If that doesn't resolve, please post the full enumeration for your modem.

Damiano
- 698
- 7
- 19