Showing results for 
Search instead for 
Did you mean: 

Issues trying to configure USB as both ethernet and gadget serial

Associate III

We are having issues getting USB to work as both ethernet and gadget serial.

In kernel configuration, We have the CONFIG_USB_ETH configured as inbuilt and CONFIG_USB_G_SERIAL as inbuilt as shown below.


# USB Gadget precomposed configurations





# end of USB Gadget precomposed configurations

Initially we do not see the dev/ttyGS0 appearing, however when we do ifconfig -a we see usb0 appear. Now we run the script which assigned it an IP address and we are able to ssh into the target device. The script also bring up /dev/ttyGS0.

The windows PC shows the VCOM port enumerated, but when the PC application tries to open the COM port it throws up "A device attached to the system is not functioning. Operating system error code 31".

Also when we disconnect the USB cable and connect it back the windows cannot recognize it and the console in target logs the following statement

"[ 6858.235935] dwc2 49000000.usb-otg: dwc2_hsotg_enqueue_setup: failed queue (-11)"

As an experiment we changed the kernel configuration to make the CONFIG_USB_ETH as a module and CONFIG_USB_G_SERIAL as inbuilt, when we bootup we see that the /dev/ttyGS0 appears and when connected to the Windows PC via USB, we see it enumerated as a VCOM port and our PC application running on windows is able to open the port and talk to the board.

We see this issue on ST's evaluation board and our custom board which has STM32MP157FAC processor

Are we missing any other kernel configurations or is the script missing something for serial gadget?

Any help is much appreciated.

ST Employee

Hi @SKris​ ,

Issue you report looks similar to the one here :

Also when using USB as composite you may take care of fifo size settings in DTS


Hope it help


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Olivier,

Sorry for getting back late. I had the FIFO changes in my device tree already, yet it did not make any difference.

I also tried the solution mentioned for USB reconnecting issue, it was not helping with the issue either.