<?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: Can't Debug LPC4357-M4 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590024#M22015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xianghuiwang on Thu Apr 16 22:27:41 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I would recommend you step in main in assembly mode and compare the instruction execution&amp;nbsp; between the functioning and unfunctioning board. Are the two customer boards an identical design? Details in the error message is also needed for further assistance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:16:23 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:16:23Z</dc:date>
    <item>
      <title>Can't Debug LPC4357-M4</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590023#M22014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TahaSN on Thu Apr 16 14:11:45 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We populated a custom board which includes LPC4357 and when I tried to program the chip using IAR debug, it stopped on the main function as usual but then when I ran the code it gave me an error that it failed to get the CPU status and closed the debugger. I tried the same code on another custom board and it works fine. We thought that it went into some code protection mode, so I tried to boot into ISP mode by putting P2_7, P1_1, P1_2, P2_8 and P2_9 low in order to boot from USART0 mode. But I still didnt get anything back from there. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to use Flash Magic software (I haven't used it before) in order to get some kind of access but I got nothing. I did realise that when the uC is in USART0 mode, I am able to program the device but it never runs the code. Do you guys have any idea what can be wrong because I am currently out of ideas. Please let me know if you need some other information in order to help me out. I will try my best to provide the information as quickly as I can.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Taha&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:16:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590023#M22014</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Debug LPC4357-M4</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590024#M22015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xianghuiwang on Thu Apr 16 22:27:41 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I would recommend you step in main in assembly mode and compare the instruction execution&amp;nbsp; between the functioning and unfunctioning board. Are the two customer boards an identical design? Details in the error message is also needed for further assistance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:16:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590024#M22015</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Debug LPC4357-M4</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590025#M22016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bavarian on Fri Apr 17 04:26:59 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;My comments &amp;amp; recommendations:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- don't run to main() with the debugger&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- insert a long wait loop right at the beginning of the C code, to make sure that the chip doesn't execute any critical code before the debugger is able to stop the core.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- if you then can step through the code, the hardware isn't that wrong&amp;nbsp; ;-) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- do you use the external memory interface? Which resistor values did you use for the bootstrap pins (which belong to the EMC i/f) ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP Support Team&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:16:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590025#M22016</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Debug LPC4357-M4</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590026#M22017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TahaSN on Fri Apr 17 07:41:08 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Bavarian, as you recommended, I put an infinite loop in the main before setting up anything and it was working. Then I added the function which sets up the clock to external oscillator and uses pll to boost the frequency upto 204MHz. I narrowed down the problem to the following code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void System_ClockSetup(void)
{
/* Switch Main System Clock to Crystal */
Chip_Clock_EnableCrystal();
[color=#c00]Chip_Clock_SetBaseClock(CLK_BASE_MX, CLKIN_CRYSTAL, true, false);[/color]

/* Setup PLL for 100MHz and Switch Main System Clock */
Chip_Clock_SetupMainPLLHz(CLKIN_CRYSTAL, OscRateIn, 100 * 1000000, 100 * 1000000);
Chip_Clock_SetBaseClock(CLK_BASE_MX, CLKIN_MAINPLL, true, false);

/* Setup PLL for Maximum Clock */
Chip_Clock_SetupMainPLLHz(CLKIN_CRYSTAL, OscRateIn, MAX_CLOCK_FREQ, MAX_CLOCK_FREQ);

/* Setup the Base Clock Sources */
for (int i = 0; i &amp;lt; (sizeof(InitClkStates) / sizeof(InitClkStates[0])); i++) 
{
Chip_Clock_SetBaseClock(InitClkStates&lt;I&gt;.clk, InitClkStates&lt;I&gt;.clkin, InitClkStates&lt;I&gt;.autoblock_enab, InitClkStates&lt;I&gt;.powerdn);
}
}
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void Chip_Clock_SetBaseClock(CHIP_CGU_BASE_CLK_T BaseClock, CHIP_CGU_CLKIN_T Input, bool autoblocken, bool powerdn)
{
uint32_t reg = LPC_CGU-&amp;gt;BASE_CLK[BaseClock];

if (BaseClock &amp;lt; CLK_BASE_NONE) {
if (Input != CLKINPUT_PD) {
/* Mask off fields we plan to update */
reg &amp;amp;= ~((0x1F &amp;lt;&amp;lt; 24) | 1 | (1 &amp;lt;&amp;lt; 11));

if (autoblocken) {
reg |= (1 &amp;lt;&amp;lt; 11);
}
if (powerdn) {
reg |= (1 &amp;lt;&amp;lt; 0);
}

/* Set clock source */
reg |= (Input &amp;lt;&amp;lt; 24);

[color=#c00]LPC_CGU-&amp;gt;BASE_CLK[BaseClock] = reg;[/color]
}
}
else {
LPC_CGU-&amp;gt;BASE_CLK[BaseClock] = reg | 1;/* Power down this base clock */
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the debugger cannot execute the colored statement and give me error at that particular statement. The value of reg at that particular instance was 0x06000800 which seems to be fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also checked the continuity of xtal pins to the crystal and it seems fine. I also swapped the crystal with a new one but still the same problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:16:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-Debug-LPC4357-M4/m-p/590026#M22017</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:16:25Z</dc:date>
    </item>
  </channel>
</rss>

