EmbeddedRelated.com
Forums

How can i automate jtag programming of 10+ LPC210x/213x?

Started by Darcy March 13, 2008
Okay, I'm trying to find out a way to program 13 different LPC2000
devices on the same jtag chain. We have one LPC2138, and twelve
LPC2103's.

We're currently using the ARM-USB-OCDs with Rowley CrossWorks and
Vista (meh). We can source an XP machine with a parallel port if this
is what it takes. We'd prefer a windows based solution as that is
what the techs have access to already.

I am currently able to address individual devices and load code one by
one on to each of these. The problem there is the time it takes to
manually change the offset values before downloading code to each device.

Is there a way that we can use the ARM-USB-OCD or Olimex Wiggler clone
in order to automate the process?

There will be three devices with different code to each other, and
another 10 that will run identical code.

This is becoming a real headache for me as the h/w engineer had tried
to design the board so that we could use ISP for each device...
unfortunately it doesn't come even close to doing the job.

If we have to buy a few hundred dollar part and a piece of software
then so be it. I'm in support of the open source scene so I'd rather
go with that option if possible.

Thanks all!
Darcy

An Engineer's Guide to the LPC2100 Series

Hi Darcy,

> Okay, I'm trying to find out a way to program 13 different LPC2000
> devices on the same jtag chain. We have one LPC2138, and twelve
> LPC2103's.
>
> We're currently using the ARM-USB-OCDs with Rowley CrossWorks and
> Vista (meh). We can source an XP machine with a parallel port if this
> is what it takes. We'd prefer a windows based solution as that is
> what the techs have access to already.
>
> I am currently able to address individual devices and load code one by
> one on to each of these. The problem there is the time it takes to
> manually change the offset values before downloading code to each
> device.
>
> Is there a way that we can use the ARM-USB-OCD or Olimex Wiggler clone
> in order to automate the process?
>
> There will be three devices with different code to each other, and
> another 10 that will run identical code.
>
> This is becoming a real headache for me as the h/w engineer had tried
> to design the board so that we could use ISP for each device...
> unfortunately it doesn't come even close to doing the job.
>
> If we have to buy a few hundred dollar part and a piece of software
> then so be it. I'm in support of the open source scene so I'd rather
> go with that option if possible.

Whilst it isn't elegant, you can do this now.

STAGE 1: Template

1. Create a solution with the single project, call it 'Template', you wish
to distribute over the 10 nodes.
2. Check it download and works on ONE node.
3. Open the solution in an editor (right click on Solution and select Edit
Solution As Text) and edit so that there is no reference to JTAG bits
before/after, it looks like this (for instance):

arm_linker_jtag_pad_post_dr="1"/>

This gets you a solution that can be put on any of your 10 processors but
you have not specified which one on the JTAG chain, with it so far?

STAGE 2: Single Replication

1. Create a single externally-built project, call it 'Replicant #1'.
2. Edit the External Build Options and point the Executable File at the ELF
file generated by the Template project.
3. Edit the Target Options JTAG bits before/after to select one of the
processors.
4. Check that Replicant #1 really does download to the target.

STAGE 3: Put factory to work and tie loose ends

1. Repeat stage 2 for Replicants #2 through #10.
2. Make all Replicant projects depend upon the Template project using
Project > Project Dependencies. This means that the Template is rebuilt if
it's changed and you download it to one or more of the targets.

STAGE 4: Download.

Ok, bit more of a challenge: When you need to do this on the 10 replicants,
you need to double click each project in the project explorer and press F5
(go) or Ctrl+F5 (Start without debugging). However, all the hard work is
already done for you, no fiddling with JTAG bits.

STAGE 5: Add sprinkles

Add the other projects you want to the solution, for the three
non-replicants. You now have a solution with 14 projects in, 10 for 10
replicants, three non-replicants, and a replicant template.

You can now just select a project, then Debug > Attach and see what's
happening on that processor. No problem. You just change projects and use
the single JTAG connection. You can't debug two simultaneously, but it's
good enough for V1.

Regards,

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

=======================================================================Groups related to lpc2000
=======================================================================
msp430 (388 common members)
http://groups.yahoo.com/group/msp430?v=1&t=ipt&ch=email&pub=groups&slktr0&sec=recg
Computers & Internet/Hardware: Welcome to the MSP430 User's Group! The purpose of...

AVR-Chat (177 common members)
http://groups.yahoo.com/group/AVR-Chat?v=1&t=ipt&ch=email&pub=groups&slktr1&sec=recg
Microprocessors/Microcontrollers: A place for Atmel AVR Microcontroller users to sha...

LTspice (165 common members)
http://groups.yahoo.com/group/LTspice?v=1&t=ipt&ch=email&pub=groups&slktr2&sec=recg
Engineering/Electrical: Dedicated to the exchange of information about LTs...

Homebrew_PCBs (157 common members)
http://groups.yahoo.com/group/Homebrew_PCBs?v=1&t=ipt&ch=email&pub=groups&slktr3&sec=recg
Engineering/Electrical: Designing, making, etching, soldering, printed cir...

e-embedded (151 common members)
http://groups.yahoo.com/group/e-embedded?v=1&t=ipt&ch=email&pub=groups&slktr4&sec=recg
Internet/Internet Appliances: Open-membership mailing list for embedded system d...
Once again my feeling of support for the Rowley team is justified...
:) Thanks Paul. I was expecting to have to create a script for Open
OCD - which might work after spending a few hours experimenting with
it last week.

This little excerpt would probably be worth sticking in your FAQ!

Once we get boards come in I'll give this a go.

Cheers mate
Darcy

--- In l..., "Paul Curtis" wrote:
> Whilst it isn't elegant, you can do this now.
>
> STAGE 1: Template
>
> 1. Create a solution with the single project, call it 'Template',
you wish
> to distribute over the 10 nodes.
> 2. Check it download and works on ONE node.
> 3. Open the solution in an editor (right click on Solution and
select Edit
> Solution As Text) and edit so that there is no reference to JTAG bits
> before/after, it looks like this (for instance):
>
> > arm_linker_jtag_pad_post_dr="1"/> This gets you a solution that can be put on any of your 10
processors but
> you have not specified which one on the JTAG chain, with it so far?
>
> STAGE 2: Single Replication
>
> 1. Create a single externally-built project, call it 'Replicant #1'.
> 2. Edit the External Build Options and point the Executable File at
the ELF
> file generated by the Template project.
> 3. Edit the Target Options JTAG bits before/after to select one of the
> processors.
> 4. Check that Replicant #1 really does download to the target.
>
> STAGE 3: Put factory to work and tie loose ends
>
> 1. Repeat stage 2 for Replicants #2 through #10.
> 2. Make all Replicant projects depend upon the Template project using
> Project > Project Dependencies. This means that the Template is
rebuilt if
> it's changed and you download it to one or more of the targets.
>
> STAGE 4: Download.
>
> Ok, bit more of a challenge: When you need to do this on the 10
replicants,
> you need to double click each project in the project explorer and
press F5
> (go) or Ctrl+F5 (Start without debugging). However, all the hard
work is
> already done for you, no fiddling with JTAG bits.
>
> STAGE 5: Add sprinkles
>
> Add the other projects you want to the solution, for the three
> non-replicants. You now have a solution with 14 projects in, 10 for 10
> replicants, three non-replicants, and a replicant template.
>
> You can now just select a project, then Debug > Attach and see what's
> happening on that processor. No problem. You just change projects
and use
> the single JTAG connection. You can't debug two simultaneously, but
it's
> good enough for V1.
>
> Regards,
>
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
>

Darcy wrote

> Okay, I'm trying to find out a way to program 13 different LPC2000
> devices on the same jtag chain. We have one LPC2138, and twelve
> LPC2103's.

See:
http://www.mpeforth.com/jtagwidget.htm

It should be able to do what you want. It's a scriptable ARM
debugger/programmer with a USB connection. If you want to use it
from a Linux box, you'll need the FTDI drivers and terminal
emulator.

Stephen

--
Stephen Pelc, s...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads