Serial Wire debug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Serial Wire debug

3,325 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Sun Feb 09 15:05:22 MST 2014
I am investigating how to connect my LPC link board to my own target board.

So Serial Wire was designed to reduce the number of pins required for debugging from JTAG's five. ARM says Serial Wire is a two-wire connection, needing only SWCLK and SWDIO and ground - now that comes to three in my counting.

RESET is accomplished by clocking 50 ones into SWDIO - so how's that done if either SWDIO or SWCLK has been used as an output?

http://support.code-red-tech.com/CodeRedWiki/HardwareDebugConnections then goes on to mention the RESET pin, (now we've got to four) and then the ISP pin.

How many now? That's 5, isn't it? Isn't that the same as JTAG? Am I missing something here?
0 Kudos
Reply
5 Replies

2,177 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sat Feb 15 04:02:07 MST 2014
I'm still talking about the minimal debug connection (= wires from target board to LPC-Link(2)).


Quote: IanB
I am investigating how to connect my LPC link board to my own target board.



And that's still 2. At least if you don't want to power your target board or connect signals which are not used by LPCXpresso...

Your board design (ISP, Reset, UART, pull-ups) is a different issue.
Of course it's useful to add a jumper to switch to ISP there. And UART connector to use FlashMagic...


Quote: IanB
...time to stop before someone mentions thousand wire interface.



I like 'Trans World Interface'  :)  Sounds global...
0 Kudos
Reply

2,178 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Sat Feb 15 02:35:51 MST 2014
Twelve wire interface, thirteen wire interface, twenty wire interface - getting silly - time to stop before someone mentions thousand wire interface.

This is what it says in the LPC111x data sheet:
"27.6.2 Debug connections
For debugging purposes, it is useful to provide access to the ISP entry pin PIO0_1. This
pin can be used to recover the part from configurations which would disable the SWD port
such as improper PLL configuration, reconfiguration of SWD pins as ADC inputs, entry
into Deep power-down mode out of reset, etc. This pin can be used for other functions
such as GPIO, but it should not be held low on power-up or reset."

Then there is a diagram showing SWDIO, SWCLK, VDD, VSS and RESET (but not PIO0_1).

One thing that I have noted is that in the days of DIL packages, the extra cost of buying the device with more pins was quite high, so it was well worth designing around the device with the smallest possible number of pins.
With the LQFP and similar packages the difference in cost between 32 pins, 48 pins and 64 pins is not great, and it is probably worth spending the extra few pence to accommodate all six pins of the two-wire debug!

Also, if I do manage to program into a state I coax it out of with the debugger, there is always the option of getting out the hot-air SMD rework station and replacing the IC - it's only a quid.




0 Kudos
Reply

2,178 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Fri Feb 14 05:25:44 MST 2014

Quote: IanB
TWI - Isn't that Three Wire Interface?



Or 'Ten Wire Interface' ?


Quote: IanB
I thought all the targets would be the same - now that you've told me that they are not, I looked in the individual data sheets and found that mine needs Reset, but not necessarily ISP.



:quest:

Your data sheet is not telling you if or if not LPC-Link needs Reset to Debug/Flash the target. There is [color=#f00]no official document[/color] with informations about minimal debug connection...

The only way to find out if Reset is required or not is to test it...



0 Kudos
Reply

2,178 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Fri Feb 14 04:12:52 MST 2014
TWI - Isn't that Three Wire Interface? (sorry) I know - it's I2C by another name - I had to look it up.

I thought all the targets would be the same - now that you've told me that they are not, I looked in the individual data sheets and found that mine needs Reset, but not necessarily ISP.

Does anyone know if I can program or debug anything other than NXP devices with LPC-link?

(I'd like a device with I2S, but it's only in the high-end NXP devices, but it is on the cheaper ones by other manufacturers; and I don't really want to have to learn how to use a different IDE.  I know I won't have the libraries.)

0 Kudos
Reply

2,178 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sun Feb 09 16:58:44 MST 2014

Quote: IanB
ARM says Serial Wire is a two-wire connection, needing only SWCLK and SWDIO and ground - now that comes to three in my counting.



Wrong counting. How many wires do you need for TWI?


Quote: IanB

RESET is accomplished by clocking 50 ones into SWDIO - so how's that done if either SWDIO or SWCLK has been used as an output?



If you use a different pin function SWD isn't possible... 


Quote: IanB
http://support.code-red-tech.com/CodeRedWiki/HardwareDebugConnections then goes on to mention the RESET pin, (now we've got to four) and then the ISP pin.

How many now? That's 5, isn't it? Isn't that the same as JTAG? Am I missing something here?



Depends on your target. There are targets which can be connected with a simple 2 wire connection. Other targets still need a Reset...  
0 Kudos
Reply