Programmatically enter ROM for SAM-BA

I do wonder if BOOT_MODE is set to "flash", can there be a program in flash that goes back to the ROM for SAM-BA?

In this case, by default the program runs, and the native usb is used for the purpose of the program. Once there is a request for updating firmware, then, program enters the ROM, and SAM-BA should run, and native usb should become BOSSA again. At this point, we can program the chip using BOSSAC.exe. Once done, if the chip is reset, then it will boot from flash again as normal.

This would be by the SAM ic itself, and without erasing the current flash, so that using the ROM bootloader, a copy of the flash is backed up first.

See section 7 of the datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf