<?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: SAI clock is not running at expected speed in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1844645#M4701</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229640"&gt;@mttjcksn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I have the steps to reproduce this issue? Was this test based on some SAI demo or custom application? Please kindly clarify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2024 02:06:25 GMT</pubDate>
    <dc:creator>Kan_Li</dc:creator>
    <dc:date>2024-04-11T02:06:25Z</dc:date>
    <item>
      <title>SAI clock is not running at expected speed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1838208#M4683</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the RT1170EVK and SDK v2.15, I'm seeing the SAI produce a bit clock &amp;amp; FS clock that is double what is expected. Master clock is correct.&lt;/P&gt;&lt;P&gt;You can see in my SAI peripheral config, the input clock is 12.288MHz, bit clock is 3.072MHz and FS clock is 48kHz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mttjcksn_1-1711885534185.png" style="width: 729px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/271246i94A8EA1AD4022115/image-dimensions/729x604?v=v2" width="729" height="604" role="button" title="mttjcksn_1-1711885534185.png" alt="mttjcksn_1-1711885534185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I debug, I can see the correct values being passed in (See on the left)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mttjcksn_0-1711885442388.png" style="width: 730px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/271245iAB4FD0B18A125156/image-dimensions/730x383?v=v2" width="730" height="383" role="button" title="mttjcksn_0-1711885442388.png" alt="mttjcksn_0-1711885442388.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I measure the output, MCLK is correct and FS clock is 96kHz.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mttjcksn_5-1711885979430.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/271250iB70BE79FA31AEB2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mttjcksn_5-1711885979430.png" alt="mttjcksn_5-1711885979430.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mttjcksn_4-1711885955249.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/271249i7EC0FC37C3A13024/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mttjcksn_4-1711885955249.png" alt="mttjcksn_4-1711885955249.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be causing this? I'm not changing any settings in my application code, just calling:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();

SAI_TransferTxCreateHandleEDMA(SAI1_PERIPHERAL, &amp;amp;saiTxHandle, nullptr, NULL, &amp;amp;DMA0_CH0_Handle);

SAI_TransferTxSetConfigEDMA(SAI1_PERIPHERAL, &amp;amp;saiTxHandle, &amp;amp;SAI1_Tx_config);

sai_transfer_t xfer;
xfer.data = reinterpret_cast&amp;lt;uint8_t *&amp;gt;(txBuff);
xfer.dataSize = BUFFER_SIZE * sizeof(uint32_t);
SAI_TransferSendEDMA(SAI1_PERIPHERAL, &amp;amp;saiTxHandle, &amp;amp;xfer)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 10:10:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1838208#M4683</guid>
      <dc:creator>mttjcksn</dc:creator>
      <dc:date>2024-04-01T10:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAI clock is not running at expected speed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1838537#M4685</link>
      <description>Minor update: I've noticed that if I lower the SAI1 source clock to 6.144MHz, the bit clk and fs clk will be correct. This would indicate that the master clock cannot be divided down enough to provide the required rate, but looking at the DIV field in the TCR2 register, the rates I have given above should be achievable?</description>
      <pubDate>Mon, 01 Apr 2024 10:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1838537#M4685</guid>
      <dc:creator>mttjcksn</dc:creator>
      <dc:date>2024-04-01T10:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAI clock is not running at expected speed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1844645#M4701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229640"&gt;@mttjcksn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I have the steps to reproduce this issue? Was this test based on some SAI demo or custom application? Please kindly clarify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 02:06:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1844645#M4701</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2024-04-11T02:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAI clock is not running at expected speed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1844928#M4703</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I generated a bare-bones C++ project using the MCUXpresso IDE and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MCUXpresso SDK v2.15.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I then exported as an archive and imported as a gcc toolchain project using the visual studio code extension and made the manual adjustments to get it to build properly with cmake.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then using the config tool I added the SAI peripheral driver and configured the clock as shown in my original post.&lt;/P&gt;&lt;P&gt;I've managed to get it to work but it doesn't really make sense as to how this solved the issue...&lt;BR /&gt;I stepped through the driver where it writes the&amp;nbsp;&lt;SPAN&gt;DIV field in the TCR2, and I see it writing the correct value, but the clock output is wrong. I then manually set the TCR2 register in my application code, and the clock becomes correct. I then remove the code where I manually set TCR2, and it stays correct. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maybe a caching issue somewhere? I honestly have no idea. But it certainly didn't work out of the box for me!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 07:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1844928#M4703</guid>
      <dc:creator>mttjcksn</dc:creator>
      <dc:date>2024-04-11T07:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAI clock is not running at expected speed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1845726#M4707</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229640"&gt;@mttjcksn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to have the register values of the SAI module after initialization ?&amp;nbsp; We may help to check if FS and BCLK were configured correctly in your case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your patience !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 03:36:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SAI-clock-is-not-running-at-expected-speed/m-p/1845726#M4707</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2024-04-12T03:36:04Z</dc:date>
    </item>
  </channel>
</rss>

