2023-06-30 02:19 AM
Hi,
I have a problem with the configuration of PA10 of stm32mp135 to work as pwm of TIM1_CH3. I also make an experiment to disable completely timer and PWM and I also can't control this pin using gpioset. In the documentation I saw that this pin is dedicated to USB "...OTG_HS_ID is on PA10 (EXTI10)". My question is simple how to disconnect PA10 from USB completely? CubeMx doesn't do that.
Solved! Go to Solution.
2023-07-03 03:25 PM
I find a bit similar problem to my
and finally, I created something like
&usbotg_hs{
status = "okay";
/* USER CODE BEGIN usbotg_hs */
dr_mode = "peripheral";
usb-role-switch;
role-switch-default-mode = "peripheral";
phys = <&usbphyc_port1 0>;
phy-names = "usb2-phy";
/* USER CODE END usbotg_hs */
};
Now my gadget ethernet is working and backlight pwm also. Topic can be closed.
2023-06-30 02:35 AM
I forgot to add that I try to do this on my custom board which has no physical connection with any USB lines.
2023-06-30 02:46 AM
The voltage on this PA10 pin is 3.17V, and my VDD is 3.3V.
Command
gpioset gpiochip0 '10'=0
don't change this value
this one
gpioset gpiochip0 '10'=1
also. This pin has to be somewhere configured to USB or another function.
In the system I have
2023-06-30 06:39 AM
Hi @MWoło.2 ,
Maybe have a look to "u-boot,force-b-session-valid" property in order to disable usage of ID pin.
https://wiki.st.com/stm32mpu/wiki/How_to_configure_U-Boot_for_your_board#USB_OTG_node
Regards.
2023-06-30 07:29 AM
My usbotg_hs section has no 'u-boot,force-vbus-detection;'. I check it and give feedback. Thanks, BR Michal
2023-07-03 12:43 AM - edited 2023-07-03 12:45 AM
Hi Patrick,
Unfortunately, additional record in the U-Boot DTS does not help. I discover something new. The 3.17V voltage on PA10 appears not in the U-Boot but after kernel start. So in my opinion the problem is not in the U-Boot but in the Kernel.
Records like 'force-vbus-detection' do not exist in any Kernel files.
How should look the Kernel DTS related to &usbotg_hs to disable the OTG_HS_ID function of PA10?
BR
Michal
2023-07-03 02:44 PM
I made a teenth of experiments with different parameters in the Kernel dts. The backlight PWM on PA10 works only in the configuration where the added parameter 'usb-role-switch'. Unfortunately in such a configuration gadget ethernet not working. I think it is impossible to set 'peripheral' without involving PA10.
So currently my kernel dts looks
&usbotg_hs{
status = "okay";
/* USER CODE BEGIN usbotg_hs */
dr_mode = "usb-role-switch";
usb-role-switch;
phys = <&usbphyc_port1 0>;
phy-names = "usb2-phy";
/* USER CODE END usbotg_hs */
};
I discover also that changing 'dr_mode = ...' to anything does nothing.
Finally, my question is, does it possible to set 'peripheral' and get PWM on PA10?
2023-07-03 03:25 PM
I find a bit similar problem to my
and finally, I created something like
&usbotg_hs{
status = "okay";
/* USER CODE BEGIN usbotg_hs */
dr_mode = "peripheral";
usb-role-switch;
role-switch-default-mode = "peripheral";
phys = <&usbphyc_port1 0>;
phy-names = "usb2-phy";
/* USER CODE END usbotg_hs */
};
Now my gadget ethernet is working and backlight pwm also. Topic can be closed.