<?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>Kinetis Design StudioのトピックRe: Generating CRC32 from .srec files</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709802#M9265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Badass find, Robert! I needed this to get the "standard" polynomial for the S32 as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Feb 2018 01:03:08 GMT</pubDate>
    <dc:creator>gearhead1107</dc:creator>
    <dc:date>2018-02-20T01:03:08Z</dc:date>
    <item>
      <title>Generating CRC32 from .srec files</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709800#M9263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the flash-resident Kinetis 2.x bootloader, and now&amp;nbsp;my goal is to enable CRC checking in the Boot Configuration Area.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've read Erich Styger's excellent blog entry on &lt;A href="https://mcuoneclipse.com/2015/04/26/crc-checksum-generation-with-srecord-tools-for-gnu-and-eclipse/" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;CRC Checksum Generation with ‘SRecord’ Tools for GNU and Eclipse&lt;/A&gt;,&amp;nbsp;that has gotten&amp;nbsp;me 80% of the way toward my goal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The challenge is that the CRC32 algorithm required by the Kinetis 2.0 bootloader is not supported by the SRecord tool suite.&amp;nbsp; In particular, the bootloader is expecting a CRC32 computed with the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #242729; background-color: #eff0f1; border: 0px; font-size: 13px; margin: 0px 0px 1em; padding: 5px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit; font-size: 13px;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; crcUserConfigPtr.crcBits = kCrcBits32;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; crcUserConfigPtr.seed = 0xffffffff;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; crcUserConfigPtr.polynomial = 0x04c11db7U;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; crcUserConfigPtr.complementChecksum = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; crcUserConfigPtr.reflectIn = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; crcUserConfigPtr.reflectOut = false;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... and neither of the CRC32 algorithms provided with SRecord (CRC32 and STM32) supports this particular combination of parameters (notably reflectIn = false and reflectOut = false).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So: what's the shortest path to generating the CRC32 from a .srec file using those parameters?&amp;nbsp; Yes, I could write a parser for .srec files, compute the proper CRC and insert it into the Boot Configuration Area using SRecord, but it would seem like someone must have been down this path.&amp;nbsp; (It would be super if there was an add-on utility for KDS 3.x, but that might be asking too much!&amp;nbsp; &lt;IMG alt="Smiley Happy" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="https://community.nxp.com/i/smilies/16x16_smiley-happy.png" title="Smiley Happy" /&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Robert Poor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. For some more information and context, you may look at &lt;A href="https://stackoverflow.com/questions/46799907/extending-srecord-to-handle-crc32-mpeg2" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;this stack overflow entry&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:01:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709800#M9263</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2020-11-02T14:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Generating CRC32 from .srec files</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709801#M9264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out that with the right switches and filters, you can use srec_cat to generate a valid&amp;nbsp; KBoot 2.0 CRC32 from a .srec file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="color: #242729; background-color: #eff0f1; border: 0px; font-size: 13px; margin: 0px 0px 1em; padding: 5px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit; font-size: 13px;"&gt;$ srec_cat test.srec -Bit_Reverse -CRC32LE 0x1000 -Bit_Reverse -XOR 0xff -crop 0x1000 0x1004 -Output -HEX_DUMP 00001000: 93 8F 97 9A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;In other words, bit reverse the bits going to the CRC32 algorithm, bit reverse them on the way out, and 1's compliment them.&amp;nbsp; I'm now using this technique to generate CRCs for the Bootloader Configuration Area.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 23:29:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709801#M9264</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2017-10-26T23:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Generating CRC32 from .srec files</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709802#M9265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Badass find, Robert! I needed this to get the "standard" polynomial for the S32 as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 01:03:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709802#M9265</guid>
      <dc:creator>gearhead1107</dc:creator>
      <dc:date>2018-02-20T01:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generating CRC32 from .srec files</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709803#M9266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found a good link. It may help you.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://embdsysbasics.blogspot.com/2018/12/hex-file-checksum-calculator-using.html?m=1" title="https://embdsysbasics.blogspot.com/2018/12/hex-file-checksum-calculator-using.html?m=1"&gt;HEX file CRC calculation using SREC Tool: Hex file CRC calculation using Srecord tool&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2019 03:23:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709803#M9266</guid>
      <dc:creator>padmanabhlanke</dc:creator>
      <dc:date>2019-01-02T03:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generating CRC32 from .srec files</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709804#M9267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Padmanabh: I looked at the link you provided about generating CRC values from SREC files, and though it uses&amp;nbsp;the same Srecord tool&amp;nbsp;as in the "Correct Answer" above, I believe it will NOT generate the correct CRC for KBoot 2.0 with the switches provided.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For generating CRC for KBoot 2.0, please refer to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/462397#comment-955757" title="https://community.nxp.com/thread/462397#comment-955757"&gt;https://community.nxp.com/thread/462397#comment-955757&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2019 15:21:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709804#M9267</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2019-01-04T15:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Generating CRC32 from .srec files</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709805#M9268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to Robert's answer, and as well referencing his posts, here are some more details about that subject: &lt;A class="link-titled" href="https://mcuoneclipse.com/2018/03/05/tutorial-crc32-checksum-with-the-kboot-bootloader/" title="https://mcuoneclipse.com/2018/03/05/tutorial-crc32-checksum-with-the-kboot-bootloader/"&gt;Tutorial: CRC32 Checksum with the KBOOT Bootloader | MCU on Eclipse&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:01:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Generating-CRC32-from-srec-files/m-p/709805#M9268</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2019-01-04T16:01:35Z</dc:date>
    </item>
  </channel>
</rss>

