According to the response I guess the bootloader is destroyed.
The Arduino IDE provides the function "Burn bootloader" in menue Tools.
You need a programmer to burn it. For instructions search for "burn bootloader" on the arduino main page. There is a description "Burn the bootloader on SAMD boards".
Automatic (Software) Reset
The SAM3X microcontroller differs from AVR microcontrollers because the flash memory needs to be erased before being re-programmed. A manual procedure would involve holding the erase button for a second, pressing the upload button in the IDE, then the reset button.
Because a manual erase-flash procedure is repetitive, this is managed automatically by both USB ports, in two different ways: Native port
Opening and closing the ''Native' port at the baud rate of 1200bps triggers a "soft erase" procedure: the flash memory is erased and the board is restarted with the bootloader. If, for some reason, the MCU were to crash during this process, it is likely that the soft erase procedure wouldn't work as it's done in software by the MCU itself.
Opening and closing the Native port at a baudrate other than 1200bps will not reset the SAM3X.
Thanks. That's good to know.
When I tried to program the board this morning (the normal way), it worked fine again. I'm not sure what went wrong yesterday but all is working again this morning!