You're clearly looking at the wrong documentation for your board
http://www.atmel.com/dyn/resources/prod ... oc6311.pdfhttp://www.atmel.com/dyn/products/tools ... ol_id=4281On the AT91SAM9XE-EK board J7 is the TST/ERASE jumper. Putting it on 1-2 erases the internal FLASH. So unsurprisingly your code disappears.
On the AT91SAM9260-EK board J7 is the BMS jumper, and picks whether the 9260 boots from the internal ROM, or external NOR
If you want to run code from SDRAM, you can do so with SAM-BA, but the much simpler way to run/debug code is to use the Keil ATMEL projects with the "SAM9xxx Ext SDRAM - SAM-ICE" target and use the SAM-ICE/J-LINK JTAG pod. I'm pretty sure these download/initialization scripts could also be used with the Keil U-LINK.