cancel
Showing results for 
Search instead for 
Did you mean: 

stm32mp157f-dk2 usb gadget

WLeun.3
Associate III

Hi everyone,

I am using stm32mp157f-dk2 with ecosystem 3.1.

I want to configure the usb type C port(CN7) as serial port, and communicate with the host PC.

This article helps me a lot. https://wiki.st.com/stm32mpu/wiki/USB_overview#How_to_configure_USB_Gadget_through_configfs

I modified the usbotg-gadget-config.bb, the stm32_usbotg_eth_config.sh and create my own service, as attached.

After that, I can successfully set up the device. I can see ttyGS0 show up in my device.

However, when I connect it to the host, although the host is able to detect my device, it can't recognize my device.

What am I missing?

I suspect that it is the stlink causing the issue, as it occupy the ttyACM0 already and the host cannot create another tty corresponding to the GS0. I am not sure how will the host OS deal with this situation.

Regards,

Leung

10/3 update: I found that my PC can't boot up when the device is connected. It scared me. I am still investigating why it is failing, but I think the stlink is not the root cause.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Kevin HUBER​ ,

I have already fixed it. Setting USB_G_SERIAL=Y in kernel config solve my problem.

Anyway, thanks for your reply.

Regards,

Leung

View solution in original post

3 REPLIES 3
WLeun.3
Associate III

Do anyone have experience with the serial usb?

Kevin HUBER
ST Employee

Hello @WLeun.3​,

I will try to help you

Please can I have:

  • Your complete Bootlog
  • Your complete DTB file to verify the usbotg_hs configuration.

Regards,

Kevin

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 @Kevin HUBER​ ,

I have already fixed it. Setting USB_G_SERIAL=Y in kernel config solve my problem.

Anyway, thanks for your reply.

Regards,

Leung