EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

JTAG stopped communicating - LPC2148

Started by Sutton Mehaffey October 14, 2010
Anyone ever had mysterious Comm failures with JTAG after long periods of
being able to program successfully? I haven't had one in about 9
months, but usually reprogramming via serial port cures the problem. I
have one of these annoyances now, but I can still program serially 100%
of the time, but JTAG still doesn't work.

I've:

1. changed and programmed 3 different CPUs serially, but JTAG still
doesn't work on any of them (which used to as recent as yesterday).
2. JTAG works fine on a demo board.
3. The 4 pullups and 2 pulldown resistors seem OK on the JTAG connector.
4. P0.31 is high. P1.26 is low.
5. I've tried pulling P0.14 low, getting into the bootloader, and
erasing the chip. Still doesn't work. Almost the same as serial
programming.

What else should I check?
--
Sutton

An Engineer's Guide to the LPC2100 Series

I've had that happen, but have never found a fix. One worked after cleaning
the board again.

Like you, I can program via the serial bootloader.

DaveS

On Thu, Oct 14, 2010 at 1:31 PM, Sutton Mehaffey <
s...@lookoutportablesecurity.com> wrote:

> Anyone ever had mysterious Comm failures with JTAG after long periods of
> being able to program successfully? I haven't had one in about 9
> months, but usually reprogramming via serial port cures the problem. I
> have one of these annoyances now, but I can still program serially 100%
> of the time, but JTAG still doesn't work.
>
> I've:
>
> 1. changed and programmed 3 different CPUs serially, but JTAG still
> doesn't work on any of them (which used to as recent as yesterday).
> 2. JTAG works fine on a demo board.
> 3. The 4 pullups and 2 pulldown resistors seem OK on the JTAG connector.
> 4. P0.31 is high. P1.26 is low.
> 5. I've tried pulling P0.14 low, getting into the bootloader, and
> erasing the chip. Still doesn't work. Almost the same as serial
> programming.
>
> What else should I check?
> --
> Sutton
>
>
>
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.

Michael Freeman
Principal Design Engineer
Update Systems, Inc.
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
David Smead
Sent: Thursday, October 14, 2010 3:59 PM
To: l...
Subject: Re: [lpc2000] JTAG stopped communicating - LPC2148

I've had that happen, but have never found a fix. One worked after
cleaning the board again.

Like you, I can program via the serial bootloader.
DaveS
On Thu, Oct 14, 2010 at 1:31 PM, Sutton Mehaffey
wrote:
Anyone ever had mysterious Comm failures with JTAG after long periods of
being able to program successfully? I haven't had one in about 9
months, but usually reprogramming via serial port cures the problem. I
have one of these annoyances now, but I can still program serially 100%
of the time, but JTAG still doesn't work.

I've:

1. changed and programmed 3 different CPUs serially, but JTAG still
doesn't work on any of them (which used to as recent as yesterday).
2. JTAG works fine on a demo board.
3. The 4 pullups and 2 pulldown resistors seem OK on the JTAG connector.
4. P0.31 is high. P1.26 is low.
5. I've tried pulling P0.14 low, getting into the bootloader, and
erasing the chip. Still doesn't work. Almost the same as serial
programming.

What else should I check?
--
Sutton
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
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
s...@lookoutportablesecurity.com

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@...
>

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
s...@lookoutportablesecurity.com

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@...
>

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
s...@lookoutportablesecurity.com

Hello Sutton,

perhaps check if it happens when you just load and execute the
code (without an USB cable). If there is no USB cable needed to
reproduce the problem, try to skip the USB interrupt routine.

Perhaps look for other parts of software which you can try to
skip / remove to narrow which parts of the software influences
JTAG.

Good luck !

Best regards,

Martin
--- 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@...
>


The 2024 Embedded Online Conference