<?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: DUART speed is wrong for non-default T208x QDS SYSCLK in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/DUART-speed-is-wrong-for-non-default-T208x-QDS-SYSCLK/m-p/660206#M5845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The user could import the attached projects in CodeWarrior and modify the configuration in the header file.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yiping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Dec 2016 09:45:28 GMT</pubDate>
    <dc:creator>yipingwang</dc:creator>
    <dc:date>2016-12-13T09:45:28Z</dc:date>
    <item>
      <title>DUART speed is wrong for non-default T208x QDS SYSCLK</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/DUART-speed-is-wrong-for-non-default-T208x-QDS-SYSCLK/m-p/660205#M5844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "Welcome to CodeWarrior" out-of-the-box project runs successfully for the default SYSCLK setting on the board (66MHz - SW3[1:4] = 0) but if you change SW4 to another SYSCLK speed the project will output garbage to the terminal.&lt;/P&gt;&lt;P&gt;The problem appears to be with the DUART library.&amp;nbsp; If you build your own archive library for the DUART, you can make the following changes in duart_config.c and fix it.&lt;/P&gt;&lt;P&gt;// unsigned char CLK_SPD_Reg = (*(unsigned char *)(QIXIS_BASE + CLK_SPD_OFFSET));&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;unsigned&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;char&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; CLK_SPD_Reg = (*(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;unsigned&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;char&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; *)(QIXIS_BASE + CLK_SPD1_OFFSET));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;switch&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; ( CLK_SPD_Reg &amp;amp; 0x07 )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x0: systemClock = 67; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// case 0x1: systemClock = 100; break;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x1: systemClock = 83; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// case 0x2: systemClock = 125; break;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x2: systemClock = 100; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// case 0x3: systemClock = 133; break;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x3: systemClock = 125; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// case 0x4: systemClock = 75; break;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x4: systemClock = 133; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// case 0x5: systemClock = 83; break;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x5: systemClock = 150; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x6: systemClock = 160; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;case&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; 0x7: systemClock = 167; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;default&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; : systemClock = 100; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;break&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where &lt;SPAN style="font-size: small;"&gt;CLK_SPD1_OFFSET is added to the definitions in duart_config.h as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; CLK_SPD1_OFFSET 0x30&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;The root cause of this problem is the fact that the QIXIS fpga register being polled for SYSCLK (and DDRCLK) on the T2081 QDS has been moved from CLK_SPD_OFFSET 0x07 to CLK_SPD1_OFFSET 0x30.&amp;nbsp; The old register has been deprecated and the encoding of the speeds has changed as shown above.&amp;nbsp; This is documented in the QorIQ T1040 Development System Manual.&amp;nbsp; The T1040 QDS is the basis of the T2081 QDS.&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;I believe this same change affects other QDS systems as well, like the T2080. All one would have to do is to compare the duart_config.c file at {CodeWarriorInstallationDirectory}\PA\PA_Support\Serial\[platform of interest] to the QIXIS programming section in the platform reference manual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;BTW, I find the directions in the README for building a custom DUART archive file to be out-of-date.&amp;nbsp; It says:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;... &lt;/SPAN&gt;to rebuild the UART library:&lt;/P&gt;&lt;P&gt;1. From your CW install directory, import the&lt;/P&gt;&lt;P&gt;&amp;lt;CWInstallDir&amp;gt;\PA\PA_Support\Serial\T2081QDS_aeabi_32bit_serial (or T2081QDS_aeabi_64bit_serial) project&lt;/P&gt;&lt;P&gt;2. Switch to the correspondent Build Target (eg DUARTA_UC_32bit).&lt;/P&gt;&lt;P&gt;Open duart_config.h file and change the value of the "MMR_BASE" accordingly&lt;/P&gt;&lt;P&gt;3. Re-build the project (and copy the output library in you project)&lt;/P&gt;&lt;P&gt;I can't find that project but was able to create a new archive file project, copy in the contents of &lt;SPAN style="font-size: small;"&gt;{CodeWarriorInstallationDirectory}\PA\PA_Support\Serial\Common and &lt;SPAN style="font-size: small;"&gt;{CodeWarriorInstallationDirectory}&lt;/SPAN&gt;\PA\PA_Support\Serial\T1040QDS_aeabi_32bit_serial\Source\* .&amp;nbsp; Edit the two files above found in the latter directory&amp;nbsp; as shown above and build an archive file to replace the default UART1_*.a file.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2016 16:42:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/DUART-speed-is-wrong-for-non-default-T208x-QDS-SYSCLK/m-p/660205#M5844</guid>
      <dc:creator>chuckcorley</dc:creator>
      <dc:date>2016-12-08T16:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: DUART speed is wrong for non-default T208x QDS SYSCLK</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/DUART-speed-is-wrong-for-non-default-T208x-QDS-SYSCLK/m-p/660206#M5845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The user could import the attached projects in CodeWarrior and modify the configuration in the header file.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Yiping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2016 09:45:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/DUART-speed-is-wrong-for-non-default-T208x-QDS-SYSCLK/m-p/660206#M5845</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2016-12-13T09:45:28Z</dc:date>
    </item>
  </channel>
</rss>

