cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5G9J DK2 + 4G Module (USB CDC ECM) not detecting USB device

devin-hu
Visitor

Hi everyone,

I'm working on a project where I want to connect the STM32U5G9J microcontroller to the internet using a 4G module. For this, I purchased the STM32U5G9J-DK2 development kit and a 4G network module that supports USB CDC ECM device mode.

To get started, I referred to the example STM32Cube_FW_U5_V1.7.0\Projects\STM32U5G9J-DK2\Applications\USBX\Ux_Host_HID and configured USB and the USBX stack in STM32CubeMX accordingly. However, the STM32 DK2 does not detect the USB device when it's plugged in — no insertion event is triggered.

I'm a beginner when it comes to both USB and STM32 development. Could anyone suggest what documentation, examples, or guides I should refer to in order to complete this project?

Any help would be greatly appreciated.
Thanks in advance!

4 REPLIES 4

Welcome to the forum.

 


@devin-hu wrote:

a 4G network module that supports USB CDC ECM device mode


We've had long discussions about this before.

These types of modules tend to be targetted at systems with a full OS - like Windows or Linux - to provide the USB Host support.

They tend to have complex composite USB devices which enumerate to multiple interfaces - it's not just a simple UART-over-USB.

This is not well-supported by small microcontrollers.

You'd probably be better looking for a 4G module specifically designed for use with microcontrollers - with UART or similar interface.

EDIT: Or using an embedded Linux host instead.

 


@devin-hu wrote:

I'm a beginner when it comes to both USB and STM32 development. 


Do you have any experience with any other microcontroller(s) ?

This would seem a bit ambitious as a beginner's first project ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
devin-hu
Visitor

Hi, Andrew Neil

Previously, I built a demo using a UART interface. However, due to the 4G module’s UART limitation (maximum baud rate of 1 Mbps), the data throughput was not ideal. In our typical use case, the data volume can reach up to 2MB, and the low throughput introduces significant latency.

To address this, we redesigned the system using the STM32U5G9, which supports USB CDC ECM Host, as the main controller. The 4G module’s only other high-speed interface is USB, so the two devices will communicate via USB CDC ECM.

On the software side, the STM32U5 will use the NetX Duo network stack. Once ECM communication is established, network operations should be possible (though some additional drivers for the 4G module may need to be implemented).

Sounds like a Linux host would be more appropriate...

 


@devin-hu wrote:

The 4G module’s only other high-speed interface is USB, so the two devices will communicate via USB CDC ECM..


Again, it's probably more than just a CDC ECM - there might be half a dozen or so!

What do you see when you plug it into a Windows or Linux machine?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@devin-hu wrote:

due to the 4G module’s UART limitation (maximum baud rate of 1 Mbps), the data throughput was not ideal.


Just a thought: are you sure that was actually limited by the UART speed - not the 4G service?

 

PS:

Note that the STM32U5G9J-DK2 only has 3 Mbytes total RAM - so that's less that 3 seconds of data even at 1Mbps!

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.