What is the JTAG frequency you are using?
Maybe you can try to use the default JTAG frequency 6Mhz.
Let me know if it work or not.
What os are you using? How are you connecting (which wires, usb etc)?
For more complete information about compiler optimizations, see our Optimization Notice.