Bootloader with the IDE

You can to burn the bootloader in two modes or using IDE or AtmelStudio. 
If you want use Atmel Studio follow this guide: 
Write the bootloader through AtmelStudio
Else if you have an Arduino M0 Pro then you can use Arduino IDE follow these steps: 
- Open Arduino IDE 1.7.7 or later. (You can download here: here). 
- Connect the Programming Port to PC; 
- Select the M0 Programming port from Tools>Programmer menu. 

Arduino IDE: Programmer menu 
- Select M0 Programming Port from Tools>Board menu. 

Arduino IDE: board menu 
- Select the correct Serial Port from Tools>Port menu. 

Arduino IDE: Port menu 
- Now you click on Burn Bootloader from Tools menu. 

Arduino IDE: Burn bootloader 
Burning bootloader 
- Wait the message of write completed. 

Bootloader burned 
-Now you try to upload a sketch using Arduino IDE. 
This guide is usable only ARDUINO M0 PRO.