The device goes into sleep mode early in the program. It seems that the JTAG cannot reprogram the device in sleep mode.
POWCON0 = 0x70 - so bit 4 is low. When I try to reprogram, I get the message that the "Cannot stop ARM device"
Is there a way to recover from this?
Have you tried mass erase the part using ARMWSD - ADUC7XXX in-circuit serial programming tool?