<?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>i.MX Processors中的主题 Re: IMXRT CRC32 for multicast address filter</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804441#M124240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response Carlos. The correct crc32 algorithm can be found in this post:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/445605"&gt;https://community.nxp.com/thread/445605&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jul 2018 11:52:35 GMT</pubDate>
    <dc:creator>jakechoy</dc:creator>
    <dc:date>2018-07-26T11:52:35Z</dc:date>
    <item>
      <title>IMXRT CRC32 for multicast address filter</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804439#M124238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;I'm trying to use the imxrt enet hardware to filter multicast IP addresses.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;From the reference manual.&lt;BR /&gt;&lt;DIV style="border: 0px;"&gt;&lt;DIV style="border: 0px;"&gt;The user must initialize the hash table registers. Use this CRC32 polynomial to compute the hash:&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;• FCS(x) = x32+ x26+ x23+ x22+ x16+ x12+ x11+ x10+ x8+ x7+ x5+ x4+ x2+ x1+ 1&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;I am using the crc function below but I'm not able to produce the same crc output as the imrxt hardware crc32 generator.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;&lt;DIV style="border: 0px;"&gt;static uint32_t imxrt_calcethcrc(const uint8_t *data, size_t length)&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;{&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; uint32_t crc = 0xffffffff;&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; size_t i;&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; int j;&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt; &lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; for (i = 0; i &amp;lt; length; i++)&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; for (j = 0; j &amp;lt; 8; j++)&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (((crc &amp;gt;&amp;gt; 31) ^ (data[i] &amp;gt;&amp;gt; j)) &amp;amp; 0x01)&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1 */&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crc = (crc &amp;lt;&amp;lt; 1) ^ 0x04c11db7;&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crc = crc &amp;lt;&amp;lt; 1;&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;&amp;nbsp; return ~crc;&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;}&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;&lt;DIV style="border: 0px;"&gt;The 48-bit destination address is mapped into one of 64 bits, represented by 64 bits in&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;ENETn_GAUR/GALR (group address hash match) or ENETn_IAUR/IALR&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;(individual address hash match).&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;&lt;DIV style="border: 0px;"&gt;• This mapping is performed by passing the 48-bit address through the on-chip 32-bit&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;CRC generator and selecting the six most significant bits of the CRC-encoded result&lt;/DIV&gt;&lt;DIV style="border: 0px;"&gt;to generate a number between 0 and 63.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;The IP I'm using is&amp;nbsp;"239.255.0.1" which is&amp;nbsp;0x0100ffef. This will map to a MAC of&amp;nbsp;0x01005E7F0001 from the IETF IN RFC 1700.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;The calculated crc32 is&amp;nbsp;0xc9579861 which produces a hashindex of 8. This will set the 8th bit in register IMXRT_ENET_GALR.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;But this filter does not let the above IP through. I found the first bit of&amp;nbsp;IMXRT_ENET_GAUR needs to be set for the IP to go through.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;This means the crc calculation does not match the hardware crc generator.&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;Does anyone have any insight into what the problem is or know an equivalent algorithm to the hardware CRC32 generator?&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; border: 0px; font-size: 13px;"&gt;Jake&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:28:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804439#M124238</guid>
      <dc:creator>jakechoy</dc:creator>
      <dc:date>2018-07-11T18:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT CRC32 for multicast address filter</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804440#M124239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake,&lt;/P&gt;&lt;P&gt;Have you verified data sizes of the used variables for software CRC calculations, in order to avoid overflows?&lt;/P&gt;&lt;P&gt;You could also take a look at the following link:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/message/957904"&gt;https://community.nxp.com/message/957904&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this will be useful for you.&lt;BR /&gt;Best regards!&lt;BR /&gt;/Carlos&lt;BR /&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, 24 Jul 2018 01:36:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804440#M124239</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2018-07-24T01:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT CRC32 for multicast address filter</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804441#M124240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response Carlos. The correct crc32 algorithm can be found in this post:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/445605"&gt;https://community.nxp.com/thread/445605&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 11:52:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMXRT-CRC32-for-multicast-address-filter/m-p/804441#M124240</guid>
      <dc:creator>jakechoy</dc:creator>
      <dc:date>2018-07-26T11:52:35Z</dc:date>
    </item>
  </channel>
</rss>

