Running code from RAM and not using FLASH (ARM)
SAM-BA is a boot loader, so if you have samba you really dont need to re-invent another one.  Just use it.  Jtag usually works as well for being able to load programs into ram and running them.  Eventually though I assume your application will need to be run from flash once you turn this into a project/gadget or whatever.  not required but assumed.  you could wrap your ram version with a small copy to ram program.

I recommend you use sam-ba or whatever to wipe the user flash so that samba doesnt try to load that and to insure the chip is in a known state.  Not sure about samba but it is possible that once the bootloader fails to detect a program in flash it might up the clocks or setup peripherals (uart) that it might not have if it had copied flash, so you may still end up in a situation that your tested in ram program works but once you copy it from a flash based program or run it from flash it may not work.  some flash cycles may be required to finish testing.  or you can make your own bootloader that samba runs and then you are in a known state.  My preference is a dumb xmodem thing, bootloader does just enough to setup the uart and start waiting for an xmodem download, then downloads to a known address in ram.  then replace the xmodem downloader with the copy to ram and run.  that way there are no surprises.