EmbeddedRelated.com
Forums

LPC2368 Wrong CCLKSEL value caused problems in programming chip

Started by Hossein April 5, 2011
Hi all,

I was working with my custom board which I designed and recently I could write a simple firmware to turn off/on some LEDs, I wanted to test what would happen if we program device with even values for CCLKSEL that I saw it is not working any longer but when I changed the value to odd one and tried to download the code to the chip I couldn't. I am working with H-JTAG V0.4.3 and it gives an error message indicating that it couldn't halt the cpu and take it in debug mode.

does any one know how I can deal with this issue?

thanks in advance.

An Engineer's Guide to the LPC2100 Series

--- In l..., "Hossein" wrote:
>
> Hi all,
>
> I was working with my custom board which I designed and recently I could write a simple firmware to turn off/on some LEDs, I wanted to test what would happen if we program device with even values for CCLKSEL that I saw it is not working any longer but when I changed the value to odd one and tried to download the code to the chip I couldn't. I am working with H-JTAG V0.4.3 and it gives an error message indicating that it couldn't halt the cpu and take it in debug mode.
>
> does any one know how I can deal with this issue?
>
> thanks in advance.
>

You'll most likely find that the JTAG port is reliant on stable clock settings. The only way I found round this is to flash a good firmware (sensible clock values) using UART0 and the built in ISP using flash magic. Once you do that, you'll find JTAG springs back to life again.

On 04/05/2011 02:41 PM, Hossein wrote:
> I was working with my custom board which I designed and recently I could
> write a simple firmware to turn off/on some LEDs, I wanted to test what
> would happen if we program device with even values for CCLKSEL that I
> saw it is not working any longer but when I changed the value to odd one
> and tried to download the code to the chip I couldn't. I am working with
> H-JTAG V0.4.3 and it gives an error message indicating that it couldn't
> halt the cpu and take it in debug mode.
>
> does any one know how I can deal with this issue?

As Simon said, you'll need a good clock for the JTAG. But it is enough
to reset the board into ISP mode and then you have internal 4MHz clock
and JTAG should be happy. Just be sure that JTAG clock is no faster than
(4/6)MHz (minus tolerances).

--

Timo
Hi Simon,
thank you for your useful comment I used flashmagic and loaded a correct hex file into the microcontroller and now all things are working good.

thanks for your helpful comment.
Hossein

--- On Tue, 5/4/11, simonb65 wrote:

From: simonb65
Subject: [lpc2000] Re: LPC2368 Wrong CCLKSEL value caused problems in programming chip
To: l...
Date: Tuesday, 5 April, 2011, 8:09 PM

 

--- In l..., "Hossein" wrote:

>

> Hi all,

>

> I was working with my custom board which I designed and recently I could write a simple firmware to turn off/on some LEDs, I wanted to test what would happen if we program device with even values for CCLKSEL that I saw it is not working any longer but when I changed the value to odd one and tried to download the code to the chip I couldn't. I am working with H-JTAG V0.4.3 and it gives an error message indicating that it couldn't halt the cpu and take it in debug mode.

>

> does any one know how I can deal with this issue?

>

> thanks in advance.

>

You'll most likely find that the JTAG port is reliant on stable clock settings. The only way I found round this is to flash a good firmware (sensible clock values) using UART0 and the built in ISP using flash magic. Once you do that, you'll find JTAG springs back to life again.