Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Which pins of P1 can be used simultaneously with JTAG?

2005-12-16 by Tom Walsh

varuzhandanielyan wrote:

>Maybe very silly question, but...
>Can I use P1.24-P1.31 pins in my design as
>IO, if I plan to debug the soft using JTAG,
>particularly ULINK.
>Technical data references, experience, opinions?
>
>  
>
I do.  The LPC2106 has a secondary JTAG port, you just need to turn it 
on..   You must download the first Flash image without JTAG, but after 
that it works fine: flash new program, debug, etc.

This is the code sequence in the first few bytes of my crt0.S:

================ begin ====================
_start:
start:
_mainCRTStartup:

// Initialize Interrupt System
// - Set stack location for each mode
// - Leave in System Mode with Interrupts Disabled
// -----------------------------------------------
;
      ldr   r0, JTAG2
      ldr   r1, PINSELREG
      str   r0, [r1]       // activate secondary JTAG port.
;
      mov   r3, #65536
startdelay:
      subs  r3, r3, #1
      bne   startdelay     // give debugger time to catch us.
;

=============== snip ======================

With JTAG2 & PINSELREG as:

================= begin ===================
JTAG2:
   .word 0x55400000
PINSELREG:
   .word 0xe002c004
================== snip ===================


The short delay loop lets the JTAG unit "catch up" and stop the 
processor early in the boot process.  Otherwise, I've run into problems 
where the processor will run into a brick wall (bad code) before the 
JTAG can catch it out of reset.


TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.