Forums

Serial ISP mode with the IAR/OLIMEX LPC2148 under Linux ?

Started by armdeveloper December 21, 2006
My JTAG pod isn't here yet.

I'd like to program the my IAR/OLIMEX LPC2148 board with the In Circuit
Serial Programming system. I'm running Linux.

Has anyone done this ?

According to here http://www.compuphase.com/lpc2100_isp.htm , one needs
to hold down the P0.14 pin and reset the processor. On this board the
P0.14 pin is conveniently brought out to a single pin marked BSL. (Boot
Strap Loader ?) Furthermore, consulting the schematic, reset is tied to
the DTR pin on the RS232-0 connector.

So, I tied down P0.14, connected a terminal set at 9600 baud and toggled
DTR. Nothing happens. I guess I was expecting a prompt or something ?
Is there a document describing the protocol somewhere ?

Next up, I installed the LPC2000 Flash Utility V2.2.3. There are two
problems with using it under Linux. 1) The connection ports are listed
as COM1,2,3,4. I am using a USB Serial device mounted under ttyUSB0. I
can probably fix that with a link or something. Worse though is that
the Flash Utility dropdown box for Device won't let me select LPC2148.
I can drop down the list, but it won't let me select it. Hmmm..

For the record, I am running FC6, KDE3.5.5, wine-0.9.27-1.fc6, Linux xxx
2.6.18-1.2868.fc6PAE #1 SMP Fri Dec 15 18:00:30 EST 2006 i686 i686 i386
GNU/Linux, LPC2000 Flash Utility V2.2.3

Can I ask a stupid question ? Why wouldn't that flash utility be written
in say... Java so that it could be used on more than one platform ?

Thanks.

An Engineer's Guide to the LPC2100 Series

Grab a copy of lpc21isp (there's yahoo group for that) that should
work just fine with linux.

--Ray

--- In l..., armdeveloper
wrote:
> My JTAG pod isn't here yet.
>
> I'd like to program the my IAR/OLIMEX LPC2148 board with the In
Circuit
> Serial Programming system. I'm running Linux.
>
> Has anyone done this ?
>
> According to here http://www.compuphase.com/lpc2100_isp.htm , one
needs
> to hold down the P0.14 pin and reset the processor. On this
board the
> P0.14 pin is conveniently brought out to a single pin marked BSL.
(Boot
> Strap Loader ?) Furthermore, consulting the schematic, reset is
tied to
> the DTR pin on the RS232-0 connector.
>
> So, I tied down P0.14, connected a terminal set at 9600 baud and
toggled
> DTR. Nothing happens. I guess I was expecting a prompt or
something ?
> Is there a document describing the protocol somewhere ?
>
> Next up, I installed the LPC2000 Flash Utility V2.2.3. There are
two
> problems with using it under Linux. 1) The connection ports are
listed
> as COM1,2,3,4. I am using a USB Serial device mounted under
ttyUSB0. I
> can probably fix that with a link or something. Worse though is
that
> the Flash Utility dropdown box for Device won't let me select
LPC2148.
> I can drop down the list, but it won't let me select it. Hmmm..
>
> For the record, I am running FC6, KDE3.5.5, wine-0.9.27-1.fc6,
Linux xxx
> 2.6.18-1.2868.fc6PAE #1 SMP Fri Dec 15 18:00:30 EST 2006 i686 i686
i386
> GNU/Linux, LPC2000 Flash Utility V2.2.3
>
> Can I ask a stupid question ? Why wouldn't that flash utility be
written
> in say... Java so that it could be used on more than one platform ?
>
> Thanks.
>
I found this. Are there others ?

http://www.pjrc.com/arm/lpc2k_pgm/
On Thu, 2006-12-21 at 23:07 +0000, yarvieh wrote:
> Grab a copy of lpc21isp (there's yahoo group for that) that should
> work just fine with linux.
>
> --Ray

OK, I will.

I just got lpc2K_pgm built and running, after I installed gtk-devel...
doh !

Anyway... I'm getting
>
ERROR: Unable to sync to baud rate.
This probably means the LPC2xxx chip is not connected
or it is not being reset, or P0.14 is not low after
reset to cause it to enter the bootloader mode.

Please check the serial port connection, make sure
pin P0.14 is low (or tied to RTS via RS-232 level
translator), and the chip has been reset (or reset
is tied to DTR via RS-232 level translator).

Any ideas ? I am using a straight DB9 cable between my USB Serial
cable. I verified that DTR goes high and low. I've got P0.14 tied low.
I've got the switches set to ISP. I've selected ttyUSB0 and it was able
to open the port. I've input a 12MHz crystal rate, just like the
crystal on my board says.

What is the default baud rate for the ISP routine ?
Scratch that info request... it works. Needed to do a full board reset
and then it worked. The "Run/ISP" switch might have been sticky.

Port "/dev/ttyUSB0" opened at 19200 baud

Entering Bootloader Mode
Reset CPU (into bootloader)
Attempting baud sync.Baud sync sucessful
Found chip: "LPC2148 (500k)"
Device Unlocked
Booting (soft jump)...
loading jump code
jumping now!

Now, time to get Hello World running...
Open source rocks !
At 04:28 PM 12/21/2006 -0700, armdeveloper wrote:
>On Thu, 2006-12-21 at 23:07 +0000, yarvieh wrote:
> > Grab a copy of lpc21isp (there's yahoo group for that) that should
> > work just fine with linux.
> >
> > --Ray
>
>OK, I will.
>
>I just got lpc2K_pgm built and running, after I installed gtk-devel...
>doh !
>
>Anyway... I'm getting
> >
>ERROR: Unable to sync to baud rate.
>This probably means the LPC2xxx chip is not connected
>or it is not being reset, or P0.14 is not low after
>reset to cause it to enter the bootloader mode.
>
>Please check the serial port connection, make sure
>pin P0.14 is low (or tied to RTS via RS-232 level
>translator), and the chip has been reset (or reset
>is tied to DTR via RS-232 level translator).
>
>Any ideas ? I am using a straight DB9 cable between my USB Serial
>cable. I verified that DTR goes high and low. I've got P0.14 tied low.
>I've got the switches set to ISP. I've selected ttyUSB0 and it was able
>to open the port. I've input a 12MHz crystal rate, just like the
>crystal on my board says.

What are you using for a level translator? RS232 levels could be very
unhealthy for the micro. They will also be inverted of course.

>What is the default baud rate for the ISP routine ?

It autobauds (it has to since it has no way of knowing what the crystal
speed is) but depending on the crystal some standard baud rates may not work.

After verifying your level translation it would be worth while following
the ISP sync procedure manually to verify your hookup. After that it's
probably 'scope time.

There is also a standard ISP header defined. See
http://www.open-research.org.uk/ARMuC/Standard_ISP_Header.html

Robert

http://www.aeolusdevelopment.com/

From the Divided by a Common Language File (Edited to protect the guilty)
ME - "I'd like to get Price and delivery for connector Part # XXXXX"
Dist./Rep - "$X.XX Lead time 37 days"
ME - "Anything we can do about lead time? 37 days seems a bit high."
Dist./Rep - "that is the lead time given because our stock is live.... we
currently have stock."
--- In l..., Robert Adsett wrote:
>
> At 04:28 PM 12/21/2006 -0700, armdeveloper wrote:
> >On Thu, 2006-12-21 at 23:07 +0000, yarvieh wrote:
> > > Grab a copy of lpc21isp (there's yahoo group for that) that should
> > > work just fine with linux.
> > >
> > > --Ray
> >
> >OK, I will.
> >
> >I just got lpc2K_pgm built and running, after I installed gtk-devel...
> >doh !
> >
> >Anyway... I'm getting
> > >
> >ERROR: Unable to sync to baud rate.
> >This probably means the LPC2xxx chip is not connected
> >or it is not being reset, or P0.14 is not low after
> >reset to cause it to enter the bootloader mode.
> >
> >Please check the serial port connection, make sure
> >pin P0.14 is low (or tied to RTS via RS-232 level
> >translator), and the chip has been reset (or reset
> >is tied to DTR via RS-232 level translator).
> >
> >Any ideas ? I am using a straight DB9 cable between my USB Serial
> >cable. I verified that DTR goes high and low. I've got P0.14 tied
low.
> >I've got the switches set to ISP. I've selected ttyUSB0 and it was
able
> >to open the port. I've input a 12MHz crystal rate... snip...

This could be your problem. With 12 MHz and during ISP no PLL enabled,
the max. baudrate is (IIRC) 38400.

So, if you try 115200, the message is correct, unable to sync. to
baudrate.

Bob
On Fri, 2006-12-22 at 04:58 +0000, lpc2100_fan wrote:
> This could be your problem. With 12 MHz and during ISP no PLL enabled,
> the max. baudrate is (IIRC) 38400.

Thanks for the reply. Just so everyone is aware, it works now. The
problem was either a sticky ISP/Run switch or I had to power down the
board and power it back up before I tried to sync with it. Anyway, it
works now. Thanks.