VS Arduino
Visual Micro >> Hardware Debugging (GDB, GDB WiFi, GDB Stub) >> Arduino Debug with Atmel Ice & AS7
https://www.visualmicro.com/forums/YaBB.pl?num=1595517686

Message started by Greybeard on Jul 23rd, 2020 at 3:21pm

Title: Arduino Debug with Atmel Ice & AS7
Post by Greybeard on Jul 23rd, 2020 at 3:21pm
I want to use Atmel Icee with Atmel Studio 7 and debug an existing arduino application.   I did not seen any way to open an existing .ino file and create an arduino project.  Please let me know what I miss. 

So....I went to the doc 'visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx' and tried to follow that.

The test file is a simple blink example with a counter added.

Step 1:  Create a new arduino project named Blink.

Step 2:  Rename the arduino example 'blink.ino' to 'blink.cpp' and copy it to the folder created in step 1.

Step 3:  Set up the project for hardware debugging.  Screen shots attached.

Step 4:   Remove the contents of blink.ino created above but retain the file.

When I select Debug->Start Debugging and Break, the program compiles properly but does not load to the DUE target.

Note that vMicro->Atmel Studio Debugging is not enabled.

When I check vMicro->Atmel Studio Debugging I get the same behavior, but I think this is normal.   I can go to Tools->Device Programming and upload the file using Atmel Ice.  After uploading, I can use Debug->Attach to Process and the debugger will break into the code at an assembler location.  Unfortunately, all of the start  up code is missed and I cannot restart the program (read I don't know how).

Suggestions??

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Screens_002.pdf ( 351 KB | 4 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=output_045.txt ( 73 KB | 4 Downloads )

Title: Re: Arduino Debug with Atmel Ice & AS7
Post by Simon Hopkinson on Jul 23rd, 2020 at 4:34pm
To use the upload via the ICE, the vMicro > Upload > Programmer should be set to "Atmel Studio Device Programming", which will hand over the upload to the standard Atmel Studio tools. The upload can be done via Serial if you want to preserve the bootloader, by setting the programmer to "No Programmer", and selecting the COM port.

For the Debugger, ensure the vMicro > Debugger > Atmel studio Debugger is ON.  Then (as shown in the PDF) set the Tool properties for the Atmel ICE.

The Debug > Start debugging and break command should work and land at the start of setup(), once the Upload options, and Debug options are configured

An example can be seen in the below video snippet (I use the Serial Upload as will use board in VS later).
GDB in AS7 Using Atmel ICE with Serial Upload

Does that clarify how to break into setup() via GDB?

Title: Re: Arduino Debug with Atmel Ice & AS7
Post by Greybeard on Jul 23rd, 2020 at 9:45pm
That simple -- Works. Thanks.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.