Programming Arduboy with Atmel Studio 7


#1

#Install and Configure

  • Check Arduino Leonardo (Arduboy) COM Port.

  • Select “Tools > External Tools”. Setting it.

Command:

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe

Arguments:

-C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -patmega32u4 -carduino -P\.\COM6 -b115200 -D -Uflash:w:"$(ProjectDir)Debug$(TargetName).hex":i

Related article: https://slightlyovercomplicated.com/2015/11/13/programming-arduino-with-atmel-studio-7/

  • Select “Tools > Arduino Leonardo”.

  • Select “vMicro”. Setting it.

#Build and Upload

  • Open Arduino Project. Build and Upload.

#Debugging

  • Set Breakpoint, Continue/Step

#Disassembly

  • Select “Command Prompt”.

  • Input this command.

cd C:\AtmelStudio\sketchbook\Test\Debug
“C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-objdump.exe” -h -S Test.elf > Test.lss

Related article: http://www.avrfreaks.net/forum/disassembly-without-debugging

  • Click “Show All Files”.

  • Select “Test.lss” file. Select “Include In Project”.

  • Click “Show All Files”. Click “Test.lss” file. View it.


Welcome New Developers! A Listing of Development Links and Articles
(Holmes) #2

This is awesome!! I saw you posted it on Twitter and was wondering if you were going to post a tutorial. :stuck_out_tongue:


#3

Update it.

  • Build and Upload
  • Debugging
  • Disassembly

(Tobias) #4

Are there reasons to use this over Arduino IDE?


#5

Please check it! :smiley:


So how do you debug an Arduboy game?
(Tobias) #6

I just tried to install it and since I did, I’m not able to do Upload/Debug anything in the Arduino IDE anymore.
I guess I Atmel secured the Data in some way and now the Arduino IDE is not able to rename/edit/create anything.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-ar: unable to rename 'C:\Users\Towdo\AppData\Local\Temp\builde451a15219d13e1ceb25e0d74391776d.tmp\core\core.a'; reason: Permission denied
I’m scared :C

I already tried to edit the Permissions that are listed with the target folder, but everything got access.
The target data “core.a” isn’t actually there in this folder, so I cannot look up it’s permissions.

Running Arduino as Admin doesnt help

EDIT:
I FEEL SO DUMB.
It was just Avira blocking :C

I will try to avoid needing help now :stuck_out_tongue:


#7

Hello,
Can it correctly compiled with ARDUINO 1.6.9 (not 1.6.10)?
https://www.arduino.cc/en/Main/OldSoftwareReleases#00xx


(Tobias) #8

@emutyworks

But ty anyways :slight_smile:


#9

New IDE (Arduino IDE 1.6.10) compile test.

  • Download and install Arduino IDE 1.6.10.
    https://www.arduino.cc/en/Main/Software

  • Arduino IDE for Atmel Studio 7 + Arduino IDE 1.6.10 + Mystic Balloon v1.1
    Compiling ‘MYBL_AB_v11’ for ‘Arduino Leonardo’
    Program size: 26,618 bytes (used 93% of a 28,672 byte maximum) (3.84 secs)
    Minimum Memory Usage: 1699 bytes (66% of a 2560 byte maximum)

  • Arduino IDE for Atmel Studio 7 + Arduino IDE 1.6.10 + non program
    Compiling ‘Test’ for ‘Arduino Leonardo’
    Program size: 3,624 bytes (used 13% of a 28,672 byte maximum) (12.14 secs)
    Minimum Memory Usage: 148 bytes (6% of a 2560 byte maximum)


#10

Fix the installation item.
Please make sure when the Atmel Studio does not work correctly.


#11

http://www.visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx

29th Auguest 2016 - JTAG - SEGGER - ICE - ARDUINO + ATMEL - Arduino compatible build/upload combined with Atmel Studio hardware debugging. Connect Usb, connect JTAG, switch on the new menu item “vMicro>Debugger>Atmel Studio” then click “Debug>Start Debugging and Break”


(koteitan) #12

Good morning.
Help me, I tried beakpoint as yours but it cannot touch its serial port.

Visual Micro free version. PLEASE HELP by posting on social media or purchasing http://www.visualmicro.com

Compiling 'HelloWorld' for 'Arduino Leonardo'

Program size: 9,574 bytes (used 33% of a 28,672 byte maximum) (0.94 secs)
Minimum Memory Usage: 1242 bytes (49% of a 2560 byte maximum)
 
Uploading 'HelloWorld' to 'Arduino Leonardo' using 'COM3'
Unable to 'touch' hardware serial port: COM3. Now assuming selected port is bootloader port. This might still fail, have you got the correct board selected?
avrdude: ser_open(): can't open device "\\.\COM3": Access was denied.
Upload failed

When I try stop the external tool with selecting “Menu > Tools > (stop) Arduino Leonardo”, upload can be done successfully.
Upload with Arduino IDE and Visual Studio also can succeed.
Do you have any idea?

ArduinoIDE: 1.6.10
AtmelStudio: 7.0.1188
Arduino IDE for Atmel Studio 7: 1609.4.3


(koteitan) #13

p.s.
Successful uploading without external tools or with Arduino IDE or with Visual Studio seems to use bootloader’s port (COM4 for me).

Uploading with Atmel Studio without External Tools:

Visual Micro free version. PLEASE HELP by posting on social media or purchasing http://www.visualmicro.com

Compiling 'HelloWorld' for 'Arduboy'

Program size: 9,566 bytes (used 33% of a 28,672 byte maximum) (5.08 secs)
Minimum Memory Usage: 1242 bytes (49% of a 2560 byte maximum)
 
Uploading 'HelloWorld' to 'Arduboy' using 'COM3'
Connecting to programmer: .
The upload process has finished. via 'COM4'
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44

Uploading with Arduino IDE 1.6.10

Sketch uses 9,566 bytes (33%) of program storage space. Maximum is 28,672 bytes.
Global variables use 1,242 bytes (48%) of dynamic memory, leaving 1,318 bytes for local variables. Maximum is 2,560 bytes.
Forcing reset using 1200bps open/close on port COM3
PORTS {COM1, COM3, } / {COM1, } => {}
PORTS {COM1, } / {COM1, COM4, } => {COM4, }
Found upload port: COM4
C:\Users\fletcher\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/bin/avrdude -CC:\Users\fletcher\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM4 -b57600 -D -Uflash:w:C:\Users\fletcher\AppData\Local\Temp\build622a37fead4ee654a1b9a5613f737b3a.tmp/HelloWorld.ino.hex:i 

Uploading with Visual Studio Community

Compiling 'HelloWorld' for 'Arduboy'

Program size: 9,566 bytes (used 33% of a 28,672 byte maximum) (5.25 secs)
Minimum Memory Usage: 1242 bytes (49% of a 2560 byte maximum)
 
Uploading 'HelloWorld' to 'Arduboy' using 'COM3'
	The upload process has finished. via 'COM4'
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44

(koteitan) #14

It might be solved by myself and @hisadg 's advice.
Maybe the debuging with the breakpoint of vMicro is not supported in its free version and we must purchase pro version to use it.
Maybe 45days trial version of my vMicro was expired (or it had not started yet) because after I clicked the menu “start trial” the breakpoint started to work (and I forgot where this menu is).


#15

I bought it! :smiley:

Which features are included in Visual Micro Pro?
http://www.visualmicro.com/page/What-features-are-included-in-Visual-Micro-Pro.aspx