MPLAB Snap and atbackend

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

  I'm trying unsuccessfully to select snap as a tool in atbackend 1.13.4972 (  Atmel Studio 7.0.2397 ) through gdb using the monitor tool commands :

 

(gdb)
com.atmel.avrdbg.tool.simulator
com.atmel.avrdbg.tool.medbg     XYS by Vidmo  ISP/01
com.atmel.avrdbg.tool.snap      BURXXXXXXXXX
(gdb) monitor tool snap
No tool of type snap connected
Protocol error with Rcmd
(gdb)

 

  As a hobbyist I used a "homemade" medbg programmer ( with the vidmo's updi or isp or swd firmware  ) with the atbackend and gdb, which worked, a "little" slow but fine.

 

  Now that I wanted to use a AVR128DA32 mcu, my medbg programmer, always fails to upload ( fuses or memories ) even with Atmel Studio ( yes the programmer is recognized in AS7, thx Vidmo ! ).  

 

  My goal is to use MPLAB Snap for the AVR128DAXX mcu's via atbackend  because I don't code in C, C++ ( so no Atmel Studio or MPLAB X ) but in Free Pascal using the Lazarus IDE.

 

  Any hint ?

 

regards,

 

--

Dimitrios

 

This topic has a solution.

Dimitrios Chr. Ioannidis

Last Edited: Tue. Jun 30, 2020 - 05:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is GDB a hard requirement? I have never used that so no help there but I use a java program (just in my use case) to call atbackend.exe via command line with snap as an argument and it works fine.

I have an older thread related to this https://www.avrfreaks.net/forum/....

Hope that helps.

-Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

samay wrote:

Is GDB a hard requirement?

 

Well, in my setup ( IDE -> gdb -> atbackend -> medbg -> mcu ) is the only way I found for reliable debugging, so I should say yes. 

 

I could code a gdb-to-mdb bridge and use a IDE -> gdb -> gdbtomdb -> mdb -> snap -> mcu .... but before descend into that rabbit hole, I thought to ask here first ....

 

regards,

 

Dimitrios Chr. Ioannidis

Last Edited: Sat. Jun 27, 2020 - 01:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR128DA32 has a 24-bit UPDI address space, which is not implemented on the mEDBG, which is probably why that doesn't work.

Sure your Snap is in CMSIS-DAP (AVR) mode?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

mraardvark wrote:

Sure your Snap is in CMSIS-DAP (AVR) mode?

 

 I think so.

 

 This is what AS7 reports ...

 

 

regards,

 

Dimitrios Chr. Ioannidis

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks legit.

Have you tried using atprogram.exe ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

mraardvark wrote:

Have you tried using atprogram.exe ?

 

I didn't but AFAIU atprogram is not suitable for debugging ... AFAIK, it doesn't have gdb proxying capabilities as atbackend has.

 

My use case is :

 

a) run atbackend.exe /avr8-gdb-ports=1234

b) from inside my IDE i start a gdb remote debugging session connecting to atbackend

c) before the session begins I execute :

  1) monitor tool medbg

  2) monitor device atmega328p debugwire

 

( the steps b and c is done by the IDE automatically )

 

and I'm able to upload and debug my firmware on the mcu ... With the snap tool I'm stuck at the c.1 step. I can't select the snap tool in atbackend. Atbackend can see that there is tool named snap connected but I can't find a way to select it as a debugging tool.

 

I don't think I can do the same with the atprogram ...

 

regards,

 

Dimitrios Chr. Ioannidis

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

True, atprogram does not support debugging.  I was just wondering if your Snap worked with Studio/atprogram in general.  (for mega328p a pack update was required to support snap.)

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The snap is not yet supported by the gdb proxy subsystem in atbackend. The support is added internally and will be available in the next Studio release (last time frame I've heard of is Q3 or Q4 2020, but take that with a grain of salt :) )

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi,

 

meolsen wrote:

The snap is not yet supported by the gdb proxy subsystem in atbackend. The support is added internally and will be available in the next Studio release (last time frame I've heard of is Q3 or Q4 2020, but take that with a grain of salt :) )

 

thank you very much !

 

regards,

 

Dimitrios Chr. Ioannidis