<?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 error in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581358#M24924</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by toniojesusde on Thu Apr 14 09:54:48 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the next piece of code in my application. TIM2TCold is a global variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to copy the contents of the counter/timer 2 from my timer0 handler i get a HARDFAULT! any ideas???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void TIMER0_IRQHandler(void) {//interrupt each second&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIM2TCold=LPC_TIM2-&amp;gt;TC;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Antonio&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:39:27 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:39:27Z</dc:date>
    <item>
      <title>HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581358#M24924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by toniojesusde on Thu Apr 14 09:54:48 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the next piece of code in my application. TIM2TCold is a global variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to copy the contents of the counter/timer 2 from my timer0 handler i get a HARDFAULT! any ideas???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void TIMER0_IRQHandler(void) {//interrupt each second&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIM2TCold=LPC_TIM2-&amp;gt;TC;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Antonio&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581358#M24924</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581359#M24925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Apr 14 10:03:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Which MCU are you using?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you reset the timer interrupt?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is your timer ISR working without this copy line?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581359#M24925</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581360#M24926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by toniojesusde on Thu Apr 14 13:18:10 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1769&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do reset the interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ISR works fine without that line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int i, PIDOn, SetValCargaQ, CargaQSP, SetISP, Pulses, TIM2TCold;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void TIMER0_IRQHandler(void) {//interrupt each second&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_TIM0-&amp;gt;IR = 1; /* clear interrupt flag */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer0_counter++;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIM2TCold=LPC_TIM2-&amp;gt;TC;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581360#M24926</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581361#M24927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Apr 14 13:31:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: toniojesusde&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;unsigned int i, PIDOn, SetValCargaQ, CargaQSP, SetISP, Pulses, TIM2TCold;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;volatile unsigned int i, PIDOn, SetValCargaQ, CargaQSP, SetISP, Pulses, TIM2TCold;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does changing TIM2TCold cause something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you try to read in a dummy value, like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
volatile unsigned int dummy;
dummy=LPC_TIM2-&amp;gt;TC;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581361#M24927</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581362#M24928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Thu Apr 14 14:49:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Zero&lt;/STRONG&gt;&lt;BR /&gt;Did you try to read in a dummy value, like:&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
volatile unsigned int dummy;
dummy=LPC_TIM2-&amp;gt;TC;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand the need for "volatile" here and in your previous post, but I'm curious about what a dummy read would accomplish?&amp;nbsp; Not knowing what the code is written as leaves us a bit in the dark.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Larry&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581362#M24928</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581363#M24929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Thu Apr 14 14:57:46 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: toniojesusde&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;When I try to copy the contents of the counter/timer 2 from my timer0 handler i get a HARDFAULT! any ideas???&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to check the obvious, I presume that you have actually enabled Timer2 in PCONP?? On reset, Timer0/1 are enabled but Timer2/3 are disabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581363#M24929</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: HardFault error</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581364#M24930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by toniojesusde on Fri Apr 15 03:54:57 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeRedSupport, you were right. The initial configuration was right but some other part of my code overwrote the PCON and disabled it. Thanks a lot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:39:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/HardFault-error/m-p/581364#M24930</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:39:31Z</dc:date>
    </item>
  </channel>
</rss>

