<?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: LPC1112 - hardfault on PDRUNCFG register write in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601667#M23381</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I found the problem - Code was compiled for wrong core (facepalm).&lt;/P&gt;&lt;P&gt;I copied project from earlier revision, but I forgot that it used Cortex-m3 chip and LPC1112 is Cortex-M0.&lt;/P&gt;&lt;P&gt;Copynig data and zeroing BSS worked fine because it only used instructions supported by both cores, but when it came to writing registers&lt;/P&gt;&lt;P&gt;everything blew up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2017 14:51:17 GMT</pubDate>
    <dc:creator>danielkowalski</dc:creator>
    <dc:date>2017-02-09T14:51:17Z</dc:date>
    <item>
      <title>LPC1112 - hardfault on PDRUNCFG register write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601665#M23379</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;I encountered strange problem with LPC1112 MCU when creating new design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCU mysteriously hard-faulted before reaching main, so I started debugging startup code (this works perfectly fine) and found problematic line in CMSIS source (system_LPC11xx.c):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_SYSCON-&amp;gt;PDRUNCFG &amp;amp;= ~(1 &amp;lt;&amp;lt; 5); /* Power-up System Osc */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reading through manual I found that some reserved bits need to be set to 1 in PDRUNCFG during write,&lt;/P&gt;&lt;P&gt;I tried setting register value to reset value (with required reserved bits), before even calling SystemInit.&lt;/P&gt;&lt;P&gt;Result is still the same - I get HardFault even with simple write to register:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LPC_SYSCON-&amp;gt;PDRUNCFG = 0b1110110111110000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing happening before that is filling bss with zeros and copying data section to RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what might be wrong with this? (I cannot configure system clock)&lt;/P&gt;&lt;P&gt;MCU is LPC1112FHI33/202.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Feb 2017 01:39:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601665#M23379</guid>
      <dc:creator>danielkowalski</dc:creator>
      <dc:date>2017-02-04T01:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1112 - hardfault on PDRUNCFG register write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601666#M23380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; There is a possibilty that you used SYS OSC as the clock source for SYSPLLCLKSEL&amp;nbsp;already and&amp;nbsp;MAINCLK is&amp;nbsp;derived from SYS OSC already, then you power down the&amp;nbsp;SYS OSC&amp;nbsp;in PDRUNCFG, you&amp;nbsp;will get the hard fault.&lt;/P&gt;&lt;P&gt;If you use IRC as the clock source in SYSPLLCLK and MAINCLK, then, it will be OK to power down SYS OSC to lower the overall power consumption. Try this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.nxp.com/products/software-and-tools/hardware-development-tools/lpcxpresso-boards/lpcopen-software-development-platform-lpc11xx:LPCOPEN-SOFTWARE-FOR-LPC11XX"&gt;http://www.nxp.com/products/software-and-tools/hardware-development-tools/lpcxpresso-boards/lpcopen-software-development-platform-lpc11xx:LPCOPEN-SOFTWARE-FOR-LPC11XX&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2017 00:50:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601666#M23380</guid>
      <dc:creator>Dezheng_Tang</dc:creator>
      <dc:date>2017-02-08T00:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1112 - hardfault on PDRUNCFG register write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601667#M23381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I found the problem - Code was compiled for wrong core (facepalm).&lt;/P&gt;&lt;P&gt;I copied project from earlier revision, but I forgot that it used Cortex-m3 chip and LPC1112 is Cortex-M0.&lt;/P&gt;&lt;P&gt;Copynig data and zeroing BSS worked fine because it only used instructions supported by both cores, but when it came to writing registers&lt;/P&gt;&lt;P&gt;everything blew up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 14:51:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1112-hardfault-on-PDRUNCFG-register-write/m-p/601667#M23381</guid>
      <dc:creator>danielkowalski</dc:creator>
      <dc:date>2017-02-09T14:51:17Z</dc:date>
    </item>
  </channel>
</rss>

