Reply by "Andrew Kohlsmith (mailing lists account)" June 12, 20102010-06-12
On Saturday, June 12, 2010 02:15:49 am rtstofer wrote:
> If JTAG is available, there is no reason to use ISP. The User Manual
> describes both approaches to programming the flash.

I did not say that there was a reason to use ISP with JTAG. I said that I
could interrupt the ISP code with JTAG. I may have been mistaken and perhaps
it was the bootloader I was interrupting, but I've definitely interrupted the
processor executing code outside of normal mapped ROM and RAM out of boot.

> But either DEBUGSEL or P0.14 need to be low coming out of reset or the CPU
> will try to execute the existing code. If there is no code, the ISP
> loader will be unconditionally executed.

The bootloader is executed unconditionally. It is the bootloader which
calculates the checksum over the vector table in Flash to determine whether
there is valid code in Flash or not. I seem to remember some reverse
engineering efforts from university students to disassemble the ISP code.

> DEBUGSEL is usually controlled by the debug software but Olimex puts a
> pull-up resistor on the line for the situation where JTAG is not used.
> There is a jumper to pull the signal to ground when it is expected that
> JTAG will be used.

Agreed, except that your description of DEBUGSEL has the active level inverted
(at least on LPC2103, which is what I am familliar with); there is an internal
pull-down and you pull the pin high in order to override P0.27 through P0.31
function as JTAG.

-A.

An Engineer's Guide to the LPC2100 Series

Reply by davideciannamea June 12, 20102010-06-12
--- In l..., "rtstofer" wrote:
>
> --- In l..., "davideciannamea" wrote:
> >
> >
> >
> > --- In l..., "davideciannamea" wrote:
> > >
> > > Hello everyone. Can I enter in ISP mode with a JTAG ARM-USB-TINY (Olimex)??? My card is a LPC-P2148, Olimex, and work with Eclipse Ganymede OpenOCD. Thanks.
> > >
> > > Davide from Italy.
> > >
> >
> > From the manual, p0.14 is low, I connect it to GND, but in Eclipse, JTAG ARM-USB-TINY fails to load the program on the flash ram, why?
> >
> > ARM-USB-TINY: h--p://www.olimex.com/dev/arm-usb-tiny.html
> > LPC-P2148: h--p://www.olimex.com/dev/lpc-p2148.html
> >
> Because, if P0.14 is low coming out of reset, the chip invokes the boot loader and expects the .hex file to come in over the serial port. InSystem Programming - ISP.
>
> Your JTAG device programs the chip using, well, JTAG. This is a completely different scheme and P0.14 can NOT be low coming out of reset.
>
> Spend some time with the User Manual. Section 3.10 might be interesting as will Table 58 as related to P1.26/RTCK. Maybe the schematic here:
> http://www.olimex.com/dev/images/lpc-p2148-sch.gif
> as related to RTCK and the debug jumper.
>
> I haven't used the Eclipse approach to JTAG programming but there is probably a lot of information around.
>
> Richard
>

ok! Thanks. Bye!!!

Reply by rtstofer June 12, 20102010-06-12
--- In l..., "Andrew Kohlsmith (mailing lists account)" wrote:
>
> On Friday, June 11, 2010 02:54:22 pm rtstofer wrote:
> > Because, if P0.14 is low coming out of reset, the chip invokes the boot
> > loader and expects the .hex file to come in over the serial port.
> > InSystem Programming - ISP.
>
> Is the LPC2148 different in this respect than the LPC2013? I can use my JTAG to
> interrupt the ISP without any difficulty at all. If DEBUGSEL is in the
> incorrect state, however, all bets are off. :-)
>
> -A.
>

I doubt it.

If JTAG is available, there is no reason to use ISP. The User Manual describes both approaches to programming the flash.

But either DEBUGSEL or P0.14 need to be low coming out of reset or the CPU will try to execute the existing code. If there is no code, the ISP loader will be unconditionally executed.

In this case, using JTAG, P0.14 should be high and DEBUGSEL should be low when coming out of reset.

DEBUGSEL is usually controlled by the debug software but Olimex puts a pull-up resistor on the line for the situation where JTAG is not used. There is a jumper to pull the signal to ground when it is expected that JTAG will be used.

Again, all of this is covered in the User Manual.

Richard

Reply by "Andrew Kohlsmith (mailing lists account)" June 11, 20102010-06-11
On Friday, June 11, 2010 02:54:22 pm rtstofer wrote:
> Because, if P0.14 is low coming out of reset, the chip invokes the boot
> loader and expects the .hex file to come in over the serial port.
> InSystem Programming - ISP.

Is the LPC2148 different in this respect than the LPC2013? I can use my JTAG to
interrupt the ISP without any difficulty at all. If DEBUGSEL is in the
incorrect state, however, all bets are off. :-)

-A.

Reply by rtstofer June 11, 20102010-06-11
--- In l..., "davideciannamea" wrote:
>
> --- In l..., "davideciannamea" wrote:
> >
> > Hello everyone. Can I enter in ISP mode with a JTAG ARM-USB-TINY (Olimex)??? My card is a LPC-P2148, Olimex, and work with Eclipse Ganymede OpenOCD. Thanks.
> >
> > Davide from Italy.
> > From the manual, p0.14 is low, I connect it to GND, but in Eclipse, JTAG ARM-USB-TINY fails to load the program on the flash ram, why?
>
> ARM-USB-TINY: h--p://www.olimex.com/dev/arm-usb-tiny.html
> LPC-P2148: h--p://www.olimex.com/dev/lpc-p2148.html
>
Because, if P0.14 is low coming out of reset, the chip invokes the boot loader and expects the .hex file to come in over the serial port. InSystem Programming - ISP.

Your JTAG device programs the chip using, well, JTAG. This is a completely different scheme and P0.14 can NOT be low coming out of reset.

Spend some time with the User Manual. Section 3.10 might be interesting as will Table 58 as related to P1.26/RTCK. Maybe the schematic here:
http://www.olimex.com/dev/images/lpc-p2148-sch.gif
as related to RTCK and the debug jumper.

I haven't used the Eclipse approach to JTAG programming but there is probably a lot of information around.

Richard

Reply by davideciannamea June 11, 20102010-06-11
--- In l..., "davideciannamea" wrote:
>
> Hello everyone. Can I enter in ISP mode with a JTAG ARM-USB-TINY (Olimex)??? My card is a LPC-P2148, Olimex, and work with Eclipse Ganymede OpenOCD. Thanks.
>
> Davide from Italy.
>

From the manual, p0.14 is low, I connect it to GND, but in Eclipse, JTAG ARM-USB-TINY fails to load the program on the flash ram, why?

ARM-USB-TINY: h--p://www.olimex.com/dev/arm-usb-tiny.html
LPC-P2148: h--p://www.olimex.com/dev/lpc-p2148.html

Reply by rtstofer June 11, 20102010-06-11
--- In l..., "davideciannamea" wrote:
>
> Hello everyone. Can I enter in ISP mode with a JTAG ARM-USB-TINY (Olimex)??? My card is a LPC-P2148, Olimex, and work with Eclipse Ganymede OpenOCD. Thanks.
>
> Davide from Italy.
>

I think these are two different approaches to programming the 2148.

ISP mode is used to program the flash via the serial port. The 2148 has a permanent boot loader that handles this. P0.14 is involved with this - check the User Manual.

JTAG is a way to get direct control of the CPU and not only single step/debug but also program the flash.

If you have JTAG working, there is no need for ISP. JTAG is faster and has manyadditional features.

I used ISP for quite a while before I was able to get JTAG to work. I don't really NEED JTAG but it is a nice way to work. With the ISP approach, I would get my serial port driver working, throw in some formatted print routines (display byte, short and word hex values) and then I could just embed output calls in the code. It worked well enough. But it certainly doesn't compare well to using JTAG.

Richard

Reply by davideciannamea June 11, 20102010-06-11
Hello everyone. Can I enter in ISP mode with a JTAG ARM-USB-TINY (Olimex)??? My card is a LPC-P2148, Olimex, and work with Eclipse Ganymede OpenOCD. Thanks.

Davide from Italy.