EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Re: lpc 2138 read protection jtag

Started by Danish Ali July 1, 2008
That's the whole point.

With JTAG you would be able to read the FLASH
or download a new program that can read the FLASH.
So that would defeat read protection!

All you can do is erase everything by in-system programming
over the UART.

But. If you want to debug your own code that has
read-protection enabled, you can set bit 2 in PINSEL2
as an early step in your code. This will switch P1.31-26
back to JTAG use.
However processor reset will momentarily disable JTAG.
So you might have to "reconnect" the JTAG on every reset.
(Which is complicated because the JTAG programming cycle
probably involves reset!)

Regards,
Danish
--- In l..., "Lechner, Christian" wrote:
>
> Hello,
>
> I've activated the read protection on address 0x1FC. It functions, but
> also disables the JTAG. Now I cannot
> Flash via ULINK uVision. I'm searching for a possibility to reactivate
> the JTAG again. The flash can be erased, of course.
>
> Thanks for your help.
>
> Sincerely
>
> Christian Lechner

An Engineer's Guide to the LPC2100 Series

Okay, I'm going to jump in on this one :)

So setting bit 2 of PINSEL2 enables the debug port - but wouldn't this
also enable reading of Flash memory even if you have CRP enabled?

The reason I'm interested in this is that we have 12 LPC2103 and
2136's in a JTAG scan chain and once you've programmed one with CRP it
locks out the ability to program/debug the other 11! How retarded is
that. You would think it would still allow JTAG pass-through so that
you can access the other devices in the scan chain.

Anyway, I'm wondering if I might be able to use this to get around our
little problem - just concerned that since the program you're debuging
can access Flash, won't the debugger be able to as well?

Thanks
Darcy
--- In l..., "Danish Ali" wrote:
>
> That's the whole point.
>
> With JTAG you would be able to read the FLASH
> or download a new program that can read the FLASH.
> So that would defeat read protection!
>
> All you can do is erase everything by in-system programming
> over the UART.
>
> But. If you want to debug your own code that has
> read-protection enabled, you can set bit 2 in PINSEL2
> as an early step in your code. This will switch P1.31-26
> back to JTAG use.
> However processor reset will momentarily disable JTAG.
> So you might have to "reconnect" the JTAG on every reset.
> (Which is complicated because the JTAG programming cycle
> probably involves reset!)
>
> Regards,
> Danish
> --- In l..., "Lechner, Christian" wrote:
> >
> > Hello,
> >
> > I've activated the read protection on address 0x1FC. It functions, but
> > also disables the JTAG. Now I cannot
> > Flash via ULINK uVision. I'm searching for a possibility to reactivate
> > the JTAG again. The flash can be erased, of course.
> >
> > Thanks for your help.
> >
> > Sincerely
> >
> > Christian Lechner
>

Hallo
I set the read protect in software
This mean it will be set AFTER a reset of the unit.
One could possibly think to use this with approach
with an if statement checking an activation condition
(activate if jtag is not there)

I use GCC + LPC2378 and only update one card at a time!!

.org 0x01FC /* Copy protection.. This will waist about 476 Byte. */
/* .word 0x87654321 */ /* On */
.word 0x00000000 /* Off */

Regards
/Martin
--- In l..., "Darcy" wrote:
>
> Okay, I'm going to jump in on this one :)
>
> So setting bit 2 of PINSEL2 enables the debug port - but wouldn't this
> also enable reading of Flash memory even if you have CRP enabled?
>
> The reason I'm interested in this is that we have 12 LPC2103 and
> 2136's in a JTAG scan chain and once you've programmed one with CRP it
> locks out the ability to program/debug the other 11! How retarded is
> that. You would think it would still allow JTAG pass-through so that
> you can access the other devices in the scan chain.
>
> Anyway, I'm wondering if I might be able to use this to get around our
> little problem - just concerned that since the program you're debuging
> can access Flash, won't the debugger be able to as well?
>
> Thanks
> Darcy
> --- In l..., "Danish Ali" wrote:
> >
> > That's the whole point.
> >
> > With JTAG you would be able to read the FLASH
> > or download a new program that can read the FLASH.
> > So that would defeat read protection!
> >
> > All you can do is erase everything by in-system programming
> > over the UART.
> >
> > But. If you want to debug your own code that has
> > read-protection enabled, you can set bit 2 in PINSEL2
> > as an early step in your code. This will switch P1.31-26
> > back to JTAG use.
> > However processor reset will momentarily disable JTAG.
> > So you might have to "reconnect" the JTAG on every reset.
> > (Which is complicated because the JTAG programming cycle
> > probably involves reset!)
> >
> > Regards,
> > Danish
> > --- In l..., "Lechner, Christian"
wrote:
> > >
> > > Hello,
> > >
> > > I've activated the read protection on address 0x1FC. It
functions, but
> > > also disables the JTAG. Now I cannot
> > > Flash via ULINK uVision. I'm searching for a possibility to
reactivate
> > > the JTAG again. The flash can be erased, of course.
> > >
> > > Thanks for your help.
> > >
> > > Sincerely
> > >
> > > Christian Lechner
>

Memfault Beyond the Launch