<?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: LPC824 project hard faults in clock_config.c</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935249#M37283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so, bumping this - has anybody else seen this problem?&amp;nbsp; I suspect some sort of hardware bug here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2019 19:43:45 GMT</pubDate>
    <dc:creator>bburch</dc:creator>
    <dc:date>2019-07-18T19:43:45Z</dc:date>
    <item>
      <title>LPC824 project hard faults in clock_config.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935245#M37279</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;I am having a very odd problem, and I am hoping somebody has seen this one before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing a bare metal project on an LPC824.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We recently moved the project from the dev board to the prototype. &amp;nbsp;In doing so we changed some clock settings to derive the clock from the 16MHz crystal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After doing so, we then rebuilt, loaded our code onto the target with a J-Link box, and proceeded from the start breakpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We then hard fault in&amp;nbsp;BOARD_BootClockRUN from clock_config.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The offending code;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CLOCK_Select(&lt;SPAN style="color: #0326cc;"&gt;kCLKOUT_From_Irc&lt;/SPAN&gt;); &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #4e9072;"&gt;/*!&amp;lt; select IRC for CLKOUT */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d; "&gt;If we breakpoint just before this call, and then do a step over, we immediately fault.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d; "&gt;If we step through the call, however we do not fault!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d; "&gt;That call is immediately preceded by turning on the main clock;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CLOCK_SetMainClkSrc(&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;kCLOCK_MainClkSrcSysPll&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;); &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;/*!&amp;lt; select &lt;SPAN style="text-decoration: underline;"&gt;syspll&lt;/SPAN&gt; for main clock */&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;If I comment out the SetMainClkSrc call, keeping the default internal rc clock everything is fine also.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;I've seen issues on other micro controllers where a change in the clock mode caused a bad instruction fetch, but since we were halted at a breakpoint right after the SetMainClkSrc, the clock should have been stable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;And also oddly, this seems to work OK on one of our development computers but not on another.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;The one it works on is a Windows 10 Laptop. &amp;nbsp;The one that has problems (my machine of course) is a MacBook.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;I have tried this on the MacBook both in MacOS and in Parallels Windows 10, and both have the same failure mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;For the test under parallels, I re-installed MCUXpresso v11 and re-downloaded the SDK and installed it.#&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;We are mystified by this. &amp;nbsp;Any ideas? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;Thanks SO MUCH!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;-Ben Burch&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;BTW Controls&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2019 18:45:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935245#M37279</guid>
      <dc:creator>bburch</dc:creator>
      <dc:date>2019-07-03T18:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 project hard faults in clock_config.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935246#M37280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ben,&lt;/P&gt;&lt;P&gt;Currently, I think the main problem is to locate which line leads to the hardfault, &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CLOCK_Select(&lt;SPAN style="color: #0326cc;"&gt;kCLKOUT_From_Irc&lt;/SPAN&gt;); &lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt; or &lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &amp;nbsp; &lt;/SPAN&gt;CLOCK_SetMainClkSrc(&lt;/SPAN&gt;&lt;SPAN style="color: #0326cc;"&gt;kCLOCK_MainClkSrcSysPll&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;); &lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;I suppose that the PLL configuration is incorrect which leads to the issue, if you select for example IRC as the main clock, is there issue?&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jul 2019 08:59:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935246#M37280</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2019-07-04T08:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 project hard faults in clock_config.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935247#M37281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll set that condition up and report back later this morning. &amp;nbsp;Thank you for the suggestion!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ben Burch&lt;/P&gt;&lt;P&gt;BTR Controls&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 12:38:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935247#M37281</guid>
      <dc:creator>bburch</dc:creator>
      <dc:date>2019-07-05T12:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 project hard faults in clock_config.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935248#M37282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, actually I got right to that. &amp;nbsp;When I set the clock from&amp;nbsp;kCLOCK_MainClkSrcIrc it does not fail, though of course all of my multipliers are wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also find that if I remove the CLOCK_SetMainClkSrc to the END of BOARD_BootClockRUN, and use the&amp;nbsp;&lt;SPAN style="color: #0326cc; background-color: #ffffff;"&gt;kCLOCK_MainClkSrcSysPll&lt;SPAN style="color: #3d3d3d;"&gt;&amp;nbsp;there, then everything works and it comes up with all the dividers set correctly.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; "&gt;So that is a work-around for now, but I am very reluctant to accept this as a long term fix as the clock_config.c file is a generated file, and so could be accidentally changed in maintenance activities in the future.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; "&gt;Also, the fact that this works differently on different development hardware is a worry and appears to be some species of timing-based issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; "&gt;Any thoughts on this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; "&gt;Thanks so much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; "&gt;-Ben Burch&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d; "&gt;BTR Controls&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 12:51:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935248#M37282</guid>
      <dc:creator>bburch</dc:creator>
      <dc:date>2019-07-05T12:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 project hard faults in clock_config.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935249#M37283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so, bumping this - has anybody else seen this problem?&amp;nbsp; I suspect some sort of hardware bug here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2019 19:43:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935249#M37283</guid>
      <dc:creator>bburch</dc:creator>
      <dc:date>2019-07-18T19:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPC824 project hard faults in clock_config.c</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935250#M37284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any thoughts on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-BenB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 13:48:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC824-project-hard-faults-in-clock-config-c/m-p/935250#M37284</guid>
      <dc:creator>bburch</dc:creator>
      <dc:date>2019-08-09T13:48:46Z</dc:date>
    </item>
  </channel>
</rss>

