cancel
Showing results for 
Search instead for 
Did you mean: 

PWM input capture does not work. "No device" error.

DKapu.2
Associate

I want to enable input capture functionality on our stm32mp157c based system. I am using Timer 1 channel 4 for the same and have made the necessary additions in the device tree as follows:

&dma1{

status = "okay";

/* USER CODE BEGIN dma1 */

sram = <&dma_pool>;

/* USER CODE END dma1 */

};

&dma2{

status = "okay";

/* USER CODE BEGIN dma2 */

sram = <&dma_pool>;

/* USER CODE END dma2 */

};

&dmamux1{

dma-masters = <&dma1 &dma2>;

dma-channels = <16>;

status = "okay";

/* USER CODE BEGIN dmamux1 */

/* USER CODE END dmamux1 */

};

&timers1{

/* USER CODE BEGIN timers3 */

/* Enable DMA "ch1" for PWM input on TIM1_CH1 */

dmas = <&dmamux1 13 0x400 0x80000001>;

dma-names = "ch3";

status = "okay";

/* USER CODE END timers3 */

pwm {

pinctrl-names = "default", "sleep";

pinctrl-0 = <&tim1_pins_mx>;

pinctrl-1 = <&tim1_sleep_pins_mx>;

status = "okay";

/* USER CODE BEGIN timers1_pwm */

/* USER CODE END timers1_pwm */

};

};

and the gpios are added to pinctrl block

&pinctrl

{

.....

.....

tim1_pins_mx: tim1_mx-0 {

pins {

pinmux = <STM32_PINMUX('E', 14, AF1)>; /* TIM1_CH4 */

bias-disable;

};

};

tim1_sleep_pins_mx: tim1_sleep_mx-0 {

pins {

pinmux = <STM32_PINMUX('E', 14, ANALOG)>; /* TIM1_CH4 */

};

};

}

checking the status in /sys/class/pwm/ shows the device as enabled. However, after running the capture command, No device error is returned0693W00000WHSHRQA5.pngAfter a bit of searching ST's documentation, the error is due to improper dma configuration. However, the configuration is done as instructed in this documentation (using stm32mp151.dts as a reference for dma configuration as instructed in the documentation).

Am I missing something here?

TIA

0 REPLIES 0