<?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 Hardfault handler  log saving in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060117#M33731</link>
    <description>&lt;P&gt;I.MXRT1020-EVK board.&amp;nbsp; MCUXpressoIDE 24.12 , SDK_2.x_EVK-MIMXRT1020&amp;nbsp; 2.13.0&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When hardfault occurred, I tried to move the previously logged content to flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This coding-job was based on an example that included Shell among an example using FreeRTOS.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;1. fsl_debug_console.c&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Before delivering the printbuffer to the DbgConsole_Vprintf function, we delivered the same content to the ringbuffer allocated 8KB using pvMalloc so that it can be stored continuously.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;semihost_hardfault.c&lt;BR /&gt;&lt;BR /&gt;In this function, if it is not under the _semihost_return condition of the existing code, jump to a function called hardfault_handler_main in BL.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Hardfault_handler_main call hardfault_log_save_sc.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In hardfault_log_save_sc, the logs in the area 8KB assigned to the malloc defined in fsl_debug_console.c were sorted so that they were stored in the 3F0 and 3F1 sectors of flash from the very first log.&lt;BR /&gt;In RT1020, the 3F0 sector number of flash corresponds to 0x603F_0000 .&lt;BR /&gt;&lt;BR /&gt;The reason why I'm posting the question here is. After creating a trigger_hardfault CMD command and function that deliberately attempts to write a value to the null point in the shell&lt;BR /&gt;volatile int *ptr = (int *)0x00000000; // NULL pointer&lt;BR /&gt;*ptr = 42; // trigger hardfault&lt;BR /&gt;&lt;BR /&gt;If&amp;nbsp; intentionally causing hardfault.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Ease the first sector of hardfault_log_save_sc is successfully executed, but then the second sector erase and dump to Dram -&amp;gt; flash do not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;How do I fix the file semihost_hardfault.c for hardfault handlers in SDK so that I can write what's in DRAM in flash correctly and fall out indefinitely?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Mar 2025 06:35:59 GMT</pubDate>
    <dc:creator>Seongyon_Jeong</dc:creator>
    <dc:date>2025-03-12T06:35:59Z</dc:date>
    <item>
      <title>Hardfault handler  log saving</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060117#M33731</link>
      <description>&lt;P&gt;I.MXRT1020-EVK board.&amp;nbsp; MCUXpressoIDE 24.12 , SDK_2.x_EVK-MIMXRT1020&amp;nbsp; 2.13.0&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When hardfault occurred, I tried to move the previously logged content to flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This coding-job was based on an example that included Shell among an example using FreeRTOS.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;1. fsl_debug_console.c&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Before delivering the printbuffer to the DbgConsole_Vprintf function, we delivered the same content to the ringbuffer allocated 8KB using pvMalloc so that it can be stored continuously.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;semihost_hardfault.c&lt;BR /&gt;&lt;BR /&gt;In this function, if it is not under the _semihost_return condition of the existing code, jump to a function called hardfault_handler_main in BL.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Hardfault_handler_main call hardfault_log_save_sc.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In hardfault_log_save_sc, the logs in the area 8KB assigned to the malloc defined in fsl_debug_console.c were sorted so that they were stored in the 3F0 and 3F1 sectors of flash from the very first log.&lt;BR /&gt;In RT1020, the 3F0 sector number of flash corresponds to 0x603F_0000 .&lt;BR /&gt;&lt;BR /&gt;The reason why I'm posting the question here is. After creating a trigger_hardfault CMD command and function that deliberately attempts to write a value to the null point in the shell&lt;BR /&gt;volatile int *ptr = (int *)0x00000000; // NULL pointer&lt;BR /&gt;*ptr = 42; // trigger hardfault&lt;BR /&gt;&lt;BR /&gt;If&amp;nbsp; intentionally causing hardfault.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Ease the first sector of hardfault_log_save_sc is successfully executed, but then the second sector erase and dump to Dram -&amp;gt; flash do not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;How do I fix the file semihost_hardfault.c for hardfault handlers in SDK so that I can write what's in DRAM in flash correctly and fall out indefinitely?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 06:35:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060117#M33731</guid>
      <dc:creator>Seongyon_Jeong</dc:creator>
      <dc:date>2025-03-12T06:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Hardfault handler  log saving</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060124#M33733</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Ease the first sector of hardfault_log_save_sc is successfully executed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; =&amp;gt; Erasing the first sector of hardfault_log_save_sc is successfully executed&lt;BR /&gt;&lt;BR /&gt;Miss spelling..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 06:42:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060124#M33733</guid>
      <dc:creator>Seongyon_Jeong</dc:creator>
      <dc:date>2025-03-12T06:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hardfault handler  log saving</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060268#M33737</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220925"&gt;@Seongyon_Jeong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems there are some issues about &lt;CODE&gt;hardFault handle&lt;/CODE&gt; which are developed from your side. Generally speaking, it is&lt;STRONG&gt; out of our support role&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Here I would like to give advice that it's hard to handle flash sections, please follow flash_componment_nor_flexspi example to see how to use&amp;nbsp;&lt;CODE&gt;Nor_Flash_Erase_Sector&lt;/CODE&gt; &lt;CODE&gt;Nor_Flash_Read&lt;/CODE&gt; functions.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 08:55:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2060268#M33737</guid>
      <dc:creator>Sam_Gao</dc:creator>
      <dc:date>2025-03-12T08:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: flash component project</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2061083#M33759</link>
      <description>&lt;P&gt;This is my SDK version for RT1020 EVK&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="스크린샷 2025-03-13 171055.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/327899i33CCAED5C7D2F766/image-size/medium?v=v2&amp;amp;px=400" role="button" title="스크린샷 2025-03-13 171055.png" alt="스크린샷 2025-03-13 171055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I download two example&amp;nbsp; from SDK&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="스크린샷 2025-03-13 171013.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/327898i95F0DEA216C849B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="스크린샷 2025-03-13 171013.png" alt="스크린샷 2025-03-13 171013.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;freertos_hello_flash_operation works fine. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rtos_flash.jpg" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/327897iAFFAF8D1A72B3D8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rtos_flash.jpg" alt="rtos_flash.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But&amp;nbsp; flash component nor&amp;nbsp; is not.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;Just Only ,&amp;nbsp; Import SDK example -&amp;gt; select&amp;nbsp; this example -&amp;gt; finish (no&amp;nbsp; change,&amp;nbsp; just default)&lt;BR /&gt;But.&amp;nbsp; Build &amp;amp; Download the image Using GUI Flash Tool of MCUXpressoIDE. ,&lt;/P&gt;&lt;P&gt;and. Nothing.......&amp;nbsp; so,&amp;nbsp; I&amp;nbsp; Enter&amp;nbsp; debug mode&amp;nbsp; of this project.&lt;BR /&gt;&lt;BR /&gt;then....&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="스크린샷 2025-03-13 171627.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/327901i8D0FAE336DC45685/image-size/medium?v=v2&amp;amp;px=400" role="button" title="스크린샷 2025-03-13 171627.png" alt="스크린샷 2025-03-13 171627.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="스크린샷 2025-03-13 171718.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/327902i2D06A1360628DBCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="스크린샷 2025-03-13 171718.png" alt="스크린샷 2025-03-13 171718.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="스크린샷 2025-03-13 172237.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/327905i551C3B0A10EB91A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="스크린샷 2025-03-13 172237.png" alt="스크린샷 2025-03-13 172237.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I do not&amp;nbsp; change anything&amp;nbsp; in this project.&amp;nbsp; just import &amp;amp; build &amp;amp; down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;but this faced to&amp;nbsp; Hardfault&amp;nbsp; &amp;nbsp;directly.....&amp;nbsp;&lt;/P&gt;&lt;P&gt;So,&amp;nbsp; I tested another project,&amp;nbsp; &amp;nbsp;they work fine&amp;nbsp; with Default SDK Example Project state.&lt;/P&gt;&lt;P&gt; I think&amp;nbsp; the Example project&amp;nbsp; has problem&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 08:27:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2061083#M33759</guid>
      <dc:creator>Seongyon_Jeong</dc:creator>
      <dc:date>2025-03-13T08:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: flash component project</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2061142#M33761</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220925"&gt;@Seongyon_Jeong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the latest SDK(v24.12 or v2.16.0) which need IDE v24 to run the same example (evkmimxrt1020_flash_component_nor_flexspi), but both of them all works fine.&lt;/P&gt;
&lt;P&gt;Please double check from your side.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nxp-mcuxpresso/mcux-sdk-examples/tree/5a158afe9cdb70ca449667ed71490afd29655710/evkmimxrt1020/component_examples/flash_component/flexspi_nor" target="_blank"&gt;https://github.com/nxp-mcuxpresso/mcux-sdk-examples/tree/5a158afe9cdb70ca449667ed71490afd29655710/evkmimxrt1020/component_examples/flash_component/flexspi_nor&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;***NOR Flash Component Demo Start!***


***NOR Flash Page 0 Read/Write Success!***


***NOR Flash Page 1 Read/Write Success!***


***NOR Flash Page 2 Read/Write Success!***


***NOR Flash Page 3 Read/Write Success!***


***NOR Flash Page 4 Read/Write Success!***


***NOR Flash Page 5 Read/Write Success!***


***NOR Flash Page 6 Read/Write Success!***


***NOR Flash Page 7 Read/Write Success!***


***NOR Flash Page 8 Read/Write Success!***


***NOR Flash Page 9 Read/Write Success!***


***NOR Flash Page 10 Read/Write Success!***


***NOR Flash Page 11 Read/Write Success!***


***NOR Flash Page 12 Read/Write Success!***


***NOR Flash Page 13 Read/Write Success!***


***NOR Flash Page 14 Read/Write Success!***


***NOR Flash Page 15 Read/Write Success!***

***NOR Flash All Pages Read/Write Success!***&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 09:15:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2061142#M33761</guid>
      <dc:creator>Sam_Gao</dc:creator>
      <dc:date>2025-03-13T09:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: flash component project</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2061712#M33764</link>
      <description>&lt;P&gt;I did&amp;nbsp; double checks.&amp;nbsp; but&amp;nbsp; Still&amp;nbsp; hardfault occures&lt;BR /&gt;But I change SDK version or RT1020... SDK 2.13 -&amp;gt; SDK 24.12&amp;nbsp; &amp;nbsp;then&amp;nbsp; It works fine&lt;/P&gt;&lt;P&gt;After comparing two version with diff sw tool,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Now I&amp;nbsp; &amp;nbsp;guess , previous SDK version Example has problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyway. thanks for your&amp;nbsp; f/up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 02:38:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Hardfault-handler-log-saving/m-p/2061712#M33764</guid>
      <dc:creator>Seongyon_Jeong</dc:creator>
      <dc:date>2025-03-14T02:38:59Z</dc:date>
    </item>
  </channel>
</rss>

