Skip to main content
Graduate
September 5, 2024
Solved

TIM2_CH2 PWM not work

  • September 5, 2024
  • 5 replies
  • 2196 views

hello,st friends.

   My board use TIM2_CH1 pwm to drive a led.

guansonghuang_0-1725529122888.png

guansonghuang_1-1725529135873.png

dts configure as:

guansonghuang_2-1725529182907.pngguansonghuang_3-1725529192667.png

but the led can not light on.use these command

guansonghuang_4-1725529262366.png

 

byw: I use gpio test led hardware is ok

 

    This topic has been closed for replies.
    Best answer by Jean-Marc S

    Hello

    We discovered an issue in the Datasheet of the MP13.

    It will be described in an errata and DS updated soon.

    The TIM2_CH1 and TIm2_ETR are not available on all GPIO as listed currently on DS:

    The correct settings are:

    • PA0, PA15, PD3, PG8 only TIM2_CH1
    • PE2, PF13, PE15 only TIM2_ETR
    • PA5 both TIM2_CH1, TIM2_ETR

    so in your case PF13 only supports TIM2_ETR.. not TIM2_CH1 

     

    JM

    5 replies

    ST Employee
    September 6, 2024

    Hello @guansonghuang

    Verify that the PWM is exported correctly, you should see pwm0 listed using 

    ls /sys/class/pwm/pwmchip0 

     Also, try using an oscilloscope or logic analyzer to verify that the PWM signal is being generated on the correct pin (PF13)

    Graduate
    September 6, 2024

    hi @Sarra.S 

    guansonghuang_1-1725613031881.png

     

    guansonghuang_0-1725612514660.png

    I use oscilloscope vefify no pwm out on PF13;

     

    but

    1、if change pwm channel1 to PA5.that is ok

    2、Enable all 4 pwm out,all other 3 pwm output correctlly excpt for PF13

     

    Graduate
    September 9, 2024

    I verify TIM2_CH1 bare metal using PF13.  it is the same result as linux not working.

    So  I assume that PF13 can not be assigened to TIM2_CH1.

    please help to double check this. thank you

    ST Employee
    September 9, 2024

    Hello

    We discovered an issue in the Datasheet of the MP13.

    It will be described in an errata and DS updated soon.

    The TIM2_CH1 and TIm2_ETR are not available on all GPIO as listed currently on DS:

    The correct settings are:

    • PA0, PA15, PD3, PG8 only TIM2_CH1
    • PE2, PF13, PE15 only TIM2_ETR
    • PA5 both TIM2_CH1, TIM2_ETR

    so in your case PF13 only supports TIM2_ETR.. not TIM2_CH1 

     

    JM

    Graduate
    September 9, 2024

    if errata release,please notify me

    ST Employee
    October 1, 2024

    Hello

    Please note that the updated errata sheet is now available on st.com

    https://www.st.com/resource/en/errata_sheet/es0539-stm32mp131x3x5x-device-errata-stmicroelectronics.pdf

    JM

    Graduate
    September 9, 2024

    Thank you very much

    ST Employee
    September 9, 2024

    ok