Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code (Read 2944 times)
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Jun 21st, 2020 at 10:32am
Print Post  
Hi I have update my VS +vMicro to 2020.518.1 and now the debugging with Atmel ICE present an new issue. When I place a breakpoints in setup area (I'm using a Arduino DUE board original) this breakpoint is ignored the program pass without stopped. If I place a breakpoints in to Loop this break point is correctly execute and the program is well stopped. I have tried with two separate breakpoints, one placed in to setup and one placed in loop. Same issue, the breakpoint in setup are code is ignored and the debug is sopped on second breakpoints on the loop. Before of last vMicro update this issue never see before. Do you have some idea about this? Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #1 - Jun 21st, 2020 at 6:01pm
Print Post  
If this is GDB debugging then will only do whatever it does. It might be that you can place a breakpoint in the main.cpp instead.
  
Back to top
WWW  
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #2 - Jun 21st, 2020 at 6:19pm
Print Post  
but no, he's never done anything like that. never happened before your update.  I always put breakpoints in the setup.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #3 - Jun 21st, 2020 at 6:52pm
Print Post  
Again, you always need to post the information in yellow above. It is unclear if you are using gdb or serial debugging and unclear which port.

If using serial you would normally ensure the DTR on the serial monitor is enabled so that the mcu resets when the debugger starts. However the native usb ports can be a problem because they are not wired to the DTR therefore can not be reset automatically. In that case the mcu starts immediately after upload the setup() can not be tracked. Therefore you need to press the reset button on the board after the debug has started so that the setup() runs.

So I have not see that the upgrade affects any of this but you ar working with many combinatoions so you should be careful about what you think happens under the difference circumstances.
« Last Edit: Jun 21st, 2020 at 6:55pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #4 - Jun 22nd, 2020 at 4:17pm
Print Post  
Hi, I have tried to press the mcu reset without effect, any breakpoints place on setup is always ignored. My configuration is: AtmelICE(uploader)  + AtmelICE(debug) GDB + vMicro on Arduino DUE original board.  In attach the debug log file.  Smiley
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
ksupinger
Newbies
*
Offline


Posts: 5
Joined: Jun 24th, 2020
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #5 - Jun 24th, 2020 at 6:54am
Print Post  
I'm seeing the same behavior after installing the latest update 19.0 for Visual Studio 2019. I've been using Visual Micro since it got started. I have 3 updated VS2019 computers and they all have the same issue. All 3 were stepping thru the Setup() code previously
Now when debugging with a Atmel ICE  hardware. 
I can set a breakpoint anywhere except the Setup() routine in Arduino Due, which gits ignored even though VS2019 sets it. The breakpoints in Setup() and any code it calls are ignored completely. The code continues to run in Setup() and can stop in Loop() breakpoints and any other code libraries. Please fix this ASAP I'm trying to debug an I2C peripheral on startup. Thanks Cry Cry
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #6 - Jun 24th, 2020 at 9:19am
Print Post  
Thanks for the information.  On further investigation it appears as though the initCmd we use for the DUE/ICE is not being overridden with the "reset halt" additions when attaching the debugger.

We are looking internally at this as when attaching to a process this is not normally desired, but when running "start debugging" it is desirable (as they normally behave this way in VS when developing PC projects).

Until we have a fix for this available, the best solution is to Add a Custom Custom GDB Debugger JSON File to the project, and copy the JSON output from the MicroBuild into it from attaching the ICE.  This can then be modified on the end of the Debug Server Args command to become -c "init; reset halt" instead of just -c "init"

This ensures the MCU is reset when the debugger is attached, meaning setup code will be accessible easily.   

An alternative is to put a delay at the top of setup (e.g. 5s) and press reset before attaching the debugger.
  
Back to top
 
IP Logged
 
ksupinger
Newbies
*
Offline


Posts: 5
Joined: Jun 24th, 2020
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #7 - Jun 25th, 2020 at 5:01am
Print Post  
Is there some documentation on how to do this? There are 32 projects in the solution. Or is it better to uninstall and re-install an earlier version. It appears to have happened when openocd-0.10.0.20200213 was installed, which was the last message before this. This is the first time setup code has been skipped over in debug, ever. I'll try the work around, but without an example my success will be questionable. Thanks
  
Back to top
 
IP Logged
 
ksupinger
Newbies
*
Offline


Posts: 5
Joined: Jun 24th, 2020
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #8 - Jun 25th, 2020 at 5:48am
Print Post  
Well I tried first by putting breakpoint in main.cpp, nothing.
Saved the output from micro build debugger launch. Then added a Customer debugger file using the project add. Copied the json into the debugger file. -c \"init;reset halt\""

When ran debug the micro build output showed the same debug server args as before without the ;reset halt as -c init
-c \"source [find target/at91sam3ax_8x.cfg]\" -c \"init\"", that didn't work either. 

Tried the 5000 millisec delay with reset and debugger couldn't attach.

Renamed debuger custom file with .txt added to upload
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #9 - Jun 25th, 2020 at 9:33am
Print Post  
Rolling back to an earlier version is possible but not recommended, as OpenOCD has had a number of improvements which were added over the previous year to that project.  It would also mean staying on an older version of Visual Micro as we only support the latest version of OpenOCD in our latest software.

There is documentation on the JSON file additions and changes on the Debugging Using Custom Hardware page.

When using the JSON, the debugger needs to be changed to "Manual / Custom" to take effect - apologies for missing this step.

Does changing the Debugger to Manual / Custom with the JSON File in place improve things?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #10 - Jun 26th, 2020 at 2:11pm
Print Post  
There is a new release available from the below forum page (20.06.18.5), which should resolve this problem.

Previous Releases, New Releases and Notifications

When you now run "Debug > Start Debugging" it will perform the upload, and ensure the board is reset as the debugger automatically attaches, so you can debug setup().

If you run "Debug > Attach to Process" it won't reset the board on attach, so you can inspect the current situation.
  
Back to top
 
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #11 - Jun 26th, 2020 at 2:23pm
Print Post  
[SOLVED] Hi, I have download and install the Visual Micro 20.06.18.5 for VS2017/2019 to fix this issue. I have tested with breakpoints in Setup and now Work Well Grin Grin Cool . thanks a lot!!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #12 - Jun 26th, 2020 at 2:31pm
Print Post  
Thanks for the great reports and patience.
  
Back to top
WWW  
IP Logged
 
Marco (Italy)
Full Member
***
Offline


Posts: 165
Joined: Jul 12th, 2019
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #13 - Jun 26th, 2020 at 2:35pm
Print Post  
We are a Team!!   Visual Micro...  super !!! Grin
  
Back to top
 
IP Logged
 
ksupinger
Newbies
*
Offline


Posts: 5
Joined: Jun 24th, 2020
Re: Breakpoints with Atmel ICE +VS+vMicro are ignored on setup area code
Reply #14 - Jun 27th, 2020 at 12:49am
Print Post  
Yes, it works again!
Thanks so much you guys rock!!!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint