What protocols and tools does Arduino Due use for flashing and debugging? I am interested in writing a simple C program outside of the Arduino IDE and respective libraries, but deploying it directly to an Arduino Due (which uses a SAM3X8E ARM MCU). I am trying to figure out what comms/serial protocols are used for:


Flashing/deploying the program to the ARM MCU; and
Connecting the program to a debugger


And, not just the protocols used, but what tools are compatible with these protocols, and henceforth, can be used for both use cases. How can I tell what my viable options are?
The Due (more specifically the SAM3X) uses its own proprietary protocol. It's all embedded in the bootloader, which is hard wired in the ROM and can never be changed (idiotic if you ask me).

I know of two systems for communicating with it.  Atmel's SAM-BA program, and the open source BOSSA.  The command line version of BOSSA (bossac) is used by the Arduino IDE for programming.