<?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: Flash Command and CSEc Command in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1394812#M13543</link>
    <description>&lt;P&gt;Hi Phillip,&lt;/P&gt;
&lt;P&gt;"And, I guess the CSEc command is launched by clearing CCIF flag."&lt;/P&gt;
&lt;P&gt;No, it's not. It says indicating, not starting.&lt;/P&gt;
&lt;P&gt;Take a look at:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1641384739923.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166757i87F03B2A14A1265B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1641384739923.png" alt="lukaszadrapa_0-1641384739923.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_1-1641384753044.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166758i39ADD7239FE45EF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_1-1641384753044.png" alt="lukaszadrapa_1-1641384753044.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And some example from AN5401 code:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_2-1641384768539.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166759iDC10E18D10D5E119/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_2-1641384768539.png" alt="lukaszadrapa_2-1641384768539.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 12:13:28 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2022-01-05T12:13:28Z</dc:date>
    <item>
      <title>Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1394565#M13527</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I read "The FTFC module's Cryptographic Services Engine (CSEc) implements a comprehensive&lt;BR /&gt;set of cryptographic functions as described in the SHE Functional Specification,&lt;BR /&gt;including:" in s32k-rm.&lt;/P&gt;&lt;P&gt;So it means that CSEc command is run by FTFC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, I guess the CSEc command is launched by clearing CCIF flag.&lt;/P&gt;&lt;P&gt;because : "The operation will start as indicated by CCIF transitioning from 1 to 0. The operation will&lt;BR /&gt;complete and set CCIF to 1 again. At this point the user may read the PRAM to verify or&lt;BR /&gt;transfer results as applicable."&amp;nbsp;in s32k-rm page 884.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But any flash program command is also launched by clearing CCIF flag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what happened if during flash program command is executing, trying to launch CSEc command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example :&amp;nbsp;CSEC_DRV_EncryptECB&lt;/P&gt;&lt;P&gt;I think in&amp;nbsp;CSEC_DRV_StartEncDecECBCmd, the CCIF Flag will be cleared.&lt;/P&gt;&lt;P&gt;but in that situation, CCIF flag is already 0 because flash program command is executing.&lt;/P&gt;&lt;P&gt;the CSEc command will be executed? or not?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please give me any advice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Phillip&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 05:36:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1394565#M13527</guid>
      <dc:creator>kmh48301</dc:creator>
      <dc:date>2022-01-05T05:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1394812#M13543</link>
      <description>&lt;P&gt;Hi Phillip,&lt;/P&gt;
&lt;P&gt;"And, I guess the CSEc command is launched by clearing CCIF flag."&lt;/P&gt;
&lt;P&gt;No, it's not. It says indicating, not starting.&lt;/P&gt;
&lt;P&gt;Take a look at:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1641384739923.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166757i87F03B2A14A1265B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1641384739923.png" alt="lukaszadrapa_0-1641384739923.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_1-1641384753044.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166758i39ADD7239FE45EF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_1-1641384753044.png" alt="lukaszadrapa_1-1641384753044.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And some example from AN5401 code:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_2-1641384768539.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166759iDC10E18D10D5E119/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_2-1641384768539.png" alt="lukaszadrapa_2-1641384768539.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 12:13:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1394812#M13543</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-01-05T12:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1395144#M13547</link>
      <description>&lt;P&gt;Hi Lukas&lt;/P&gt;&lt;P&gt;Thank you for replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I misunderstood important thing.&lt;/P&gt;&lt;P&gt;In example code that you gave, after CSEc command executes, it waits ccif mask.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, if flash command had executed before CSEc command executed,&lt;/P&gt;&lt;P&gt;the ccif mask indicates flash command completion and CSEc command completion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks something wrong and unsafe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I think CSEc Driver had better wait CCIF Mask and something other status bit for just in case.&lt;/P&gt;&lt;P&gt;2. Can the FTFC execute 2 commands at the same time such as csec command and flash command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Phillip&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 23:21:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1395144#M13547</guid>
      <dc:creator>kmh48301</dc:creator>
      <dc:date>2022-01-05T23:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1395640#M13560</link>
      <description>&lt;P&gt;Hi Phillip,&lt;/P&gt;
&lt;P&gt;I can see no problem here. It's mentioned in the notes that only one command can be executed at a time. Adding the screenshot again:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1641476320727.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166899i1798AE4D77AB5493/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1641476320727.png" alt="lukaszadrapa_0-1641476320727.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Anytime when you are going to launch a flash command or CSEc command, you should check (using CCIF) if previous operation is completed. This is done in the drivers, so it's safe.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 13:41:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1395640#M13560</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-01-06T13:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1395815#M13566</link>
      <description>&lt;P&gt;Hi Lukas&lt;/P&gt;&lt;P&gt;Thank you for kindness.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anytime when you are going to launch a flash command or CSEc command, you should check (using CCIF) if previous operation is completed. "This is done in the drivers, so it's safe."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need to know how the driver make it safe.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In CSEC_DRV_EncryptECB(), i can't see the safety method.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;==============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if (g_csecStatePtr-&amp;gt;cmdInProgress)&lt;BR /&gt;{&lt;BR /&gt;return STATUS_BUSY;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;==============================&lt;/P&gt;&lt;P&gt;Those lines can't make this situation safe.&lt;/P&gt;&lt;P&gt;because g_csecStatePtr is not related flash driver and command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please let me know&amp;nbsp;&lt;SPAN&gt;how the "CSEC_DRV_EncryptECB()" make it safe?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Phillip&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:39:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1395815#M13566</guid>
      <dc:creator>kmh48301</dc:creator>
      <dc:date>2022-01-06T23:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1396042#M13572</link>
      <description>&lt;P&gt;Hi Phillip,&lt;/P&gt;
&lt;P&gt;that's a good note, I was checking AN5401 only, not the SDK code. It looks like a weakness of the SDK driver. I will report this to SDK team. Thanks for pointing this out.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 08:25:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1396042#M13572</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-01-07T08:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Command and CSEc Command</title>
      <link>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1396447#M13582</link>
      <description>&lt;P&gt;Hi Lukas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you get response from the SDK team, Please let me know as well.&lt;/P&gt;&lt;P&gt;Because I need to know when this weakness is fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Phillip&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jan 2022 23:33:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Flash-Command-and-CSEc-Command/m-p/1396447#M13582</guid>
      <dc:creator>kmh48301</dc:creator>
      <dc:date>2022-01-09T23:33:11Z</dc:date>
    </item>
  </channel>
</rss>

