EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

lpc2148 prototype problem with JTAG (ULINK- Keil)

Started by zahovic April 14, 2008
Hello,
I' ve just assembled a board with a LPC2148 and i can't connect with
ULINK and Keil.

I can download software using internal bootloader and com0 (p0.14
pulldown) with LPC210x_ISP utility.

i have a prototype board from Olimex, and i can download software in
both modes (ISP and JTAG), so my ulink is working. But on my own
prototype when i try to download, keil shows a message: "no jtag devices
found".

I've put pullups and pulldowns like Olimex schematic for JTAG signals. I
put a jumper to RTCK to pulldown. All pulldown and pullup of 10k value.
I've tried several LPC2148 on my board and never work jtag connection.
P0.31 is pullup also (in manual say it).

Differences from my own board and olimex board when a i use or not the
jumper:
OLIMEX:
- No use jumper of RTCK (no use jtag): TDO and TDI has 3.3V
- Use jumper of RTCK (activate jtag signals): TDO <0.5V and TDI has 3.3V
MY OWN BOARD:
- TDO is always <0.5V and TDI always 3.3V (no difference using or not
jumper on RTCK).

I think PINSEL2 register has nothing to here, isn't it? I can disable
JTAG in my code (if i write this register), but if i put a pulldown on
P0.14 to run bootloader instead my code, PINSEL2 is not modified.
PINSEL2 is reseted on every reset, or his value is saved on any flash
location?
Anyway i tried to put bit 2 of PINSEL2 to '1' (to operate pins as
debugger), and nothing changed.

What problem can it have my design? is very similar to olimex schematic.
The useful part of the board is this:
http://img240.imageshack.us/img240/972/lpc2148vk4.jpg

Also i've tried to slow the jtag clock on Keil debug configuration menu.

Kind regards. Dani.

An Engineer's Guide to the LPC2100 Series

--- In l..., zahovic wrote:
>
> Hello,
> I' ve just assembled a board with a LPC2148 and i can't connect with
> ULINK and Keil.
>
> I can download software using internal bootloader and com0 (p0.14
> pulldown) with LPC210x_ISP utility.
>
> i have a prototype board from Olimex, and i can download software in
> both modes (ISP and JTAG), so my ulink is working. But on my own
> prototype when i try to download, keil shows a message: "no jtag
devices
> found".
>

I recently had a similar problem but on a 2138, like you :-

1. I could load and run via the bootloader.
2. But I got the "no Jtag devices found" message.

I had two 2138's pcb's giving identical results, although one of them
had been used before on Jtag without problem.

In the end the solution turned out to be that I used the program
"Flash magic" and completely erased the Flash. After this both devices
started to be identified by ulink jtag and now work fine.

Today one of them stopped working again. So I repeated the Flash Magic
treatment and it fixed it. So there does seem to be some connection
between whats in Flash and Jtag working. Maybe someone can explain?
--- In l..., "grahamg227" wrote:

> I recently had a similar problem but on a 2138, like you :-
>
> 1. I could load and run via the bootloader.
> 2. But I got the "no Jtag devices found" message.
>
> I had two 2138's pcb's giving identical results, although one of them
> had been used before on Jtag without problem.
>
> In the end the solution turned out to be that I used the program
> "Flash magic" and completely erased the Flash. After this both devices
> started to be identified by ulink jtag and now work fine.
>
> Today one of them stopped working again. So I repeated the Flash Magic
> treatment and it fixed it. So there does seem to be some connection
> between whats in Flash and Jtag working. Maybe someone can explain?

First thing that comes to mind is CRP, but with CRP it's "all or
nothing", i.e.
the JTAG should always work or never work if it's the CRP that's in play.

Also you shouldn't be able to re-program via the bootloader without
first erasing the chip if CRP is the culprit.

Do you have CRP enabled?
I had a similar experience with the 2138, where the original designer
of the board wired the P0.31 pin for use as a bidirectional IO pin,
and it was being loaded by another device connected on the net. It
is unclear from the portion of your schematic that you show what is
connected to that pin, but if it is being loaded in some way it could
be interfering with the JTAG.

Mark

--- In l..., zahovic wrote:
>
> Hello,
> I' ve just assembled a board with a LPC2148 and i can't connect
with
> ULINK and Keil.
>
> I can download software using internal bootloader and com0 (p0.14
> pulldown) with LPC210x_ISP utility.
>
> i have a prototype board from Olimex, and i can download software
in
> both modes (ISP and JTAG), so my ulink is working. But on my own
> prototype when i try to download, keil shows a message: "no jtag
devices
> found".
>
> I've put pullups and pulldowns like Olimex schematic for JTAG
signals. I
> put a jumper to RTCK to pulldown. All pulldown and pullup of 10k
value.
> I've tried several LPC2148 on my board and never work jtag
connection.
> P0.31 is pullup also (in manual say it).
>
> Differences from my own board and olimex board when a i use or not
the
> jumper:
> OLIMEX:
> - No use jumper of RTCK (no use jtag): TDO and TDI has 3.3V
> - Use jumper of RTCK (activate jtag signals): TDO <0.5V and TDI has
3.3V
> MY OWN BOARD:
> - TDO is always <0.5V and TDI always 3.3V (no difference using or
not
> jumper on RTCK).
>
> I think PINSEL2 register has nothing to here, isn't it? I can
disable
> JTAG in my code (if i write this register), but if i put a pulldown
on
> P0.14 to run bootloader instead my code, PINSEL2 is not modified.
> PINSEL2 is reseted on every reset, or his value is saved on any
flash
> location?
> Anyway i tried to put bit 2 of PINSEL2 to '1' (to operate pins as
> debugger), and nothing changed.
>
> What problem can it have my design? is very similar to olimex
schematic.
> The useful part of the board is this:
> http://img240.imageshack.us/img240/972/lpc2148vk4.jpg
>
> Also i've tried to slow the jtag clock on Keil debug configuration
menu.
>
> Kind regards. Dani.
>

>
> Also you shouldn't be able to re-program via the bootloader without
> first erasing the chip if CRP is the culprit.
>
> Do you have CRP enabled?
>

CRP (code read protection?) No, I see the option in Flash Magic it's
turned off. I haven't looked to see if it's a Keil option. But I don't
believe that it is turned on. When this problem showed I used the Keil
Blinky got it working via the bootloader to prove the 2138 wasn't
dead. Then later after discovering the Flash Magic trick, with the
Ulink Jtag setup.

First, thanks for all your comments. I have not solved this problem yet.

grahamg227:
" In the end the solution turned out to be that I used the program
"Flash magic" and completely erased the Flash. After this both devices
started to be identified by ulink jtag and now work fine."
- Before this comment, i was use Flash utility fro NXP. Now i've tried
with Flash magic and nothing changes. I've erase all flash + disable
code protect, but i can't connect with jtag yet: "no jtag devices found".
I've repeat the same steps in olimex board and my own board: erase all
flash and download a simple code hex. All perfect, all working. But i
can't connect with jtag on my own board, and i can connect on olimx board.

noltstein:"Do you have CRP enabled?"
-It's disable. I've never enabled. Anyway, i've tried to erase all flash
and disable code protection with flash magic.

mehiegl:"I had a similar experience with the 2138, where the original
designer
of the board wired the P0.31 pin for use as a bidirectional IO pin,
and it was being loaded by another device connected on the net. It
is unclear from the portion of your schematic that you show what is
connected to that pin, but if it is being loaded in some way it could
be interfering with the JTAG."
- Yes, the initial schematic hasn't got a pullup on p0.31. You're rigth.
But manually i soldered a pullup on my board when i assembled, so
actually exists this pullup on real board (not shown on schematic).

I bought 4 LPC2148 from Mouser. I doubt these micro were bad, but i've
order a few from other buyer to test.

Any idea?

grahamg227 escribi
>
> --- In l... ,
> zahovic wrote:
> >
> > Hello,
> > I' ve just assembled a board with a LPC2148 and i can't connect with
> > ULINK and Keil.
> >
> > I can download software using internal bootloader and com0 (p0.14
> > pulldown) with LPC210x_ISP utility.
> >
> > i have a prototype board from Olimex, and i can download software in
> > both modes (ISP and JTAG), so my ulink is working. But on my own
> > prototype when i try to download, keil shows a message: "no jtag
> devices
> > found".
> > I recently had a similar problem but on a 2138, like you :-
>
> 1. I could load and run via the bootloader.
> 2. But I got the "no Jtag devices found" message.
>
> I had two 2138's pcb's giving identical results, although one of them
> had been used before on Jtag without problem.
>
> In the end the solution turned out to be that I used the program
> "Flash magic" and completely erased the Flash. After this both devices
> started to be identified by ulink jtag and now work fine.
>
> Today one of them stopped working again. So I repeated the Flash Magic
> treatment and it fixed it. So there does seem to be some connection
> between whats in Flash and Jtag working. Maybe someone can explain?
>
> __________ Informaci de NOD32 1.532 (20031010) __________
>
> Este mensaje ha sido analizado con NOD32 Antivirus System
> http://www.nod32.com
I don't think I said what I wanted to say clearly at first. My point
was that unless you want to use P0.31 as an output it should be left
unconnected. It is an output only, not bidirectional like most of
the other pins. It's probably ok that you added a pull-up, but my
question was about where else is it connected. The portion of the
schematic you showed appears to have some net associated with the pin.

Mark
--- In l..., zahovic wrote:
>
> First, thanks for all your comments. I have not solved this problem
yet.
>
> grahamg227:
> " In the end the solution turned out to be that I used the program
> "Flash magic" and completely erased the Flash. After this both
devices
> started to be identified by ulink jtag and now work fine."
> - Before this comment, i was use Flash utility fro NXP. Now i've
tried
> with Flash magic and nothing changes. I've erase all flash +
disable
> code protect, but i can't connect with jtag yet: "no jtag devices
found".
> I've repeat the same steps in olimex board and my own board: erase
all
> flash and download a simple code hex. All perfect, all working. But
i
> can't connect with jtag on my own board, and i can connect on olimx
board.
>
> noltstein:"Do you have CRP enabled?"
> -It's disable. I've never enabled. Anyway, i've tried to erase all
flash
> and disable code protection with flash magic.
>
> mehiegl:"I had a similar experience with the 2138, where the
original
> designer
> of the board wired the P0.31 pin for use as a bidirectional IO pin,
> and it was being loaded by another device connected on the net. It
> is unclear from the portion of your schematic that you show what is
> connected to that pin, but if it is being loaded in some way it
could
> be interfering with the JTAG."
> - Yes, the initial schematic hasn't got a pullup on p0.31. You're
rigth.
> But manually i soldered a pullup on my board when i assembled, so
> actually exists this pullup on real board (not shown on schematic).
>
> I bought 4 LPC2148 from Mouser. I doubt these micro were bad, but
i've
> order a few from other buyer to test.
>
> Any idea?
>
> grahamg227 escribi
> >
> > --- In l...
40yahoogroups.com>,
> > zahovic wrote:
> > >
> > > Hello,
> > > I' ve just assembled a board with a LPC2148 and i can't connect
with
> > > ULINK and Keil.
> > >
> > > I can download software using internal bootloader and com0
(p0.14
> > > pulldown) with LPC210x_ISP utility.
> > >
> > > i have a prototype board from Olimex, and i can download
software in
> > > both modes (ISP and JTAG), so my ulink is working. But on my own
> > > prototype when i try to download, keil shows a message: "no jtag
> > devices
> > > found".
> > >
> >
> > I recently had a similar problem but on a 2138, like you :-
> >
> > 1. I could load and run via the bootloader.
> > 2. But I got the "no Jtag devices found" message.
> >
> > I had two 2138's pcb's giving identical results, although one of
them
> > had been used before on Jtag without problem.
> >
> > In the end the solution turned out to be that I used the program
> > "Flash magic" and completely erased the Flash. After this both
devices
> > started to be identified by ulink jtag and now work fine.
> >
> > Today one of them stopped working again. So I repeated the Flash
Magic
> > treatment and it fixed it. So there does seem to be some
connection
> > between whats in Flash and Jtag working. Maybe someone can
explain?
> >
> >
> >
> > __________ Informaci de NOD32 1.532 (20031010) __________
> >
> > Este mensaje ha sido analizado con NOD32 Antivirus System
> > http://www.nod32.com
>

Hello mehiegl,

this net was connected to the base of a npn transistor to activate a
rele. But on the board i'm testing now, i have not assembled this
transistor, and assembled a pullup on this net (p0.31). So in real
board, there is nothing connected to this pin, only a pullup.
Yes, you're rigth, this pin is only out. You only have to be sure is not
pulldown after reset, so jtag is not disable.
Anyway i'll eliminate this pullup to left it unconnected and try again,
but i think this will be not the problem, because olimex has a resitor
to 3.3V on this pin.
Thanks.

mehiegl escribi
>
> I don't think I said what I wanted to say clearly at first. My point
> was that unless you want to use P0.31 as an output it should be left
> unconnected. It is an output only, not bidirectional like most of
> the other pins. It's probably ok that you added a pull-up, but my
> question was about where else is it connected. The portion of the
> schematic you showed appears to have some net associated with the pin.
>
> Mark
> --- In l... ,
> zahovic wrote:
> >
> > First, thanks for all your comments. I have not solved this problem
> yet.
> >
> > grahamg227:
> > " In the end the solution turned out to be that I used the program
> > "Flash magic" and completely erased the Flash. After this both
> devices
> > started to be identified by ulink jtag and now work fine."
> > - Before this comment, i was use Flash utility fro NXP. Now i've
> tried
> > with Flash magic and nothing changes. I've erase all flash +
> disable
> > code protect, but i can't connect with jtag yet: "no jtag devices
> found".
> > I've repeat the same steps in olimex board and my own board: erase
> all
> > flash and download a simple code hex. All perfect, all working. But
> i
> > can't connect with jtag on my own board, and i can connect on olimx
> board.
> >
> > noltstein:"Do you have CRP enabled?"
> > -It's disable. I've never enabled. Anyway, i've tried to erase all
> flash
> > and disable code protection with flash magic.
> >
> > mehiegl:"I had a similar experience with the 2138, where the
> original
> > designer
> > of the board wired the P0.31 pin for use as a bidirectional IO pin,
> > and it was being loaded by another device connected on the net. It
> > is unclear from the portion of your schematic that you show what is
> > connected to that pin, but if it is being loaded in some way it
> could
> > be interfering with the JTAG."
> > - Yes, the initial schematic hasn't got a pullup on p0.31. You're
> rigth.
> > But manually i soldered a pullup on my board when i assembled, so
> > actually exists this pullup on real board (not shown on schematic).
> >
> > I bought 4 LPC2148 from Mouser. I doubt these micro were bad, but
> i've
> > order a few from other buyer to test.
> >
> > Any idea?
> >
> > grahamg227 escribi
> > >
> > > --- In l...
> > 40yahoogroups.com>,
> > > zahovic wrote:
> > > >
> > > > Hello,
> > > > I' ve just assembled a board with a LPC2148 and i can't connect
> with
> > > > ULINK and Keil.
> > > >
> > > > I can download software using internal bootloader and com0
> (p0.14
> > > > pulldown) with LPC210x_ISP utility.
> > > >
> > > > i have a prototype board from Olimex, and i can download
> software in
> > > > both modes (ISP and JTAG), so my ulink is working. But on my own
> > > > prototype when i try to download, keil shows a message: "no jtag
> > > devices
> > > > found".
> > > >
> > >
> > > I recently had a similar problem but on a 2138, like you :-
> > >
> > > 1. I could load and run via the bootloader.
> > > 2. But I got the "no Jtag devices found" message.
> > >
> > > I had two 2138's pcb's giving identical results, although one of
> them
> > > had been used before on Jtag without problem.
> > >
> > > In the end the solution turned out to be that I used the program
> > > "Flash magic" and completely erased the Flash. After this both
> devices
> > > started to be identified by ulink jtag and now work fine.
> > >
> > > Today one of them stopped working again. So I repeated the Flash
> Magic
> > > treatment and it fixed it. So there does seem to be some
> connection
> > > between whats in Flash and Jtag working. Maybe someone can
> explain?
> > >
> > >
> > >
> > > __________ Informaci de NOD32 1.532 (20031010) __________
> > >
> > > Este mensaje ha sido analizado con NOD32 Antivirus System
> > > http://www.nod32.com
> > __________ Informaci de NOD32 1.532 (20031010) __________
>
> Este mensaje ha sido analizado con NOD32 Antivirus System
> http://www.nod32.com
Funnily enough we've just started having very similar problems!

We have five LPCs in a chain with two CPLDs and it's been working well
for a few days now.

All of a sudden we end up with problems whereby the JTAG targets are
no longer responding. When we check the processors we find that some
of them are no longer outputing on TDO and that it's gone tri-state.

We don't have ISP on board yet (still waiting to program the CPLDs for
that functionality to be enabled) so we replaced the two "faulty"
micros this morning - which fixed everything. Then just now we've got
THREE micros that have tri-stated TDOs but that the other two are fine.

We've only ever been debugging code on one device so far. The other
four LPCs in that chain have not been touched - except to add custom
'blinky' code on many days ago. Since then they haven't been
addressed by JTAG.

This just seems very similar to the problem experienced in this thread.

Any ideas what the heck is going on?

--- In l..., "grahamg227" wrote:
>
> --- In l..., zahovic wrote:
> >
> > Hello,
> > I' ve just assembled a board with a LPC2148 and i can't connect with
> > ULINK and Keil.
> >
> > I can download software using internal bootloader and com0 (p0.14
> > pulldown) with LPC210x_ISP utility.
> >
> > i have a prototype board from Olimex, and i can download software in
> > both modes (ISP and JTAG), so my ulink is working. But on my own
> > prototype when i try to download, keil shows a message: "no jtag
> devices
> > found".
> > I recently had a similar problem but on a 2138, like you :-
>
> 1. I could load and run via the bootloader.
> 2. But I got the "no Jtag devices found" message.
>
> I had two 2138's pcb's giving identical results, although one of them
> had been used before on Jtag without problem.
>
> In the end the solution turned out to be that I used the program
> "Flash magic" and completely erased the Flash. After this both devices
> started to be identified by ulink jtag and now work fine.
>
> Today one of them stopped working again. So I repeated the Flash Magic
> treatment and it fixed it. So there does seem to be some connection
> between whats in Flash and Jtag working. Maybe someone can explain?
>

Another question,

Should the JTAG scan chain be blocked by a device with CRP enabled?
Surely if you have multiple devices in a scan chain, setting CRP for
one of them shouldn't disable debug of the other ones (as a result of
not passing through TDI->TDO)... does it?

--- In l..., "Darcy" wrote:
>
> Funnily enough we've just started having very similar problems!
>
> We have five LPCs in a chain with two CPLDs and it's been working well
> for a few days now.
>
> All of a sudden we end up with problems whereby the JTAG targets are
> no longer responding. When we check the processors we find that some
> of them are no longer outputing on TDO and that it's gone tri-state.
>
> We don't have ISP on board yet (still waiting to program the CPLDs for
> that functionality to be enabled) so we replaced the two "faulty"
> micros this morning - which fixed everything. Then just now we've got
> THREE micros that have tri-stated TDOs but that the other two are
fine.
>
> We've only ever been debugging code on one device so far. The other
> four LPCs in that chain have not been touched - except to add custom
> 'blinky' code on many days ago. Since then they haven't been
> addressed by JTAG.
>
> This just seems very similar to the problem experienced in this thread.
>
> Any ideas what the heck is going on?

The 2024 Embedded Online Conference