<?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: Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989237#M55622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDK version 2.2.2 also has same issue. I am using HID FreeRTOS sample project.&lt;/P&gt;&lt;P&gt;But to use FlexNVM, I am referring flash_flexnvm_eeprom sample project from SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have kept below settings in App_preinclude.h file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define gAppUseNvm_d                    0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So definition of  “#define  gNvUseFlexNVM_d                     (0)”&lt;/P&gt;&lt;P&gt;Does not matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AppPoolsDetails_c are defined as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define AppPoolsDetails_c \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_  32  &lt;U&gt;number&lt;/U&gt;of_blocks_    6 &lt;U&gt;eol&lt;/U&gt;  \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_  64  &lt;U&gt;number&lt;/U&gt;of_blocks_    3 &lt;U&gt;eol&lt;/U&gt;  \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_ 128  &lt;U&gt;number&lt;/U&gt;of_blocks_   10 &lt;U&gt;eol&lt;/U&gt;  \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_ 512  &lt;U&gt;number&lt;/U&gt;of_blocks_    4 &lt;U&gt;eol&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For configuring partition, I have reused code from flash_flexnvm_eeprom sample project.&lt;/P&gt;&lt;P&gt;I am using below definitions for partitioning.&lt;/P&gt;&lt;P&gt;#define EEPROM_DATA_SET_SIZE_CODE (0x35U)&lt;/P&gt;&lt;P&gt;#define FLEXNVM_PARTITION_CODE (0x3U)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached file which is coded for creating partition.&lt;/P&gt;&lt;P&gt;The code for creating partition is kept commented, because it is part of SW which will be flashed first for creating partition and then the Application SW will only use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Feb 2020 06:41:22 GMT</pubDate>
    <dc:creator>adargad</dc:creator>
    <dc:date>2020-02-12T06:41:22Z</dc:date>
    <item>
      <title>Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989232#M55617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chip used : KW36&lt;/P&gt;&lt;P&gt;IDE Used : MCUExpresso&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have partitioned D-flash as NVM of size 32K and remaining we are using as Code Flash, Hence we are using P Flash and D flash as Code Flash(around 470K)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are observing &lt;STRONG&gt;Hard Fault &lt;/STRONG&gt;in below operation&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. When we reset the controller&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;2. When we try pair/connect the device&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried to follow all the post on NXP community to see from which location fault is getting generated and it is observed that it is coming from different ISR routine such as UART ISR or Timer ISR or RESET ISR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also verified that Stack allocated for Tasks is not getting overflowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have also observed that hard fault is getting triggered when the complied binary size is larger than 256K and it uses P-flash as well as D-flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know what can be done in above case to identify the root cause of the HardFault ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching .map files for release and debug compilation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:39:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989232#M55617</guid>
      <dc:creator>adargad</dc:creator>
      <dc:date>2020-01-22T08:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989233#M55618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/adargad@visteon.com"&gt;adargad@visteon.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please provide more information about it?&lt;/P&gt;&lt;P&gt;How have you created the partition in the FlexNVM address range? Could you please provide the steps and changes done in the HID device example to replicate in our side such partition?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;Edgar Lomeli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 23:08:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989233#M55618</guid>
      <dc:creator>EdgarLomeli</dc:creator>
      <dc:date>2020-01-29T23:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989234#M55619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using FlexRAM for emulation of EEPROM, I have partitioned 32KB of Dflash for&amp;nbsp;EEPROM-backup Size.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also my Application size is spanning over P-flash&amp;nbsp; + D-Flash. So there are ISRs which are located in D flash as well.&lt;/P&gt;&lt;P&gt;Going ahead after debug I found that the reason for Hard fault is ISR getting triggered in between when&amp;nbsp;FLASH_EepromWrite() is executing. When I put critical section as below, I am not getting Hard fault.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/103271i94094A51551D0017/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This fix is done in inline with guidelines provided in Application note we found on internet, "Using S32K148 FlexNVM Memory", Chapter 5, as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/103319i5A65F4D52125CE2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have question to SDK development team, whether this fix is correct, or have any side effects?&lt;/P&gt;&lt;P&gt;Also if it is already known to SDK development team?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2020 13:36:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989234#M55619</guid>
      <dc:creator>adargad</dc:creator>
      <dc:date>2020-02-10T13:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989235#M55620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/adargad@visteon.com"&gt;adargad@visteon.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We will investigate which is the proper way to handle such scenario in software with our SDK SW team. As soon as we receive a response, I'll be updating on this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2020 17:53:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989235#M55620</guid>
      <dc:creator>EdgarLomeli</dc:creator>
      <dc:date>2020-02-10T17:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989236#M55621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/adargad@visteon.com"&gt;adargad@visteon.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have contacted our SDK SW team to get more information and we are waiting for a response. Meanwhile, we would like to know the following to reproduce it on our side. Which SDK version are you using for your application?, Is it BM or freertos version?. Another concern is about which #define have you enabled under "preinclude.h" file to enable FlexNVM. Are gAppUseNvm_d = 1 and&amp;nbsp;gNvUseFlexNVM_d = 1?, Could you please share with us&amp;nbsp;AppPoolsDetails_c?&lt;/P&gt;&lt;P&gt;How did you configure the software for creating the partition of 32KB? Could you please share with us the value of gEEPROM_DATA_SET_SIZE_CODE_c and&amp;nbsp;gFLEXNVM_PARTITION_CODE_c macros located in "NV_Flash.c"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2020 18:36:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989236#M55621</guid>
      <dc:creator>EdgarLomeli</dc:creator>
      <dc:date>2020-02-11T18:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault getting triggered from ISR routine when compiled binary size is more than P flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989237#M55622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDK version 2.2.2 also has same issue. I am using HID FreeRTOS sample project.&lt;/P&gt;&lt;P&gt;But to use FlexNVM, I am referring flash_flexnvm_eeprom sample project from SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have kept below settings in App_preinclude.h file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define gAppUseNvm_d                    0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So definition of  “#define  gNvUseFlexNVM_d                     (0)”&lt;/P&gt;&lt;P&gt;Does not matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AppPoolsDetails_c are defined as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define AppPoolsDetails_c \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_  32  &lt;U&gt;number&lt;/U&gt;of_blocks_    6 &lt;U&gt;eol&lt;/U&gt;  \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_  64  &lt;U&gt;number&lt;/U&gt;of_blocks_    3 &lt;U&gt;eol&lt;/U&gt;  \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_ 128  &lt;U&gt;number&lt;/U&gt;of_blocks_   10 &lt;U&gt;eol&lt;/U&gt;  \&lt;/P&gt;&lt;P&gt;         &lt;U&gt;block&lt;/U&gt;size_ 512  &lt;U&gt;number&lt;/U&gt;of_blocks_    4 &lt;U&gt;eol&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For configuring partition, I have reused code from flash_flexnvm_eeprom sample project.&lt;/P&gt;&lt;P&gt;I am using below definitions for partitioning.&lt;/P&gt;&lt;P&gt;#define EEPROM_DATA_SET_SIZE_CODE (0x35U)&lt;/P&gt;&lt;P&gt;#define FLEXNVM_PARTITION_CODE (0x3U)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached file which is coded for creating partition.&lt;/P&gt;&lt;P&gt;The code for creating partition is kept commented, because it is part of SW which will be flashed first for creating partition and then the Application SW will only use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 06:41:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-getting-triggered-from-ISR-routine-when-compiled/m-p/989237#M55622</guid>
      <dc:creator>adargad</dc:creator>
      <dc:date>2020-02-12T06:41:22Z</dc:date>
    </item>
  </channel>
</rss>

