Won't run my code when Debug using SAM-ICE SWD - solved

Having problems getting started debugging with the Arduino Due.
I built the Getting-Started project (flash the LED) from Atmel Software Framework using Atmel Studio.
If I just program it to the board, it runs. (The LED flashes.)
If I try to debug it, my code never starts. (i.e. the processor never gets to Reset Vector, or to main,
the LED stays lit constantly).
When I press break button while debugging, the Due is always running someplace in the ROM section of the address space.

If I stop running the debugger (SAM-ICE still connected, just not running debugger in Atmel Studio), and power cycle the Due, it starts running the getting-started code (i.e. the LED starts flashing).
(Just pressing reset is not sufficient, have to power cycle the board to get it to start running the code).

My guess - something is going wrong with the boot process when using the debugger
(for some reason it is booting from ROM, rather than Flash).

In Atmel studio I told it to Boot from Bank 0

--
Additional:
I tried downloading J-Link ARM 4.78e, and using the GDB server from that.
Using GDB from CodeSourcery to connect to the Due via GDB server
same results - when I started the application in GDB, it never got to the breakpoint at main,
and the LED did not start flashing. (Using ELF file generated by Atmel Studio).

--
Background:
Arduino Due (R3)
Connected to SAM-ICE using SWD (debug) connector on Due (Custom cable)
IDE: Atmel Studio 6.1.2674-SP 1
Debugger driver: Segger J-Link (whatever version came with Atmel Studio).
OS: Windows XP (SP3)

--
Here is the output from J-Link commander

SEGGER J-Link Commander V4.78e ('?' for help)
Compiled Oct 25 2013 11:31:23
DLL version V4.78e, compiled Oct 25 2013 11:30:56
Firmware: J-Link ARM V7 compiled Feb 15 2011 11:03:33
Hardware: V7.00
S/N: xxxxxxxx [elided]
OEM: SAM-ICE
Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
VTarget = 3.293V
Info: Could not measure total IR len. TDO is constant high.
Info: Could not measure total IR len. TDO is constant high.
No devices found on JTAG chain. Trying to find device on SWD.
Info: Found SWD-DP with ID 0x2BA01477
Info: Found Cortex-M3 r2p0, Little endian.
Info: FPUnit: 6 code (BP) slots and 2 literal slots
Info: TPIU fitted.
Cortex-M3 identified.
JTAG speed: 100 kHz
J-Link>


The debugger detects the Due, and I can inspect memory, and change memory,
and see disassembly of the code.


The cable connects to the SWD connector (4 pin debug) on the Due
Due SAM-ICE
Pin furthest from USB connector (GND) connects to pin 18 on SAM-ICE
next pin TCK to pin 9 (TCK)
next pin TMS to pin 7 (TMS)
next pin RESET to pin 15 (nRESET)

Pin 3.3V (near the barrel plug) to pin 1 (VCC)

Power for the Due coming from barrel jack (9V 1A wall wart)

This is the first time I have used the SAM-ICE (i.e. I was trying the debugger first with a simple
program that I know the program works.).

I have successfully programmed the Due using bossac to run a few programs
(i.e. got the LED to flash, got serial output from another program).

Only things connected to the DUE:
Wall wart (power)
USB cables (not connected to any computer)
SAM-ICE

--
I do not have the right connector for the JTAG header, so have not tried to use a JTAG debug cable.

I do not know what the problem was specifically, but it was resolved after I installed
a different driver for the JTAG device, and then reinstalled J-Link.