EmbeddedRelated.com
Forums

JTAG stopped communicating - LPC2148

Started by Sutton Mehaffey October 14, 2010
Sutton,

Just program using ISP once you've corrected, if that's the problem, the PLL values.

I found this issue on a LPC2388 when I set the PLL to a nice fast clock (datasheet says 275MHz to 550Mhz), only to find in the Errata (worth checking for your part) states that only 275MHz to 290MHz can be achieved !!!

Once we got the PLL back into the safe band (ours is at 288MHz) it all sprung back into life :-)

Simon.

--- In l..., Sutton Mehaffey wrote:
>
> I'll check the VirtualCOM demo code. That's the code that started this
> problem. I can't imagine with all the people using it, that it has that
> type of problem. How do you 'reset' the JTAG if the PLL values were
> programmed wrong?
> On 10/15/2010 9:48 AM, simonb65 wrote:
> >
> >
> > Sutton,
> >
> > ...Also, if you program in PLL multiplier/divider values that put the
> > core clock outside the specified limits, that also has the same symptoms
> > as you are describing as the ISP sets it's clock up as it needs it and
> > the JTAG relies on your settings!
> >
> > Simon.
> >
> > --- In l... ,
> > Sutton Mehaffey wrote:
> > >
> > > My application code (which includes a custom bootloader) doesn't set the
> > > protect bits. And, I'm certain the VirtualCOM demo code doesn't set
> > > those bits. I can erase the entire chip serially and reprogram serially
> > > and code I want to, but JTAG still locked.
> > >
> > >
> > >
> > > On 10/15/2010 9:41 AM, simonb65 wrote:
> > > >
> > > >
> > > > Sutton,
> > > >
> > > > It sound like the code you are programming in has the code protect bits
> > > > set !! Once you set these, all JTAG operations are blocked and only an
> > > > Erase and re-flash via ISP are possible. The bootloader is designed
> > like
> > > > that to prevent your code from being reverse engineered or copied !!
> > > >
> > > > It used to catch me out every time 'till I read the manual!
> > > >
> > > > Simon.
> > > >
> > > > --- In l...
> > ,
> > > > Sutton Mehaffey wrote:
> > > > >
> > > > > I can't imagine that we 3 are the only ones that continually have
> > > > > problems with the JTAG. There must be a unknown hardware issue
> > that is
> > > > > preventing JTAG from working. I've always been able to 'unlock' the
> > > > > JTAG by serial programming. But, starting yesterday, after
> > loading the
> > > > > VirtualCOM example under Files section into my prototype board,
> > my board
> > > > > became unresponsive to JTAG. I can still program my code or the
> > > > > VirtualCOM code into the board serially. I have my CPU socketed. 3
> > > > > different CPUs that still have valid code and were recently
> > programmed
> > > > > by JTAG no longer are programmable by JTAG either.
> > > > >
> > > > >
> > > > >
> > > > > On 10/14/2010 11:04 PM, Xiaofan Chen wrote:
> > > > > >
> > > > > >
> > > > > > On Fri, Oct 15, 2010 at 7:22 AM, Michael Freeman
> > > > > > > wrote:
> > > > > > > There are some memory/register locations that if written to will
> > > > cause
> > > > > > > the JTAG to stop working. Make sure your firmware does not
> > have any
> > > > > > > bugs that can hit those addresses.
> > > > > >
> > > > > > On a related note, I've never been able to use Jtag (OpenOCD)
> > > > > > after flashing JCWren's example. Serial (lpc21isp)
> > > > > > works fine. It is still a mystery.
> > > > > >
> > > > > > JCwren's example
> > > > > > http://www.jcwren.com/arm/
> > > > > >
> > > > > > You can use lpc21isp (serial) or OpenOCD (Jtag) to flash the
> > firmware.
> > > > > > Then after that, you will not be able to communicate with the chip
> > > > using
> > > > > > OpenOCD/Jtag. And I have to use serial to flash other firmware.
> > > > > >
> > > > > > --
> > > > > > Xiaofan
> > > > > >
> > > > > >
> > > > >
> > > > > --
> > > > > Sutton Mehaffey
> > > > > Lookout Portable Security
> > > > > 4040 Royal Dr.
> > > > > Kennesaw, GA 30144
> > > > > 770-514-7999, 800-207-6269
> > > > > Fax: 770-514-1285
> > > > > http://www.lookoutportablesecurity.com
> > > > > sutton@
> > > > >
> > > >
> > > >
> > >
> > > --
> > > Sutton Mehaffey
> > > Lookout Portable Security
> > > 4040 Royal Dr.
> > > Kennesaw, GA 30144
> > > 770-514-7999, 800-207-6269
> > > Fax: 770-514-1285
> > > http://www.lookoutportablesecurity.com
> > > sutton@
> > >
> >
> > --
> Sutton Mehaffey
> Lookout Portable Security
> 4040 Royal Dr.
> Kennesaw, GA 30144
> 770-514-7999, 800-207-6269
> Fax: 770-514-1285
> http://www.lookoutportablesecurity.com
> sutton@...
>

An Engineer's Guide to the LPC2100 Series

Il 15/10/2010 15.48, simonb65 ha scritto:
In my experience this happened for errata PLL programming (wrong
frequency too high). When I had the problem I tryed to execute a minimum
main() without any register programmed (only startup and an infinite
loop toggling a bit for minimum debug) and it worked, so after little
investigation I confined the error in PLL setup. Check maximum frequency
output of PLL of 2148 and check also errata regarding PLL, it would be
the 1st thing to check.
>
>
> Sutton,
>
> ...Also, if you program in PLL multiplier/divider values that put the
> core clock outside the specified limits, that also has the same
> symptoms as you are describing as the ISP sets it's clock up as it
> needs it and the JTAG relies on your settings!
>
> Simon.
>
> --- In l... ,
> Sutton Mehaffey wrote:
> >
> > My application code (which includes a custom bootloader) doesn't set
> the
> > protect bits. And, I'm certain the VirtualCOM demo code doesn't set
> > those bits. I can erase the entire chip serially and reprogram serially
> > and code I want to, but JTAG still locked.
> >
> >
> >
> > On 10/15/2010 9:41 AM, simonb65 wrote:
> > >
> > >
> > > Sutton,
> > >
> > > It sound like the code you are programming in has the code protect
> bits
> > > set !! Once you set these, all JTAG operations are blocked and only an
> > > Erase and re-flash via ISP are possible. The bootloader is
> designed like
> > > that to prevent your code from being reverse engineered or copied !!
> > >
> > > It used to catch me out every time 'till I read the manual!
> > >
> > > Simon.
> > >
> > > --- In l...
> ,
> > > Sutton Mehaffey wrote:
> > > >
> > > > I can't imagine that we 3 are the only ones that continually have
> > > > problems with the JTAG. There must be a unknown hardware issue
> that is
> > > > preventing JTAG from working. I've always been able to 'unlock' the
> > > > JTAG by serial programming. But, starting yesterday, after
> loading the
> > > > VirtualCOM example under Files section into my prototype board,
> my board
> > > > became unresponsive to JTAG. I can still program my code or the
> > > > VirtualCOM code into the board serially. I have my CPU socketed. 3
> > > > different CPUs that still have valid code and were recently
> programmed
> > > > by JTAG no longer are programmable by JTAG either.
> > > >
> > > >
> > > >
> > > > On 10/14/2010 11:04 PM, Xiaofan Chen wrote:
> > > > >
> > > > >
> > > > > On Fri, Oct 15, 2010 at 7:22 AM, Michael Freeman
> > > > > > wrote:
> > > > > > There are some memory/register locations that if written to will
> > > cause
> > > > > > the JTAG to stop working. Make sure your firmware does not
> have any
> > > > > > bugs that can hit those addresses.
> > > > >
> > > > > On a related note, I've never been able to use Jtag (OpenOCD)
> > > > > after flashing JCWren's example. Serial (lpc21isp)
> > > > > works fine. It is still a mystery.
> > > > >
> > > > > JCwren's example
> > > > > http://www.jcwren.com/arm/
> > > > >
> > > > > You can use lpc21isp (serial) or OpenOCD (Jtag) to flash the
> firmware.
> > > > > Then after that, you will not be able to communicate with the chip
> > > using
> > > > > OpenOCD/Jtag. And I have to use serial to flash other firmware.
> > > > >
> > > > > --
> > > > > Xiaofan
> > > > >
> > > > >
> > > >
> > > > --
> > > > Sutton Mehaffey
> > > > Lookout Portable Security
> > > > 4040 Royal Dr.
> > > > Kennesaw, GA 30144
> > > > 770-514-7999, 800-207-6269
> > > > Fax: 770-514-1285
> > > > http://www.lookoutportablesecurity.com
> > > > sutton@
> > > >
> > >
> > >
> >
> > --
> > Sutton Mehaffey
> > Lookout Portable Security
> > 4040 Royal Dr.
> > Kennesaw, GA 30144
> > 770-514-7999, 800-207-6269
> > Fax: 770-514-1285
> > http://www.lookoutportablesecurity.com
> > sutton@...
> >
--- In l..., Sutton Mehaffey wrote:
>
> I can't imagine that we 3 are the only ones that continually have
> problems with the JTAG. There must be a unknown hardware issue that is
> preventing JTAG from working. I've always been able to 'unlock' the
> JTAG by serial programming. But, starting yesterday, after loading the
> VirtualCOM example under Files section into my prototype board, my board
> became unresponsive to JTAG. I can still program my code or the
> VirtualCOM code into the board serially. I have my CPU socketed. 3
> different CPUs that still have valid code and were recently programmed
> by JTAG no longer are programmable by JTAG either.

Add me to your list. That makes 4.

I have to use ISP and fully erase the parts some times (LPC2366) even though the CRP is not set. Not too often anymore.

Also, I have to reboot the computer some times just to reset the USB windoze XP USB drivers etc. I am Using Segger J-Link and IAR EWARM.
The latest Segger USB drivers work better but still not fool proof.

I really wish there was a way to reset all of the USB hubs and drivers without having to reboot windoze.

boB

--- In l..., "bobtransformer" wrote:
>
> I really wish there was a way to reset all of the USB hubs and drivers without having to reboot windoze.
>
> boB
>

Have you tried Device Manager -> Scan For Changes? I'm not sure how much resetting occurs but it should cause complete enumeration of the USB buses.

Richard

--- In l..., "rtstofer" wrote:
>
> --- In l..., "bobtransformer" wrote:
> >
> > I really wish there was a way to reset all of the USB hubs and drivers without having to reboot windoze.
> >
> > boB
> > Have you tried Device Manager -> Scan For Changes? I'm not sure how much resetting occurs but it should cause complete enumeration of the USB buses.
>
> Richard
>

Thanks Richard ! Of course, it hasn't screwed up today but I will
try this as soon as it happens again.

Also, I sometimes get the message that it can not find the JTAG part
just like it does when code protected, but usually just putting it
in ISP boot mode will let the JTAG programming continue...

No programming needed, usually, just setting it in that mode sometimes gets it to go. More FYI for whoever.

boB

It's not the PLL. In my app code, I don't use the PLL at all unless I
use USB. I have a 12Mhz crystal and that's all the speed I need. So,
in normal operation the PLL is off.

If I could get the JTAG back, I could try other things to isolate
possible problems.

On 10/15/2010 2:36 PM, M. Manca wrote:
> Il 15/10/2010 15.48, simonb65 ha scritto:
> In my experience this happened for errata PLL programming (wrong
> frequency too high). When I had the problem I tryed to execute a minimum
> main() without any register programmed (only startup and an infinite
> loop toggling a bit for minimum debug) and it worked, so after little
> investigation I confined the error in PLL setup. Check maximum frequency
> output of PLL of 2148 and check also errata regarding PLL, it would be
> the 1st thing to check.
>
>> Sutton,
>>
>> ...Also, if you program in PLL multiplier/divider values that put the
>> core clock outside the specified limits, that also has the same
>> symptoms as you are describing as the ISP sets it's clock up as it
>> needs it and the JTAG relies on your settings!
>>
>> Simon.
>>
>> --- In l... ,
>> Sutton Mehaffey wrote:
>> >
>> > My application code (which includes a custom bootloader) doesn't set
>> the
>> > protect bits. And, I'm certain the VirtualCOM demo code doesn't set
>> > those bits. I can erase the entire chip serially and reprogram serially
>> > and code I want to, but JTAG still locked.
>> >
>> >
>> >
>> > On 10/15/2010 9:41 AM, simonb65 wrote:
>> > >
>> > >
>> > > Sutton,
>> > >
>> > > It sound like the code you are programming in has the code protect
>> bits
>> > > set !! Once you set these, all JTAG operations are blocked and only an
>> > > Erase and re-flash via ISP are possible. The bootloader is
>> designed like
>> > > that to prevent your code from being reverse engineered or copied !!
>> > >
>> > > It used to catch me out every time 'till I read the manual!
>> > >
>> > > Simon.
>> > >
>> > > --- In l...
>> ,
>> > > Sutton Mehaffey wrote:
>> > > >
>> > > > I can't imagine that we 3 are the only ones that continually have
>> > > > problems with the JTAG. There must be a unknown hardware issue
>> that is
>> > > > preventing JTAG from working. I've always been able to 'unlock' the
>> > > > JTAG by serial programming. But, starting yesterday, after
>> loading the
>> > > > VirtualCOM example under Files section into my prototype board,
>> my board
>> > > > became unresponsive to JTAG. I can still program my code or the
>> > > > VirtualCOM code into the board serially. I have my CPU socketed. 3
>> > > > different CPUs that still have valid code and were recently
>> programmed
>> > > > by JTAG no longer are programmable by JTAG either.
>> > > >
>> > > >
>> > > >
>> > > > On 10/14/2010 11:04 PM, Xiaofan Chen wrote:
>> > > > >
>> > > > >
>> > > > > On Fri, Oct 15, 2010 at 7:22 AM, Michael Freeman
>> > > > > > wrote:
>> > > > > > There are some memory/register locations that if written to will
>> > > cause
>> > > > > > the JTAG to stop working. Make sure your firmware does not
>> have any
>> > > > > > bugs that can hit those addresses.
>> > > > >
>> > > > > On a related note, I've never been able to use Jtag (OpenOCD)
>> > > > > after flashing JCWren's example. Serial (lpc21isp)
>> > > > > works fine. It is still a mystery.
>> > > > >
>> > > > > JCwren's example
>> > > > > http://www.jcwren.com/arm/
>> > > > >
>> > > > > You can use lpc21isp (serial) or OpenOCD (Jtag) to flash the
>> firmware.
>> > > > > Then after that, you will not be able to communicate with the chip
>> > > using
>> > > > > OpenOCD/Jtag. And I have to use serial to flash other firmware.
>> > > > >
>> > > > > --
>> > > > > Xiaofan
>> > > > >
>> > > > >
>> > > >
>> > > > --
>> > > > Sutton Mehaffey
>> > > > Lookout Portable Security
>> > > > 4040 Royal Dr.
>> > > > Kennesaw, GA 30144
>> > > > 770-514-7999, 800-207-6269
>> > > > Fax: 770-514-1285
>> > > > http://www.lookoutportablesecurity.com
>> > > > sutton@
>> > > >
>> > >
>> > >
>> >
>> > --
>> > Sutton Mehaffey
>> > Lookout Portable Security
>> > 4040 Royal Dr.
>> > Kennesaw, GA 30144
>> > 770-514-7999, 800-207-6269
>> > Fax: 770-514-1285
>> > http://www.lookoutportablesecurity.com
>> > sutton@...
>> >
>>

--
Sutton Mehaffey
Lookout Portable Security
4040 Royal Dr.
Kennesaw, GA 30144
770-514-7999, 800-207-6269
Fax: 770-514-1285
http://www.lookoutportablesecurity.com
s...@lookoutportablesecurity.com

I've tried rebooting, ISP numerous times, changing CPUs - nothing
unlocks the JTAG. The JTAG can program a demo Keil board, so that's not
the issue. I have someone bringing in a ULINK2 to try. Not optimistic
about that either. I wish 'JTAG Comm. Failure' would be more specific.

Sutton

On 10/16/2010 4:25 PM, bobtransformer wrote:
> --- In l... ,
> Sutton Mehaffey wrote:
> >
> > I can't imagine that we 3 are the only ones that continually have
> > problems with the JTAG. There must be a unknown hardware issue that is
> > preventing JTAG from working. I've always been able to 'unlock' the
> > JTAG by serial programming. But, starting yesterday, after loading the
> > VirtualCOM example under Files section into my prototype board, my board
> > became unresponsive to JTAG. I can still program my code or the
> > VirtualCOM code into the board serially. I have my CPU socketed. 3
> > different CPUs that still have valid code and were recently programmed
> > by JTAG no longer are programmable by JTAG either.
> >
> > Add me to your list. That makes 4.
>
> I have to use ISP and fully erase the parts some times (LPC2366) even
> though the CRP is not set. Not too often anymore.
>
> Also, I have to reboot the computer some times just to reset the USB
> windoze XP USB drivers etc. I am Using Segger J-Link and IAR EWARM.
> The latest Segger USB drivers work better but still not fool proof.
>
> I really wish there was a way to reset all of the USB hubs and drivers
> without having to reboot windoze.
>
> boB

--
Sutton Mehaffey
Lookout Portable Security
4040 Royal Dr.
Kennesaw, GA 30144
770-514-7999, 800-207-6269
Fax: 770-514-1285
http://www.lookoutportablesecurity.com
s...@lookoutportablesecurity.com

Hi Sutton,

IMHO, if 'JTAG commucation failure' appears:
1) The JTAG cannot stop the MCU:
- Check JTAG RESET (TRST) line. Make sure that it is connected to the LPC21xx.
- Enable 'Use Reset at Startup'
- The JTAG frequency is too low. Increase it's speed. For ARM7TDMI @72Mhz,
200kHz should be more than enough, but try until maximum to see whether it works
or not.

2) MCU is in reset state:
- Check MCU RESET line. It should be high (not in reset mode) when JTAG is
operating.

3) MCU is in power down mode
- Not sure about LPC2148..but I think the JTAG block will be powered off as
well if the main osc is turned off. Hence, the MCU cannot communicate with JTAG
during power down mode.

Another way to make your board communicate with JTAG again is by putting the MCU
into ISP mode (LPC2148: pull down P0.14 while applying RESET), then initiate the
JTAG debug session.I think you've tried using this method before, but by sending
the program using FlashMagic instead of JTAG after the MCU goes to ISP mode.

See whether it works for you. Hope that helps

Regards,
-daniel
----- Original Message ----
From: Sutton Mehaffey
To: l...
Sent: Tue, October 19, 2010 5:29:38 AM
Subject: Re: [lpc2000] Re: JTAG stopped communicating - LPC2148

I've tried rebooting, ISP numerous times, changing CPUs - nothing
unlocks the JTAG. The JTAG can program a demo Keil board, so that's not
the issue. I have someone bringing in a ULINK2 to try. Not optimistic
about that either. I wish 'JTAG Comm. Failure' would be more specific.

Sutton

On 10/16/2010 4:25 PM, bobtransformer wrote:
> --- In l... ,
> Sutton Mehaffey wrote:
> >
> > I can't imagine that we 3 are the only ones that continually have
> > problems with the JTAG. There must be a unknown hardware issue that is
> > preventing JTAG from working. I've always been able to 'unlock' the
> > JTAG by serial programming. But, starting yesterday, after loading the
> > VirtualCOM example under Files section into my prototype board, my board
> > became unresponsive to JTAG. I can still program my code or the
> > VirtualCOM code into the board serially. I have my CPU socketed. 3
> > different CPUs that still have valid code and were recently programmed
> > by JTAG no longer are programmable by JTAG either.
> >
> > Add me to your list. That makes 4.
>
> I have to use ISP and fully erase the parts some times (LPC2366) even
> though the CRP is not set. Not too often anymore.
>
> Also, I have to reboot the computer some times just to reset the USB
> windoze XP USB drivers etc. I am Using Segger J-Link and IAR EWARM.
> The latest Segger USB drivers work better but still not fool proof.
>
> I really wish there was a way to reset all of the USB hubs and drivers
> without having to reboot windoze.
>
> boB

--
Sutton Mehaffey
Lookout Portable Security
4040 Royal Dr.
Kennesaw, GA 30144
770-514-7999, 800-207-6269
Fax: 770-514-1285
http://www.lookoutportablesecurity.com
s...@lookoutportablesecurity.com

Well, I got it working with another ULINK. My board programs fine.
However, the non-working one still programs a Keil demo board. Weird.

I tried 100kHZ, 200kHZ, and 1MHz, but it still doesn't work.
TRST is high and is connected to LPC.
'Use Reset at Startup' is enabled.

MCU Reset is high.

Even in ISP mode, JTAG doesn't work, but serial programming does.

So, the non-working ULINK must be toast, even though it programs other
boards. Strange.

Sutton

On 10/19/2010 3:47 AM, Daniel Widyanto wrote:
> Hi Sutton,
>
> IMHO, if 'JTAG commucation failure' appears:
> 1) The JTAG cannot stop the MCU:
> - Check JTAG RESET (TRST) line. Make sure that it is connected to the
> LPC21xx.
> - Enable 'Use Reset at Startup'
> - The JTAG frequency is too low. Increase it's speed. For ARM7TDMI @72Mhz,
> 200kHz should be more than enough, but try until maximum to see whether
> it works
> or not.
>
> 2) MCU is in reset state:
> - Check MCU RESET line. It should be high (not in reset mode) when JTAG is
> operating.
>
> 3) MCU is in power down mode
> - Not sure about LPC2148..but I think the JTAG block will be powered off as
> well if the main osc is turned off. Hence, the MCU cannot communicate
> with JTAG
> during power down mode.
>
> Another way to make your board communicate with JTAG again is by putting
> the MCU
> into ISP mode (LPC2148: pull down P0.14 while applying RESET), then
> initiate the
> JTAG debug session.I think you've tried using this method before, but by
> sending
> the program using FlashMagic instead of JTAG after the MCU goes to ISP mode.
>
> See whether it works for you. Hope that helps
>
> Regards,
> -daniel
>
> ----- Original Message ----
> From: Sutton Mehaffey > >
> To: l...
> Sent: Tue, October 19, 2010 5:29:38 AM
> Subject: Re: [lpc2000] Re: JTAG stopped communicating - LPC2148
>
> I've tried rebooting, ISP numerous times, changing CPUs - nothing
> unlocks the JTAG. The JTAG can program a demo Keil board, so that's not
> the issue. I have someone bringing in a ULINK2 to try. Not optimistic
> about that either. I wish 'JTAG Comm. Failure' would be more specific.
>
> Sutton
>
> On 10/16/2010 4:25 PM, bobtransformer wrote:
> >
> >
> >
> >
> > --- In l...
> ,
> > Sutton Mehaffey wrote:
> > >
> > > I can't imagine that we 3 are the only ones that continually have
> > > problems with the JTAG. There must be a unknown hardware issue that is
> > > preventing JTAG from working. I've always been able to 'unlock' the
> > > JTAG by serial programming. But, starting yesterday, after loading the
> > > VirtualCOM example under Files section into my prototype board, my
> board
> > > became unresponsive to JTAG. I can still program my code or the
> > > VirtualCOM code into the board serially. I have my CPU socketed. 3
> > > different CPUs that still have valid code and were recently programmed
> > > by JTAG no longer are programmable by JTAG either.
> > >
> > >
> >
> > Add me to your list. That makes 4.
> >
> > I have to use ISP and fully erase the parts some times (LPC2366) even
> > though the CRP is not set. Not too often anymore.
> >
> > Also, I have to reboot the computer some times just to reset the USB
> > windoze XP USB drivers etc. I am Using Segger J-Link and IAR EWARM.
> > The latest Segger USB drivers work better but still not fool proof.
> >
> > I really wish there was a way to reset all of the USB hubs and drivers
> > without having to reboot windoze.
> >
> > boB
> >
> > --
> Sutton Mehaffey
> Lookout Portable Security
> 4040 Royal Dr.
> Kennesaw, GA 30144
> 770-514-7999, 800-207-6269
> Fax: 770-514-1285
> http://www.lookoutportablesecurity.com
> s...@lookoutportablesecurity.com
>