cancel
Showing results for 
Search instead for 
Did you mean: 

Issues trying to configure USB as both ethernet and gadget serial

SKris
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

#

CONFIG_USB_ETH=y

CONFIG_USB_ETH_RNDIS=y

CONFIG_USB_G_SERIAL=y

# 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 stm32_usbotg_eth_config.sh 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 stm32_usbotg_eth_config.sh script missing something for serial gadget?

Any help is much appreciated.

2 REPLIES 2
Olivier GALLIEN
ST Employee

Hi @SKris​ ,

Issue you report looks similar to the one here :

https://community.st.com/s/question/0D53W00001Qeg8OSAR/usb-ethernet-gadget-stops-working-after-replugging-cable

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

See

https://community.st.com/s/question/0D53W00001DK367SAD/usb-composite-in-stm32mp157c

Hope it help

Olivier

Olivier GALLIEN
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.

Thanks,

Shalini