<?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: KL28 CAU generates inconsistent SHA256 result in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711448#M43666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;So far as I know, interrupt will not&amp;nbsp;disturb MMCAU. There must be some other error in system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Oct 2017 06:18:11 GMT</pubDate>
    <dc:creator>jingpan</dc:creator>
    <dc:date>2017-10-26T06:18:11Z</dc:date>
    <item>
      <title>KL28 CAU generates inconsistent SHA256 result</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711447#M43665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are making use of the CAU&amp;nbsp;unit in KL28 to calculate the digest of the 256KB application code in flash, but the result keeps changing unless the interrupt is disabled. Is it true that the interrupt must be disable for the CAU module to run?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is based on the&amp;nbsp;mmcau library 2.0.0 from&amp;nbsp;MKL28Z512xxx7 SDK 2.2 with customized wrapper. The system runs at 8MHz with SIRC. The LPTMR0 is run with LPO and interrupts every 5ms as the time base.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 02:10:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711447#M43665</guid>
      <dc:creator>liangliangma</dc:creator>
      <dc:date>2017-10-20T02:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: KL28 CAU generates inconsistent SHA256 result</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711448#M43666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;So far as I know, interrupt will not&amp;nbsp;disturb MMCAU. There must be some other error in system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 06:18:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711448#M43666</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2017-10-26T06:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: KL28 CAU generates inconsistent SHA256 result</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711449#M43667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having this problem as well. I can confirm that disabling interrupts when calling into the precompiled library (cau_aes_encrypt and cau_aes_decrypt) in the mmcau_AesCrypt function of fsl_mmcau.c always gets me consistent encryption/decryption results (see the placement of DisableGlobalIRQ and EnableGlobalIRQ below). If I do not disable IRQ's during these calls, I will get intermittent encryption or decryption errors. It seems that interrupts do indeed disturb the MMCAU somehow.&amp;nbsp; I am also using mmcau_2.0.0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* common function for AES process. "encrypt" argument selects between en-/de-cryption */&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; status_t &lt;SPAN class="token function"&gt;mmcau_AesCrypt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;in&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;keySch&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; uint32_t aesRounds&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;out&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; bool encrypt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 status_t status&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;/* check validity of input arguments */&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;aesRounds &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;aesRounds &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;aesRounds &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;14u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;NULL &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; in&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;NULL &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; out&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;NULL &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; keySch&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 status &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kStatus_InvalidArgument&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 uint8_t inAlign&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;MMCAU_AES_BLOCK_SIZE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* 16 bytes aligned input block */&lt;/SPAN&gt;
 uint8_t outAlign&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;MMCAU_AES_BLOCK_SIZE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* 16 bytes aligned output block */&lt;/SPAN&gt;
 uint32_t keySchAlign&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;60&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* max 60 longwords in case of 32 bytes AES key */&lt;/SPAN&gt;
 size_t keySchSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;keySchWork&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;inWork&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;outWork&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 bool copyOut&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;/* compute keySchSize in bytes per CAU API documentation */&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;aesRounds &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 keySchSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;44u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;aesRounds &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 keySchSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;52u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* aesRounds = 14u */&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 keySchSize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;60u&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;/* align pointers */&lt;/SPAN&gt;
 inWork &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;mmcau_align_const&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inAlign&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MMCAU_AES_BLOCK_SIZE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 keySchWork &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;mmcau_align_const&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;keySch&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; keySchAlign&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; keySchSize&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 outWork &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;mmcau_align&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outAlign&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;copyOut&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;/* call actual CAU API */&lt;/SPAN&gt;
 uint32_t primask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;DisableGlobalIRQ&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;encrypt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;cau_aes_encrypt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inWork&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; keySchWork&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; aesRounds&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outWork&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;cau_aes_decrypt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inWork&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; keySchWork&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; aesRounds&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outWork&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;EnableGlobalIRQ&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;primask&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* copy to unaligned out pointer */&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;copyOut&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;mmcau_memcpy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outAlign&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MMCAU_AES_BLOCK_SIZE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
status &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kStatus_Success&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; status&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 16:01:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/711449#M43667</guid>
      <dc:creator>patricklewis</dc:creator>
      <dc:date>2018-06-06T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: KL28 CAU generates inconsistent SHA256 result</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/1259453#M60134</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Yes, you are right.&amp;nbsp;It is because MMCAU lib uses a lot of multi-words LDM/STM like instructions which are abandoned by core processor (M0+) when interrupted by an interrupt and restarted execution after the interrupt is serviced. This will cause repeated write/read to the same MMCAU memory-mapped address, resulting in the wrong MMCAU operands.&lt;/P&gt;
&lt;P&gt;This is excepted from ARM Cortex-M0+ technical document:&lt;/P&gt;
&lt;P&gt;When an interrupt occurs during the execution of an&amp;nbsp;LDM&amp;nbsp;or&amp;nbsp;STM&amp;nbsp;instruction, the processor abandons&amp;nbsp;the load multiple or store multiple operation, and the multiply instruction (if 32-cycle multiplier is used). After servicing the interrupt, the processor restarts execution of the load multiple or store multiple instruction from the beginning. The TRM has additional information about this, link below:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developer.arm.com/documentation/ddi0484/c/Programmers-Model/Exceptions/Exception-handling" target="_blank"&gt;https://developer.arm.com/documentation/ddi0484/c/Programmers-Model/Exceptions/Exception-handling&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Currently a possible workaround is to disable the interrupt before any call to MMCAU API and then re-enable it after the call.&lt;/P&gt;
&lt;P&gt;For Cortex-M4 based MCU, it seems no such MMCAU issue as it has different implementation as it will continue executing the interrupted transaction instead of restart execution of the multi-word instruction.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 07:28:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL28-CAU-generates-inconsistent-SHA256-result/m-p/1259453#M60134</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2021-04-09T07:28:54Z</dc:date>
    </item>
  </channel>
</rss>

