Hi guys,
because I want to use Atmel-Studio6 instead of the Arduino IDE (way to much restrictions for me ;-) I have built a little tool - a batch job which erases and flashes the Due automatically. So no more pushbutton work has to be done. Also the the functionality of Bossac is now embedded in the ATmel IDE toolbar.
Maybe someone can use this tool, too.
Howto:
1.Create a batch-file
Create a batch-file, name it Arduino_Due.bat
C&P these lines:
- - - - - - - - - cut here - - - - - - - - -
@echo Automatic erase-button for flashing Arduino Due with ATMEL-Studio, (c) Transistorfips 2013
@echo off
::Set COM port, filename + pathname for the file to be flashed.
::Example: set flashfile=C:\ARM_ARDUINO\Dir1\Dir2\debug\hello_world.bin
set flashfile=C:\ARM_ARDUINO\Versuch\Test2\GETTING-STARTED2\GETTING-STARTED2\Debug\GETTING-STARTED2.bin
set comport=%COM14
mode %comport%:1200,N,8,1,P
C:\bossa\bossac.exe --port=%comport% %flashfile% -U false -e -w -v -b -R
- - - - - - - - - cut here - - - - - - - - -
Please read and follow the instructions in the batch file when using it. Unfortunately I haven't found a correct syntax for relative variables like $(ProjectDir)Debug\$(ItemFileName).bin or so. So the full path name must be hard coded instead. If you find out how to set a relative target name usable in a batch file then please let me know.
2.
Make a Directory c:\bossa. Copy the command line tool "bossac.exe" (not the file with the same name used by the windows version, this won't work) and the new batch file "Arduino_Due.bat" in the directory.
3. Embed the bootloader sequence in Atmel Studio6
Click Tools -> External Tools...
Select Title:
Bossa
Select Command:
C:\Bossa\Arduino_Due.bat
(make sure path, file etc is correct)
Atmel Studio has created a new item now, bossac can be used from the "Tools" menu. If you want to have a funky little button in the toolbar also (yes!!) then do step 4 additionally.
4. Make a new button for Atmel Studio
Find the "build toolbar" in the toolbar (the buttons the code is crunched with).
On the left edge right-click the arrow for the "build toolbar options". The pull-down menu appear.
Select "Customize..." In the pop-up window select the tab "commands".
Click the radio button for "Toolbar". Select "Build" from the corresponding drop-down menu.
Click "Add Command...".
In the left box, select "Tools" in the categories menu. The right box now is filled with selectable commands.
Find "External Command 1" and click it.
Now a new button in the build toolbar has been created and Bossac is ready to use. If you want to change the position inside the toolbar then re-open the command tab and use the up/down buttons for positioning. Be sure the appropriate item is selected.
http://img703.imageshack.us/img703/4779/buttonbossa2.jpg
Enjoy!