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
Normal Topic Hardware-based debugging with Xplained boards (Microchip Studio) (Read 1660 times)
Michèle
Newbies
*
Offline


Posts: 2
Joined: Mar 6th, 2023
Hardware-based debugging with Xplained boards (Microchip Studio)
Apr 29th, 2023 at 11:54am
Print Post  
I have created a rather large Arduino C++ application, A beehive weighing system (15000 lies, 35 files). Debugging time got to be out of proportion relative to algorithm development time. I was using print-based debugging (i.e., look at variables via Serial.prints).

Hardware-based debugging would be a valuable complementary resource to watch variables, stop and look at variables by setting break points, look at memory and a lot more. My thinking was develop with MicrochipStudio, debug with Atmel ICE since it is a Microchip product. I managed to brick a few ATmega2560 boards and gave up. I then found the ATmega328P Xplained Xmini and the ATmega256RFR2 Xplained Xmini boards. Fantastic, let me explain.

The 328 Xplained board is Uno pin compatible, the 2560 Xplained board IS NOT ATmega2560 board pin compatible.

Upon hooking up either board into your computer and opening MicrochipStudio, you will discover that MicrochipStudio has discovered the board. Icing on the cake, when you do a build, it uploads the executable into the microcontroller. From then on you can hardware-debug to your heart's content. 

The MicrochipStudio/Xplained board combination is truly plug and play.

But there is a dark side: you cannot do the above if the Visual Micro plug-in has been installed.

My recommendation is:
    1 - Develop with Visual Studio 2022 and the Visual Micro plugin.
    2 - Hardware debug with the MicrochipStudio/Xplained boards.

You can do this by setting up interoperability with the two IDEs.

Happy debugging.
Michèle
« Last Edit: May 3rd, 2023 at 7:25pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Hardware-based debugging with Xplained boards
Reply #1 - Apr 29th, 2023 at 7:39pm
Print Post  
Thanks for the post, the Uno compatibility is certainly useful for people to know. 

The AVR boards from Atmel have some complictions, the Uno (328) especially. Microchip Studio (formerly called Atmel Studio) is the best IDE to use hardware debug with them. For all other hardware debuggers Visual Studio 2022 is the best tool.

That said, for some people, the GDB stub opion in Visual Studio 2022 for the Uno, works well but has a couple of drawbacks such as hogging the serial port.

We normally only recommend hardware debug of Uno for experts because of the potential to brick the MCU if the wrong fuses are set. All other Microcntrollers we see do not need fuses to be set and do not suffer the potential issue. However as stated, your observation about  Xplained 328 being a safe and compatible alternative is very useful. We will look at adding the hardware ICE debug support for the  Xplained boards into Vs 2022 in a future release.

Thanks again

 




  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Hardware-based debugging with Xplained boards
Reply #2 - Apr 29th, 2023 at 8:33pm
Print Post  
+ This statemnt is not entirely clear. 

Quote:
But there is a dark side: you cannot do the above if the Visual Micro plug-in has been installed.

 

If you are saying that you can't debug an xplained .ino project in Microchip Studio when Visual Micro is installed then please confirm what you set the vMicro > programmer and the vMicro debugger to?

Thanks




  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Hardware-based debugging with Xplained boards
Reply #3 - May 3rd, 2023 at 6:53pm
Print Post  
Should we close this log? 

Can we assume that you have now seen the ability to set vMicro upload and debug to use Microchip Studio tools instead of Arduino tools It should be a good combination for you. 

Also assume that you have installed the version of Visual Micro for Microchip Studio from the downloads page on visualmicro.com (as mentioned on the microchip gallery page)? That resolves an issue with programmer selection.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint