It's possible to make work USB-OTG and USART1 in the same device (STM32MP157CAC)?
Hi everyone.
I have an already-designed PCB with an STM32MP157 on it. In order to communicate with an external device, I am using USART1. At the same time, I'm using an USB OTG port to connect my device to my PC.
My problem is that USART1 is working with pins PA10 (AF7: USART1 RX), PA12 (AF7: USART1 DE) and PB6 (AF7: USART1 TX). It seems that PA10 is also set up as OTG HS pin:
usbotg_hs_pins_a: usbotg_hs-0 {
pins {
pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* OTG_ID */
};
};(in stm32mp157-pinctrl.dtsi).
I am not sure at all but I think this pin is not referenced at any device tree file in the whole DTS. However, if I disable usb-otg device, USART1 starts working.
But I don't want to do that.
So after reading the usb-otg driver documentation I discovered the following parameter:
dr_mode: shall be one of "host", "peripheral" and "otg"So I set up my otg as "peripheral" and now my usb otg works when I connect the external device to my USART1. But USART1 still not works.
What am I missing? I also tried deleting node usbotg_hs_pins_a in pinctrl and property pinctrl-0 in usbotg_hs.
My device tree topology is next: I am using a .dts file which includes stm32mp157a-dk1.dts. And I've redefined usbotg_hs node as:
&usbotg_hs {
/delete-property/ extcon;
dr_mode = "peripheral";
};Thank you in advance.
