Skip to main content
WLeun.3
Associate III
March 8, 2022
Solved

stm32mp157f-dk2 usb gadget

  • March 8, 2022
  • 2 replies
  • 5034 views

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.

This topic has been closed for replies.
Best answer by WLeun.3

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

2 replies

WLeun.3
WLeun.3Author
Associate III
March 18, 2022

Do anyone have experience with the serial usb?

Kevin HUBER
Technical Moderator
March 18, 2022

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.NEW ! Sidekick STM32 AI agent, see here
WLeun.3
WLeun.3AuthorBest answer
Associate III
March 21, 2022

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