<?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>S32KのトピックRe: Setting up PWM</title>
    <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868824#M3852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, the memory necessary for state structure must be allocated by application as passed as pointer in Init function. This is applicable for all SDK drivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Razvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Feb 2019 21:30:31 GMT</pubDate>
    <dc:creator>razva_tilimpea</dc:creator>
    <dc:date>2019-02-18T21:30:31Z</dc:date>
    <item>
      <title>Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868818#M3846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using S32K148EVB to do some R&amp;amp;D work, having trouble get PWM going. Here is a sample code snippet listed at the bottom of this post, as you can tell I am using ftm_pwm component APIs provided by the SDK. When running debug mode, an exception occurs which resets the cpu. See attached screen capture. Returning from&amp;nbsp;FTM_DRV_UpdatePwmChannel() led to the exception (inaccessible addressing?). Looking at the trace, I decided to double the stack size in ld file but the same problem persists. Any ideal what was going on? This exception happens only on successful return. If I force the function to return earlier (error return), no exception occurs. Obviously in this case initialization fails and I won't able to run PWM function.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/72275i6143990B00D15966/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FTM_DRV_Init(INST_FLEXTIMER_PWM1, &amp;amp;flexTimer_pwm1_InitConfig, (ftm_state_t * )ftmStatePtr);&lt;BR /&gt; FTM_DRV_InitPwm(INST_FLEXTIMER_PWM1, &amp;amp;flexTimer_pwm1_PwmConfig);&lt;BR /&gt; //FTM_DRV_FastUpdatePwmChannels(INST_FLEXTIMER_PWM1, 1, &amp;amp;pwm_channel, &amp;amp;pwm_duty_cycle, 0);&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2019 15:08:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868818#M3846</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2019-02-15T15:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868819#M3847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you share the project with us?&lt;/P&gt;&lt;P&gt;We don't know about this issue and it can be caused by multiple root-causes, so we have to investigate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Razvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 09:33:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868819#M3847</guid>
      <dc:creator>razva_tilimpea</dc:creator>
      <dc:date>2019-02-18T09:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868820#M3848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have Free RTOS integrated into my project. It's not a simple project import.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 13:58:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868820#M3848</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2019-02-18T13:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868821#M3849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you create a project just with FTM, clock and pins setup to reproduce this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 15:42:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868821#M3849</guid>
      <dc:creator>razva_tilimpea</dc:creator>
      <dc:date>2019-02-18T15:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868822#M3850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I already comment out RTOS initialization (PEX_RTOS_INIT) and start (PEX_RTOS_START) in my project, doesn't make any difference. BTW, I traced down the exception to the line in&amp;nbsp;FTM_DRV_UpdatePwmChannel() which is called from&amp;nbsp;FTM_DRV_InitPwm():&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Store the PWM period in the state structure */&lt;BR /&gt; state-&amp;gt;ftmPeriod = ftmPeriod;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CPU resets as soon as this statement is executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What bothers me is the run time ftm state structure at this moment, the clock source is 81 (I am not sure if that's a valid option), ftm mode is set to center aligned even though I configured the pwm as edge aligned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/72327i1CF7A5E060B6761F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.jpg" alt="Untitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 17:22:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868822#M3850</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2019-02-18T17:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868823#M3851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I figured it out, when you invoke&amp;nbsp;FTM_DRV_Init(), you do NOT pass in&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ftmStatePtr. You have to create your own ftm state structure and use it instead. The pwm example project declares&amp;nbsp;ftmStateStruct in application code (main.c). This also explains why the configurations obtained in&amp;nbsp;&lt;SPAN style="color: #3d3d3d;"&gt;FTM_DRV_Init() isn't being properly assigned to&amp;nbsp;ftmStatePtr such as ftm mode and clock source.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 21:01:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868823#M3851</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2019-02-18T21:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868824#M3852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, the memory necessary for state structure must be allocated by application as passed as pointer in Init function. This is applicable for all SDK drivers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Razvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 21:30:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868824#M3852</guid>
      <dc:creator>razva_tilimpea</dc:creator>
      <dc:date>2019-02-18T21:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up PWM</title>
      <link>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868825#M3853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good to know that. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2019 13:47:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Setting-up-PWM/m-p/868825#M3853</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2019-02-19T13:47:45Z</dc:date>
    </item>
  </channel>
</rss>

