<?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>LPC MicrocontrollersのトピックRe: LPC1227 Hard Fault when reading value from pointer with valid address</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789505#M31770</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;Could you update the LPCXpresso IDE to latest version V8.2.2?&lt;/P&gt;&lt;P&gt;If there still with the same issue, I will report that software issue to LPCXpresso IDE software team.&lt;/P&gt;&lt;P&gt;Please let us know if the latest LPCXpresso IDE software could fix the issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jun 2018 03:26:20 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2018-06-25T03:26:20Z</dc:date>
    <item>
      <title>LPC1227 Hard Fault when reading value from pointer with valid address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789500#M31765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I working on project with LPC1227. My application using many of libraries, previously created on linux.&lt;BR /&gt;These libraries were previously compiled and used on LPC1768 based project.&lt;BR /&gt;Now I have compiled these libraries for LPC1227.&lt;BR /&gt;When I run my test application, application will be stopped and stay dead.&lt;BR /&gt;I have debug, where is problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem occure when start condition with reading value of pointer *crc:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(*crc == crc_calculated)&amp;nbsp; // Do this, will trigger HardFault_Handler(void) in cr_startup_lpc12xx.c file&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All parts of used code are here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct _ANB_SESSION_&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t rx_buff[40];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;BR /&gt;}&lt;BR /&gt;ANB_SESSION;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANB_SESSION *anb_session;&lt;BR /&gt;uint16_t *crc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;crc = (uint16_t *)&amp;amp;(anb_session -&amp;gt; rx_buff[anb_session -&amp;gt; first_byte_datagram_index + sizeof(ANB_DATAGRAM_HEADER) + anb_datagram_header-&amp;gt;Len]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(*crc == crc_calculated)&amp;nbsp; // Do this, will trigger HardFault_Handler(void) in cr_startup_lpc12xx.c file&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index of rx_buff in assignment is 28 and rx_buff is 40 bytes long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Address filled in pointer crc is 0x10000329 and pointed value is 32292 decimal.&lt;BR /&gt;Local variable crc_calculated has same value (32292). Type of local variable crc_calculated is uint16_t.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I click with cursor in debugger on variables in condition, displayed values are correct.&lt;BR /&gt;After do condition, then will be triggered HardFault_Handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still using LPCxpresso v7.6.2 [Build 326] [2015-02-02] for LPC1227 and before LPC1768.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All libraries are only precompiled from LPC1768 to LPC1227 and used equaly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:58:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789500#M31765</guid>
      <dc:creator>miloskrizan</dc:creator>
      <dc:date>2018-06-18T13:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227 Hard Fault when reading value from pointer with valid address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789501#M31766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Milos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides of LPCxpresso v7.6.2 [Build 326] [2015-02-02]&amp;nbsp; IDE, what's the hardware board you are using?&lt;/P&gt;&lt;P&gt;Could you provide the software project?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 08:06:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789501#M31766</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-06-19T08:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227 Hard Fault when reading value from pointer with valid address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789502#M31767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your questions Mike &lt;SPAN class=""&gt;&lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="15678" data-username="Hui_Ma" href="https://community.nxp.com/people/Hui_Ma"&gt;Hui_Ma&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;excuse me, yesterday I was off..&lt;/P&gt;&lt;P&gt;I'm using Olimex LPC-P1227 development board, that contains LPC1227FBD64/301.&lt;/P&gt;&lt;P&gt;Yes, I can provide SW project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 11:50:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789502#M31767</guid>
      <dc:creator>miloskrizan</dc:creator>
      <dc:date>2018-06-20T11:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227 Hard Fault when reading value from pointer with valid address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789503#M31768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added to project startup code in file cr_startup_lpc12xx.c code according &lt;A href="https://community.nxp.com/thread/389002"&gt;Debugging a Hard Fault.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;After, when I track assignment value to stacked_r0 variable, debuger halt with message "No source available for "0xfffffffe"".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I remove lines with assignment to variables&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_r0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_r1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_r2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_r3,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_r12,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_lr,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_pc and &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;stacked_psr &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;all remain variables&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_CFSR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_HFSR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_DFSR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_AFSR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_MMAR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_BFAR&lt;/SPAN&gt;&amp;nbsp; will be done with zero value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Milos&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 13:48:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789503#M31768</guid>
      <dc:creator>miloskrizan</dc:creator>
      <dc:date>2018-06-20T13:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227 Hard Fault when reading value from pointer with valid address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789504#M31769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;here is my simplest code, which demostrate trigger Hard Fault event.&lt;/P&gt;&lt;P&gt;Hard Fault event is triggered when reading from pointer to array in struct if(*value == 32292).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code was tested LPC1227, LPC1114 and LPC1769 with code optimalization (None -O0).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code generate Hard Fault event only LPC1227 and LPC1114, which have Cortex M0 core. On LPC1769 event not triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like know, if exist some proper compiler flag that solving this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code here:&lt;/P&gt;&lt;P&gt;#define ARRAY_LENGTH(array) (sizeof((array))/sizeof((array)[0]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct _TEST_STRUCT_TYPE_&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile uint8_t some_variable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile uint8_t rx_buff[40];&lt;/P&gt;&lt;P&gt;} TEST_STRUCT_TYPE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;volatile TEST_STRUCT_TYPE tst_in_main;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void TEST_STRUCT_TYPE_Service(TEST_STRUCT_TYPE *tst);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint8_t test_uart_put_array[] = { 0x21, 0x23, 0x3C, 0x3E, 0x64, 0x2F, 0x01, 0x00, 0x12, 0x00, 0x53, 0x01, 0x02, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0xFF, 0x24, 0x7E };&lt;BR /&gt;//uint8_t test_uart_put_array[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD };&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;volatile int size;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;size = sizeof(TEST_STRUCT_TYPE);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy((void *)&amp;amp;(tst_in_main.rx_buff[0]), (void *)&amp;amp;(test_uart_put_array[0]), 30);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TEST_STRUCT_TYPE_Service(&amp;amp;tst_in_main);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //rp6_diag_comm_can_read_data = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**********************************************************************************************/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Main Loop forever */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0 ;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void TEST_STRUCT_TYPE_Service(TEST_STRUCT_TYPE *tst)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint16_t *value;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;volatile int counter = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = (uint16_t *)&amp;amp;(tst -&amp;gt; rx_buff[28]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(*value == 32292)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;counter++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2018 09:09:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789504#M31769</guid>
      <dc:creator>miloskrizan</dc:creator>
      <dc:date>2018-06-22T09:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227 Hard Fault when reading value from pointer with valid address</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789505#M31770</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;Could you update the LPCXpresso IDE to latest version V8.2.2?&lt;/P&gt;&lt;P&gt;If there still with the same issue, I will report that software issue to LPCXpresso IDE software team.&lt;/P&gt;&lt;P&gt;Please let us know if the latest LPCXpresso IDE software could fix the issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2018 03:26:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1227-Hard-Fault-when-reading-value-from-pointer-with-valid/m-p/789505#M31770</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-06-25T03:26:20Z</dc:date>
    </item>
  </channel>
</rss>

