Skip to main content
Visitor II
June 20, 2023
Solved

stm32mp135 pwm dts

  • June 20, 2023
  • 1 reply
  • 1446 views

Hi,

can some share dts configuration which allows you to bring up the PWM, timer etc?

I do something like

 

	pwm_regulator {
		compatible = "pwm-regulator";
		pwms = <&{/soc/timer@40002000/pwm} 3 500000 0>;
		regulator-min-microvolt = <1016000>;
		regulator-max-microvolt = <1114000>;
		regulator-name = "vdd_logic";

		/* Voltage Duty-Cycle */
		voltage-table = <1114000 0>,
				<1095000 10>,
				<1076000 20>,
				<1056000 30>,
				<1036000 40>,
				<1016000 50>;
	};

 

 plus

 

&timers4{
	status = "disabled";

	/* USER CODE BEGIN timers4 */
	/delete-property/dmas;
	/delete-property/dma-names;
	/* USER CODE END timers4 */

	pwm{
		pinctrl-names = "default", "sleep";
		pinctrl-0 = <&tim4_pwm_pins_mx>;
		pinctrl-1 = <&tim4_pwm_sleep_pins_mx>;
		status = "okay";

		/* USER CODE BEGIN timers4_pwm */
		timer@3 {
			status = "okay";
		};
		/* USER CODE END timers4_pwm */
	};
};

 

 but nothing appears on the boot log and no timers devices are available in /sys/bus/iio/devices and PWM itself.

Why is not working, a similar solution working on stm32mp15x.

    This topic has been closed for replies.
    Best answer by MWoło.2

    OK I think I found a solution, my mistake

    &timers4{
    	status = "okay";
    
    	/* USER CODE BEGIN timers4 */
    	/delete-property/dmas;
    	/delete-property/dma-names;
    	compatible = "st,stm32-timers";
    	/* USER CODE END timers4 */
    
    	pwm{
    		pinctrl-names = "default", "sleep";
    		pinctrl-0 = <&tim4_pwm_pins_mx>;
    		pinctrl-1 = <&tim4_pwm_sleep_pins_mx>;
    		status = "okay";
    		compatible = "st,stm32-pwm";
    	};
    		/* USER CODE BEGIN timers4_pwm */
    		timer@3 {
    			compatible = "st,stm32h7-timer-trigger";
    			status = "okay";
    		};
    		/* USER CODE END timers4_pwm */
    };

     rest can be found on

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

    1 reply

    MWoło.2AuthorAnswer
    Visitor II
    June 21, 2023

    OK I think I found a solution, my mistake

    &timers4{
    	status = "okay";
    
    	/* USER CODE BEGIN timers4 */
    	/delete-property/dmas;
    	/delete-property/dma-names;
    	compatible = "st,stm32-timers";
    	/* USER CODE END timers4 */
    
    	pwm{
    		pinctrl-names = "default", "sleep";
    		pinctrl-0 = <&tim4_pwm_pins_mx>;
    		pinctrl-1 = <&tim4_pwm_sleep_pins_mx>;
    		status = "okay";
    		compatible = "st,stm32-pwm";
    	};
    		/* USER CODE BEGIN timers4_pwm */
    		timer@3 {
    			compatible = "st,stm32h7-timer-trigger";
    			status = "okay";
    		};
    		/* USER CODE END timers4_pwm */
    };

     rest can be found on

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