production board: jtag? ISP? debug?

27 Feb 2012

I'm designing a new PCB using an LPC1768, and planning on using software that I am currently prototyping with mbed. The schematics are getting done and now I'm wondering about the best way to support debug and programming on the new board. I've read the prototype to hardware article, and the lpc bootloader article, and both seem to be good ways of getting new code onto the board.

However using JTAG/SWD seems to give more capability regarding debug, although I haven't yet run across any specifics on what it would take to implement it. The JTAG mbed article shows how to wire in a JTAG connector, but what do you then connect to that? I have an LPCXpresso module, has anyone used the LPClink portion of that as an mbed debugger?

And given that the mbed compiler only gives you a .bin file with no relocation information, and that the library source isn't available to the debugger, what does debugging an mbed compiler created binary look like? Is it possible to do source level debug through user code? Or would you just have an assembler view?

What about the general case that the production system is going to diverge to some extent from the prototype, meaning that if you stick with the mbed compiler you'll have diverging code streams to support, without good way of testing or debugging the production specific code.

Anyone got some practical experience here that they'd like to share?

thanks,

--steve

27 Feb 2012

Just got my first PCB's back, I went for FTDI USB-Serial interface, and two extra lines from FTDI chip, to allow Flash-Majic programming. AND I also pinned out the LPCExpresso JTAG 7 pin (0.1" pitch)

although I have not realy used the LPCXpresso board, (love my MBED)

Unfortuanatly my first board did not work, I fitted LPC1768, 90 Degrees wrong (Dough)

I can reliably program at 230400 Baud, using LPC1768 and LPC2368 :)

if you stick to the MBED pins, then there is no problem in code divergance, with MBED Compiler,

if you use LPCXpresso, then all pins are brought out, anyway.

if you want more info then feel free to contact me.

Do you intend to add Ethernet ? I have put down the pads, but so far I only have ONE LPC1768 board built up, and I do not want to risk mangelling it !!

Hope this helps

Ceri.

29 Feb 2012

Thanks Ceri. The divergence I'm talking about is, for example, using the Nokia LCD for prototyping since it's easy to hook up and use, while the production board plans to use a different LCD. Now the LCD related code is different between the two. Or prototyping with the EA baseboard accelerometer, which I believe is on lifetime buy from the manufacturer. That means that in production you'll be using a different one, so the accelerometer code will be different. I'm curious if anyone else has run across these things, or has used the JTAG connector for debugging/download and has suggestions. My project uses bluetooth but no ethernet.

thanks, steve

01 Mar 2012

If you're using mbed for prototyping, the printf/serial or I2C echo/LED/TextLCD channels for debugging are always there, and work reliably. This works very well for many kinds of development. If you need JTAG or SWD for development, then LPCXpresso is more likely to suit the job.

You'll 'just know' if you need a debugger for a project, after working a while on it.

On the other hand, if your project needs the NXP family ultra-low power modes (deep power down etc) JTAG can't be used to work on these, and so your only route is to use ISP for the Release versions.

But having chosen one or the other, I would stay with the same platform for the life of the project. If the (say) display needs to change, find a way to introduce the change on your mbed platform + baseboard.

For programming the target board, FTDI (through Farnell etc) have a USB to Serial TTL cable that terminates in a 6-way receptacle. Just mount a 6-way header on your PCB, add Pushbuttons for ISP, and RESET#, and you can then use the Free Software LPC21ISP, now with GUI which works splendidly. Or use Flashmagic. This setup is fast, very low-cost to set up, and reliable.

01 Mar 2012

where can i get LPC2ISP, had a quick google, but no links :(

Also, if you use the FTDI chip,then !Reset and ISP can be driven from the FTDI chip, within Flash Majic !!

Cheers

Ceri

01 Mar 2012

Hi Ceri,

The project home is at:

http://lpc21isp.sourceforge.net/

To get LPC21isp in GUI style, you have to join the Yahoo group that hosts the GUI project:

http://tech.groups.yahoo.com/group/lpc21isp/

Moses McKnight, who wrote it and generously shared, says:

"The file is flpcui.zip and is in Files > GUI Front Ends on the Yahoo group page. There is a windows binary and a binary for Ubuntu 10.04 included. I don't believe any extra libraries are needed - but there might be on windows as I used VisualStudio.net 2003 to compile the windows binary."

I have used it heavily for LPC1114 development, and LPC1769 occasionally. It works well, if sometimes you have to retry the entry to ISP mode, when you see error 4106 appear.

All my work is under Ubuntu 10.4 LTS, so I can't vouch for the Windows version.

Nice thing about the FTDI cable, is you don't need to mount the chip on your PCB, just use the same cable (chip built-in) for all boards in production.

http://uk.farnell.com/ftdi/ttl-232r-3v3-aj/cable-usb-ttl-ser-conv-3v3-aud/dp/1740363