cancel
Showing results for 
Search instead for 
Did you mean: 

How to make the USB_OTG driver work as USB slave in Yocto?

SergeyBlagodarnyy
Associate II

Hello, everyone!

We are developing a custom board with the MYC-YA157C module. We took the the MyIR device tree configuration and add our layer there. The vendor config had a USB_OTG capable of supplying power and acting as a host. A separate chip, controlled by i2s, was responsible for supplying power to the USB. In our device, we decided to simplify and not provide power via USB, because we plan to use this interface only for the firmware downloading. The power chip was removed.

Now, when starting, the u-boot freeses. I rebuilt it with a more verbose configuration and got the following debug output before the freezing:

...
 
usb_add_config: interface 0 = f_fastboot/d7c2e700
 
g_dnl_get_board_bcd_device_number
 
g_dnl_bind: calling usb_gadget_connect for controller 'dwc2-udc'
 
usb_dnl_fastboot: ready
 
dwc2_udc_otg init failed
 
set_config: high speed config #1: usb_dnload
 
fastboot_set_alt: func: f_fastboot intf: 0 alt: 0

As far as I understand, I need to turn off the USB-OTG driver and configure this interface as a normal USB slave.

I am in trouble because I have no experience with this. A colleague quit and I was left with the legacy Yocto configuration.

Could you tell me what steps need to be taken?

Is there any project where a similar problem was solved?

If necessary, I can show any additional information on the problem.

Thank you in advance!

1 REPLY 1
PatrickF
ST Employee

Hi @SergeyBlagodarnyy​ ,

You need to setup your Device Tree according to your HW.

Please refer to following wiki pages

https://wiki.st.com/stm32mpu/wiki/How_to_configure_U-Boot_for_your_board#USB_OTG_node

https://wiki.st.com/stm32mpu/wiki/OTG_device_tree_configuration

Regards.

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.