<?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>S32K中的主题 Re: S32K144 BusFault while checking CCIF after launching Partition FlexNVM</title>
    <link>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198895#M9241</link>
    <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you once again. I've obviously missed this part of the documentation, sorry for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Joey&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 12:30:12 GMT</pubDate>
    <dc:creator>Joey_van_Hummel</dc:creator>
    <dc:date>2020-12-14T12:30:12Z</dc:date>
    <item>
      <title>S32K144 BusFault while checking CCIF after launching Partition FlexNVM</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198052#M9214</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was hoping someone could help me shed light on an issue I'm having.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problematic code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint32_t eeIsFlexNvmPartitioned(void)
{
  /*
    "DEPART field contains 0xF for non-partitioned devices."
  */
  return ((SIM-&amp;gt;FCFG1 &amp;amp; SIM_FCFG1_DEPART_MASK) != SIM_FCFG1_DEPART_MASK);
}

void eePartitionFlexNvm(void)
{
  while ((FTFC-&amp;gt;FSTAT &amp;amp; FTFC_FSTAT_CCIF_MASK) != FTFC_FSTAT_CCIF_MASK)
  {
    /* Wait for command execution to finish. */
  }

  /*
    See S32K-RM 36.5.9.1.3 Command execution and error reporting.
  */
  if (FTFC-&amp;gt;FSTAT &amp;amp; (FTFC_FSTAT_ACCERR_MASK | FTFC_FSTAT_FPVIOL_MASK))
  {
    FTFC-&amp;gt;FSTAT |= FTFC_FSTAT_ACCERR_MASK | FTFC_FSTAT_FPVIOL_MASK;
  }

  /*
    See AN11983 and S32K-RM 36.4.4.1.6.1
  */
  FTFC-&amp;gt;FCCOB[3] = 0x80; /* FCCOB0: Selects the PGMPART command */
  FTFC-&amp;gt;FCCOB[2] = 0x00; /* FCCOB1: No CSEc operation */
  FTFC-&amp;gt;FCCOB[1] = 0x00; /* FCCOB2: No CSEc operation */
  FTFC-&amp;gt;FCCOB[0] = 0x00; /* FCCOB3: FlexRAM loaded with valid EEPROM during reset sequence */
  FTFC-&amp;gt;FCCOB[7] = 0x02; /* FCCOB4: EEPROM data set size code: EEESIZE = 2 (4 kB) */
  FTFC-&amp;gt;FCCOB[6] = 0x03; /* FCCOB5: FlexNVM Partition code: DEPART = 3 (Data flash: 32 kB, EEPROM backup: 32 kB) */

  /*
    Execute command.
  */
  FTFC-&amp;gt;FSTAT |= FTFC_FSTAT_CCIF_MASK;

  /*
    This line causes a busfault.
  */
  while ((FTFC-&amp;gt;FSTAT &amp;amp; FTFC_FSTAT_CCIF_MASK) != FTFC_FSTAT_CCIF_MASK)
  {
    /* Wait for command execution to finish. */
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Application code only calls eePartitionFlexNvm when eeIsFlexNvmPartitioned returns 0. The code is run from bank 0 P-flash. I am operating under the assumption that programming/partitioning bank 1 from bank 0 is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When the application is run, the last line of code in eePartitionFlexNvm&amp;nbsp; causes the following fault:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BusFault: A bus fault has occurred during instruction prefetching. &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This also seems to occur when not debugging. For some reason, debugging and using step-by-step debugging seems to work well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Other remarks&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have tried setting OCM1 in OCMDR0 and OCMDR1 to 0x3 before the command execution to no avail.&lt;/LI&gt;&lt;LI&gt;Executing the code from RAM seems to solve the issue, but I was under the impression this would not be necessary, and feels like a work-around rather than a proper fix.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;What is the mechanism behind this fault? I thought programming FlexNVM/D-flash from P-flash should not be a problem.&lt;/LI&gt;&lt;LI&gt;I saw a similar problem on &lt;A title="S32K146EVB Read Collision when erasing/writing flash" href="https://stackoverflow.com/questions/55519644/s32k146evb-read-collision-when-erasing-writing-flash" target="_self"&gt;StackOverflow&lt;/A&gt; where the OT suggested "Disabling caching by writing LMEM-&amp;gt;PCCRMR = 0;" solved their problem. Is this a valid solution? I haven't specifically enabled caching. I also do not see anything mentioned about this in AN11983 or the sample project &lt;EM&gt;flash_partitioning_s32k144&lt;/EM&gt;.&lt;/LI&gt;&lt;LI&gt;How can I solve this problem?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Joey&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 13:39:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198052#M9214</guid>
      <dc:creator>Joey_van_Hummel</dc:creator>
      <dc:date>2020-12-11T13:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 BusFault while checking CCIF after launching Partition FlexNVM</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198766#M9235</link>
      <description>&lt;P&gt;Hi Joey,&lt;/P&gt;
&lt;P&gt;The command must be launched from SRAM or through JTAG/SWD.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1607936232063.png" style="width: 663px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/132572iB5CE244A89D2E465/image-dimensions/663x221?v=v2" width="663" height="221" role="button" title="danielmartynek_0-1607936232063.png" alt="danielmartynek_0-1607936232063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;A function can be placed in SRAM as it is shown here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/Linker-file-configuration-to-allow-code-execution-from-RAM/m-p/803493" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/S32K/Linker-file-configuration-to-allow-code-execution-from-RAM/m-p/803493&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 12:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198766#M9235</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-12-14T12:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 BusFault while checking CCIF after launching Partition FlexNVM</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198895#M9241</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you once again. I've obviously missed this part of the documentation, sorry for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Joey&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 12:30:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1198895#M9241</guid>
      <dc:creator>Joey_van_Hummel</dc:creator>
      <dc:date>2020-12-14T12:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 BusFault while checking CCIF after launching Partition FlexNVM</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1234100#M9951</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried this solution but still problem exist.&lt;/P&gt;&lt;P&gt;Do i need to enable the IRQ also?&lt;/P&gt;&lt;P&gt;without this change(as suggested by your previous comment) at least in debug mode if i do step operation ,i could run the SW after words.&lt;/P&gt;&lt;P&gt;Now with this change control is not coming out or going into of this function even after step operations.&lt;/P&gt;&lt;P&gt;Attached screenshot,&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 09:38:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-BusFault-while-checking-CCIF-after-launching-Partition/m-p/1234100#M9951</guid>
      <dc:creator>PradeepAithal</dc:creator>
      <dc:date>2021-02-22T09:38:49Z</dc:date>
    </item>
  </channel>
</rss>

