This procedure was tested on iMX93 EVK A0 silicon version with BSP 6.1.22 version, this feature should work on A1 silicon version too but is not tested yet.
CONFIG_PWM=y
CONFIG_PWM_ADP5585=y
CONFIG_PWM_CROS_EC=m
CONFIG_PWM_FSL_FTM=m
CONFIG_PWM_IMX27=y
CONFIG_PWM_RPCHIP=y
CONFIG_PWM_SL28CPLD=m
+ CONFIG_PWM_IMX_TPM=y # Add this line
+ &tpm4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_tpm4>;
+ status = "okay";
+ };
...
+ pinctrl_tpm4: tpm4grp {
+ fsl,pins = <
+ MX93_PAD_GPIO_IO05__TPM4_CH0 0x19e //EXP_GPIO_IO05 J1001 29
+ >;
+ };
PWM Configuration on the Board
After flashing, you can configure the PWM settings on the board. Open a terminal and execute the following commands:
$ cd /sys/class/pwm/pwmchip1/
$ echo 0 >> export
$ echo echo 2000000 >> pwm0/period # Set period to 2,000,000 ns (2 ms)
$ echo echo 1000000 >> pwm0/duty_cycle # Set duty cycle to 1,000,000 ns (1 ms)
$ echo 1 >> pwm0/enable
Validation
To validate the PWM output signal, check pin 29 of connector J1001 on the iMX93 EVK Board.
Conclusion
Following these steps should enable PWM functionality on your iMX93 EVK Board. If you encounter any issues, please refer to the documentation or reach out for assistance.
Hi Chavira,
Thanks for showing a way to test the PWM on the iMX93 lpddr4 EVK.
I can confirm that it works also on same EVK that has a A1 silicon.
Your example uses the EXP_GPIO_IO05 pin which is available on J1001 connector ( channel 0 of the TPM4).
Will there be any additional configuration or setting for using a different GPIO (TPM4 channel 3), for example:
pinctrl_tpm4: tpm4grp {
fsl,pins = <
MX93_PAD_GPIO_IO25__TPM4_CH3 0x19e
>;
};
Based on configuration above, I would expect that EXP_GPIO_IO25 pin on J1001 will output the PWM wave, however there is no activity on that pin - any idea why?
I am working with a custom board based on iMX93 (A1 silicon) and need to control a peripheral device with PWM, using GPIO_IO25 pin.
Is there any way to configure TPM4 to use channel 3 (GPIO_IO25) for the PWM output?
Regards
Hi Chavira,
I have disabled flexcan2 however I am still not able to confirm the PWM output on EXP_GPIO_IO25 pin.
Actually, I am facing the same problem.
The following should enable channel 3 on the PWM:
echo 3 > export
On iMX93 EVK LPDDR4X, to enable pin EXP_GPIO_IO25 on J1001 connector so it will connect to GPIO_IO25 on the MCU , I configure the ADP5585 IC through i2C interface and set the GPIO 5 output high: on /dev/i2c-1 bus, for device address 0x34, write 0x10 value to register address 0x27, and then write the same 0x10 value to register address 0x23 for the same device address. After those changes you can test with the scope for PWM waves on pin EXP_GPIO_IO25.
Regards
Thanks a lot