Go Down

### Topic: Customizing Atmel Studio6 for the Due auto-erase bootloader (Read 7173 times)previous topic - next topic

#### Transistorfips

##### Feb 27, 2013, 03:06 pm
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.
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!

#1

#### Transistorfips

#9
##### Mar 06, 2013, 08:00 amLast Edit: Mar 06, 2013, 08:04 am by Transistorfips Reason: 1
Hello Ewald,
after adjusting to my system the post build event ran on first glance. Great work!
Seems you have heck a lot of experience in Dosbox programming stuff.

Have a drink (on me ;-) this evening.

Joachim

#### ctbenergy

#10
##### Mar 06, 2013, 11:31 pm
Hi Joachim,

you can customize the wait time for memory erased.

REM Wait X second for memory on Arduino Due is erased.
SET WAIT_ERASED=4

i tested with "SET WAIT_ERASED=2" and it works well.

2 seconds faster :-)

#### Souko

#11
##### Oct 04, 2013, 08:11 pm
Hi,
symply parse the Variables to the Batch-File:
modify Batch and Commands to your requirements.

-------- batch starts here -----------------
@echo Automatic erase-button for flashing Arduino Due with ATMEL-Studio, (c) Transistorfips 2013
@echo Arguments-Extension by Souko Hiabuto 2013

set flashfile=%1
set comport=%2
mode %comport%:1200,N,8,1,P
C:\bossa\bossac.exe --port=%comport% %flashfile% -U false -e -w -v -b  -R
-------- batch ends here -----------------

Atmel  Studio 6 configuration:

Tools -> External Tools ->
Title:  Bossa (or what you want as title)
Command: Path\to\your\Arduino_Due.bat
Arguments: $(TargetDir)$(TargetName).bin COM6 (modify COM6 to your requirements)
Mark Checkbox "Use Output window"

klick OK -> Done

Go Up

Please enter a valid email to subscribe