<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accessing specific PWM channel in Linux in S32G</title>
    <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1891652#M7286</link>
    <description>&lt;P&gt;Thanks for the reply. Here are the following outputs to the commds:&lt;/P&gt;&lt;P&gt;# ls /sys/class/pwm&lt;BR /&gt;pwmchip0&lt;/P&gt;&lt;P&gt;# ls /sys/class/pwm/pwmchip0&lt;BR /&gt;device export npwm power pwm1 subsystem uevent unexport&lt;/P&gt;&lt;P&gt;# ls /sys/class/pwm/pwmchip0/pwm1&lt;BR /&gt;capture duty_cycle enable period polarity power uevent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you require any additional information.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 19:52:40 GMT</pubDate>
    <dc:creator>Tony-FM-Eng</dc:creator>
    <dc:date>2024-06-20T19:52:40Z</dc:date>
    <item>
      <title>Accessing specific PWM channel in Linux</title>
      <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1888893#M7251</link>
      <description>&lt;P&gt;Hi, I am trying to access a specific channel, channel 5 of the PWM1 output from flex_timer_1 on the S32G274. I am not sure what values to use on the command line or settings in the dts file in order to obtain an output?&lt;/P&gt;&lt;P&gt;In my dts file, I have the following:&lt;/P&gt;&lt;DIV&gt;myboard.dts&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;amp;pwm1 {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; pinctrl-names = "default";&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; pinctrl-0 = &amp;lt;&amp;amp;pwm1_out_pins&amp;gt;;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; status = "okay";&lt;/DIV&gt;&lt;DIV&gt;};&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;amp;pinctrl {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;pwm1_out_pins: pwm1_out_pins {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pwm1_out_grp {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pinmux = &amp;lt;S32CC_PINMUX(80, FUNC3)&amp;gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output-low;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output-enable;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; slew-rate = &amp;lt;S32_COMPAT_SLEW_83MHZ&amp;gt;;&amp;nbsp; &amp;nbsp;// Is this needed?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;};&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Then, when I run the following commands on the Linux command line:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;echo 1 &amp;gt; /sys/class/pwm/pwmchip0/export&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo 10000000 &amp;gt; /sys/class/pwm/pwmchip0/pwm1/period&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo 5000000 &amp;gt; /sys/class/pwm/pwmchip0/pwm1/duty_cycle&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo 'normal' &amp;gt; /sys/class/pwm/pwmchip0/pwm1/polarity&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;echo 1 &amp;gt; /sys/class/pwm/pwmchip0/pwm1/enable&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I don't receive any errors, but I do not see an output on PF_00, pin for PWM1, channel 5. I'm not sure if the&amp;nbsp;&lt;EM&gt;/sys/class/pwm/pwmchip0/export&lt;/EM&gt; file controls the output channel? I did try&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;echo 4 &amp;gt; /sys/class/pwm/pwmchip0/export&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but received an error.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there something I need to add in the dts file in order to access channel 5 of flex_timer_1 for PWM1? Or is there a command I need to execute on the command line to provide the PWM output?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any assistance.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Jun 2024 18:46:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1888893#M7251</guid>
      <dc:creator>Tony-FM-Eng</dc:creator>
      <dc:date>2024-06-17T18:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing specific PWM channel in Linux</title>
      <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1890907#M7279</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234102"&gt;@Tony-FM-Eng&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for contacting NXP Support.&lt;/P&gt;
&lt;P&gt;It seems that the configurations are correct.&lt;/P&gt;
&lt;P&gt;Could you please share the output of the following commands?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ls /sys/class/pwm/
ls /sys/class/pwm/pwmchip0/
ls /sys/class/pwm/pwmchip0/pwm1&lt;/LI-CODE&gt;
&lt;P&gt;Please try it and send me the outputs.&lt;/P&gt;
&lt;P&gt;Have a great day!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 23:06:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1890907#M7279</guid>
      <dc:creator>brian14</dc:creator>
      <dc:date>2024-06-19T23:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing specific PWM channel in Linux</title>
      <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1891652#M7286</link>
      <description>&lt;P&gt;Thanks for the reply. Here are the following outputs to the commds:&lt;/P&gt;&lt;P&gt;# ls /sys/class/pwm&lt;BR /&gt;pwmchip0&lt;/P&gt;&lt;P&gt;# ls /sys/class/pwm/pwmchip0&lt;BR /&gt;device export npwm power pwm1 subsystem uevent unexport&lt;/P&gt;&lt;P&gt;# ls /sys/class/pwm/pwmchip0/pwm1&lt;BR /&gt;capture duty_cycle enable period polarity power uevent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you require any additional information.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 19:52:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1891652#M7286</guid>
      <dc:creator>Tony-FM-Eng</dc:creator>
      <dc:date>2024-06-20T19:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing specific PWM channel in Linux</title>
      <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1893680#M7325</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234102"&gt;@Tony-FM-Eng&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for your response.&lt;/P&gt;
&lt;P&gt;Based on your reply and your steps described on your question, Linux can interface correctly PWM driver. &lt;BR /&gt;However, it seems that you are missing a Kernel configuration to properly set up the PWM. &lt;BR /&gt;I couldn't find any specific manual for the S32G to enable PWM but please have a look to the following community thread of i.MX8MM&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Q-What-is-the-preocedure-to-Enable-PWM-on-imx8mm-evk/m-p/1203459" target="_blank"&gt;Solved: Q: What is the preocedure to Enable PWM on imx8mm-evk? - NXP Community&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Please check and tell me if you have any questions or comments.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 13:21:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1893680#M7325</guid>
      <dc:creator>brian14</dc:creator>
      <dc:date>2024-06-25T13:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing specific PWM channel in Linux</title>
      <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1893837#M7331</link>
      <description>&lt;P&gt;Thank you for the assistance so far. After reviewing the examples and delving into the links, I saw that I am doing pretty much the same thing as the example for&amp;nbsp;&lt;SPAN&gt;imx8mmn-nitrogen8mm.dtsi example. I did notice that if I do the following command, "&lt;EM&gt;echo 4 &amp;gt;&amp;nbsp;/sys/class/pwm/pwmchip0/export,"&amp;nbsp;&lt;/EM&gt;I do see "&lt;EM&gt;/sys/class/pwm/pwmchip0/pwm4&lt;/EM&gt;."&amp;nbsp; But I am still not sure how to set the channel in the dts file?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Also, with pin 80 set for PWM5 output through the dts file pinmux, I still do not see any PWM on the output pin either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I have to create a "PWM5" entry in the dts file for channel 5 of the PWM? If so, would I have to clone parameters from PWM1 in the s32cc.dtsi file? Is there an example of this? I could not find anything is my extensive search online.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 20:39:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1893837#M7331</guid>
      <dc:creator>Tony-FM-Eng</dc:creator>
      <dc:date>2024-06-25T20:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing specific PWM channel in Linux</title>
      <link>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1893884#M7332</link>
      <description>&lt;P&gt;I found the problem. It was the wrong channel assignment. Note, for channel PWM5, use:&lt;/P&gt;&lt;P&gt;echo 5 &amp;gt; /sys/class/pwm/pwmchipio/export. I was using channel 4 since the PWM starts with one apparently and not with zero.&lt;/P&gt;&lt;P&gt;If in your kernel driver, the setting would be pwm_device = pwm_request(&amp;lt;channel number&amp;gt;, &amp;lt;pwm_chip&amp;gt;). So, for example, to obtain channel 5 with PWM0 enabled, it would be:&lt;/P&gt;&lt;P&gt;struct pwm_device *my_pwm_device;&lt;/P&gt;&lt;P&gt;my_pwm_device = pwm_request(5, pwmchip0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 21:53:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/Accessing-specific-PWM-channel-in-Linux/m-p/1893884#M7332</guid>
      <dc:creator>Tony-FM-Eng</dc:creator>
      <dc:date>2024-06-27T21:53:10Z</dc:date>
    </item>
  </channel>
</rss>

