<?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: I am getting Hard Fault whenever I am trying to access Program memory in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815231#M49430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aniket,&lt;/P&gt;&lt;P&gt;what is the value of pu8Ptr?&lt;/P&gt;&lt;P&gt;And I see that you have stuff allocated at 0x10'0000, but your device has FLASH only up to 0x8'0000?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2018 06:44:58 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2018-08-07T06:44:58Z</dc:date>
    <item>
      <title>I am getting Hard Fault whenever I am trying to access Program memory</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815228#M49427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;nbsp; Hello,&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; I am using NXP K2x K22FN512M12 controller and MCUXpresso IDE.&lt;BR /&gt;&amp;nbsp; I am getting Hard Fault whenever I am trying to access Program memory.&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Example:&lt;BR /&gt;&amp;nbsp; I have saved this array in Program memory using following method&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; __attribute__ ((section (".myAccessArray"))) uint8_t au8DeviceObject&lt;BR /&gt;&amp;nbsp;&amp;nbsp;[MAX_PROP_SUPPORTED+1][MAX_OBJECT_TYPE-1]&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Linker File:&lt;BR /&gt;&amp;nbsp; I have allocated memory from text area&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; MEMORY {&lt;BR /&gt;&amp;nbsp; m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000198&amp;nbsp; /* Debugger COmpatible, no bootloader compatible*/&lt;BR /&gt;&amp;nbsp; /*m_interrupts (RX) : ORIGIN = 0x00012800, LENGTH = 0x00000198*/&amp;nbsp;&amp;nbsp; /*&amp;nbsp; bootloader compatible*/&lt;BR /&gt;&amp;nbsp; m_text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00012C10, LENGTH = 0x0006D3F0&lt;BR /&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000&lt;BR /&gt;&amp;nbsp; m_heap_rtos (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000&lt;BR /&gt;&amp;nbsp; m_cfmprotrom&amp;nbsp; (RX) : ORIGIN = 0x00012C00, LENGTH = 0x00000010&lt;BR /&gt;&amp;nbsp; WIFI_DATA (RX) : ORIGIN = 0x00011800, LENGTH = 0x00000800&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*0x00011800 to 0x00012000*/&lt;BR /&gt;&amp;nbsp; OTHER_DATA (RX) : ORIGIN = 0x00012000, LENGTH = 0x00000800&amp;nbsp;&amp;nbsp; /*0x00012000 to 0x00012800*/&lt;BR /&gt;&amp;nbsp; ACCESS_ARRAY(RX) : ORIGIN = 0x00100000, LENGTH = 0x000051d8&lt;BR /&gt;&amp;nbsp; DATA_ARRAY(RX) : ORIGIN = 0x001053E0, LENGTH = 0x000051d8&lt;BR /&gt;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; /* Define output sections */&lt;BR /&gt;&amp;nbsp; SECTIONS&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;/* The startup code goes first into INTERNAL_FLASH */&lt;BR /&gt;&amp;nbsp;.&lt;BR /&gt;&amp;nbsp;.&lt;BR /&gt;&amp;nbsp;.// other sections&lt;BR /&gt;&amp;nbsp;.&lt;BR /&gt;&amp;nbsp; .myAccessArray&amp;nbsp; :&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.AccArrCfg)) /* keep my variable even if not referenced */&lt;BR /&gt;&amp;nbsp; } &amp;gt; ACCESS_ARRAY &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; .myDataArray&amp;nbsp; :&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.DataArrCfg)) /* keep my variable even if not referenced */&lt;BR /&gt;&amp;nbsp; } &amp;gt; DATA_ARRAY&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp; Accessing array:&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; uint8_t *pu8AccArray = NULL;&lt;BR /&gt;&amp;nbsp; uint8_t *pu8Ptr = NULL;&lt;BR /&gt;&amp;nbsp; uint32_t u32DevProp = PROP_DEVICE;&lt;BR /&gt;&amp;nbsp; uint32_t u32ObjType = OBJECT_ANALOG;&lt;BR /&gt;&amp;nbsp; uint32_t u32PropType = 0;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; pu8AccArray = &amp;amp;au8DeviceObject[0][0];&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; pu8Ptr = (pu8AccArray + ((MAX_PROP_SUPPORTED+1) * u32DevProp) + u32ObjType);&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 25.95px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;u32PropType &lt;/SPAN&gt;= *pu8Ptr;&amp;nbsp;// @ this point exception occurs and controller goes into hard fault.&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Please let me know if there is anything that I am doing wrong.&lt;BR /&gt;&amp;nbsp; Thank You!!!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 07:20:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815228#M49427</guid>
      <dc:creator>abaniketbhumkar</dc:creator>
      <dc:date>2018-08-03T07:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting Hard Fault whenever I am trying to access Program memory</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815229#M49428</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;What is the value of &lt;STRONG&gt;pu8Ptr&lt;/STRONG&gt; when it hard faults?&lt;BR /&gt;Are you sure that it is pointing to the flash since it can't be calculated from the code that you have shown (some define values are not shown).&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;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 23:40:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815229#M49428</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-08-03T23:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting Hard Fault whenever I am trying to access Program memory</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815230#M49429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Yes, the value of&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #51626f; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #51626f;"&gt;pu8Ptr&lt;/STRONG&gt; pointer i&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;s pointing to the flash. Whenever I debug,&amp;nbsp;&lt;STRONG style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #51626f; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #51626f;"&gt;pu8Ptr&lt;/STRONG&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt; pointer&lt;/SPAN&gt; points the&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; assigned memory address in flash.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000011; font-family: Arial;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Aniket&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 05:07:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815230#M49429</guid>
      <dc:creator>abaniketbhumkar</dc:creator>
      <dc:date>2018-08-07T05:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting Hard Fault whenever I am trying to access Program memory</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815231#M49430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aniket,&lt;/P&gt;&lt;P&gt;what is the value of pu8Ptr?&lt;/P&gt;&lt;P&gt;And I see that you have stuff allocated at 0x10'0000, but your device has FLASH only up to 0x8'0000?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 06:44:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-getting-Hard-Fault-whenever-I-am-trying-to-access-Program/m-p/815231#M49430</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2018-08-07T06:44:58Z</dc:date>
    </item>
  </channel>
</rss>

