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 Adafruit Feather 32u4 Hardware Debug (Read 2344 times)
Gio
Junior Member
**
Offline


Posts: 11
Joined: Feb 6th, 2022
Adafruit Feather 32u4 Hardware Debug
Feb 7th, 2022 at 11:08am
Print Post  
Hi, I'm new to Arduino and Visual Micro. 
I am using Microsoft Visual Studio Community 2022 under windows 10, Visual Micro and Adafruit Feather 32u4. 
I have been trying for days to perform hardware debugging with both "GDB Sub" and Custom but every attempt returns the error: "Unable to start debugging. Unexpected GDB output from command" -exec-run ". Don't know how to run . Try "help target". "
I have tried to follow the guide: https://www.visualmicro.com/page/AVR-Debugging.aspx
but am struggling as to which library to use.
I will appreciate any help.
Thank you.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Adafruit Feather 32u4 Hardware Debug
Reply #1 - Feb 7th, 2022 at 11:32am
Print Post  
Thanks for the report.

The library can be downloaded directly from the below location, for manual installation:
https://github.com/jdolinay/avr_debug

Or it can be installed from the Micro Explorer > Libraries Manager Tab, and searching for "avr-debugger".

The process for debugging is also walked through in the below video:
https://www.youtube.com/watch?v=s-EB0ykiUi8
  
Back to top
IP Logged
 
Gio
Junior Member
**
Offline


Posts: 11
Joined: Feb 6th, 2022
Re: Adafruit Feather 32u4 Hardware Debug
Reply #2 - Feb 7th, 2022 at 1:03pm
Print Post  
Thanks a lot for your fast answer.
i had tried with that library but i have many compilation errors, so I thought it was not good for the Adafruit feather 32u4.

Code
Select All
avr8-stub.c: In function uart_init

avr8-stub.c: 949:2: error: 'UCSR0A' undeclared (first use in this function); did you mean 'UCSR1A'?
   UCSR0A = _BV(U2X0);  \* double UART speed *
   ^~~~~~
   UCSR1A
avr8-stub.c:949: note  each undeclared identifier is reported only once for each function it appears in

io.h:99: In file included from
avr8-stub.c:32: from

avr8-stub.c: 949:15: error: 'U2X0' undeclared (first use in this function); did you mean 'U2X1'?
   UCSR0A = _BV(U2X0);  \* double UART speed *

avr8-stub.c: 950:2: error: 'UCSR0B' undeclared (first use in this function); did you mean 'UCSR0A'?
   UCSR0B = (1 << RXEN0 ) | (1 << TXEN0 );  \* enable RX and Tx *
   ^~~~~~
   UCSR0A

avr8-stub.c: 950:17: error: 'RXEN0' undeclared (first use in this function); did you mean 'RXEN1'?
   UCSR0B = (1 << RXEN0 ) | (1 << TXEN0 );  \* enable RX and Tx *
Error compiling libraries
   ^~~~~
Build failed for project 'Prova'
   RXEN1

avr8-stub.c: 950:33: error: 'TXEN0' undeclared (first use in this function); did you mean 'RXEN0'?
   UCSR0B = (1 << RXEN0 ) | (1 << TXEN0 );  \* enable RX and Tx *
   ^~~~~
   RXEN0

avr8-stub.c: 951:2: error: 'UCSR0C' undeclared (first use in this function); did you mean 'UCSR0B'?
   UCSR0C =  (1 << UCSZ00 ) | (1 << UCSZ01 ); \* Use 8- bit character sizes *
   ^~~~~~
   UCSR0B

avr8-stub.c: 951:18: error: 'UCSZ00' undeclared (first use in this function); did you mean 'UCSZ10'?
   UCSR0C =  (1 << UCSZ00 ) | (1 << UCSZ01 ); \* Use 8- bit character sizes *
   ^~~~~~
   UCSZ10

avr8-stub.c: 951:35: error: 'UCSZ01' undeclared (first use in this function); did you mean 'UCSZ00'?
   UCSR0C =  (1 << UCSZ00 ) | (1 << UCSZ01 ); \* Use 8- bit character sizes *
   ^~~~~~
   UCSZ00

avr8-stub.c: 952:2: error: 'UBRR0H' undeclared (first use in this function); did you mean 'UBRR1H'?
   UBRR0H = ( GDB_BAUD_PRESCALE >> 8)
   ^~~~~~
   UBRR1H

avr8-stub.c: 953:2: error: 'UBRR0L' undeclared (first use in this function); did you mean 'UBRR0H'?
   UBRR0L = GDB_BAUD_PRESCALE
   ^~~~~~
   UBRR0H

avr8-stub.c: 954:18: error: 'RXCIE0' undeclared (first use in this function); did you mean 'RXCIE1'?
   UCSR0B |= (1 << RXCIE0 ); \* Enable the USART Recieve Complete interrupt ( USART_RXC ) *
   ^~~~~~
   RXCIE1

avr8-stub.c: In function getDebugChar

avr8-stub.c: 962:12: error: 'UCSR0A' undeclared (first use in this function); did you mean 'UCSR1A'?
   while ( !(UCSR0A & (1<<RXC0)) )
   ^~~~~~
   UCSR1A

avr8-stub.c: 962:25: error: 'RXC0' undeclared (first use in this function); did you mean 'RXC1'?
   while ( !(UCSR0A & (1<<RXC0)) )
   ^~~~
   RXC1

avr8-stub.c: 965:18: error: 'UDR0' undeclared (first use in this function); did you mean 'UDR1'?
   return (uint8_t)UDR0
   ^~~~
   UDR1

avr8-stub.c: In function putDebugChar

avr8-stub.c: 972:13: error: 'UCSR0A' undeclared (first use in this function); did you mean 'UCSR1A'?
   while ( !( UCSR0A & (1<<UDRE0)) )
   ^~~~~~
   UCSR1A

avr8-stub.c: 972:26: error: 'UDRE0' undeclared (first use in this function); did you mean 'UDRE1'?
   while ( !( UCSR0A & (1<<UDRE0)) )
   ^~~~~
   UDRE1

avr8-stub.c: 976:2: error: 'UDR0' undeclared (first use in this function); did you mean 'UDRE0'?
   UDR0 = c
   ^~~~
   UDRE0

avr8-stub.c: In function __vector_1

avr8-stub.c: 1026:32: error: 'UCSR0A' undeclared (first use in this function); did you mean 'UCSR1A'?
   #define UART_RXINT_PENDING()  (UCSR0A & (1<<RXC0))
avr8-stub.c:2046: note  in expansion of macro UART_RXINT_PENDING
   if ( UART_RXINT_PENDING() ) {
   ^~~~~~~~~~~~~~~~~~

avr8-stub.c: 1026:45: error: 'RXC0' undeclared (first use in this function); did you mean 'RXC1'?
   #define UART_RXINT_PENDING()  (UCSR0A & (1<<RXC0))
avr8-stub.c:2046: note  in expansion of macro UART_RXINT_PENDING
   if ( UART_RXINT_PENDING() ) {
   ^~~~~~~~~~~~~~~~~~

 


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


Posts: 2441
Joined: Feb 13th, 2019
Re: Adafruit Feather 32u4 Hardware Debug
Reply #3 - Feb 7th, 2022 at 1:43pm
Print Post  
Thanks for the detail, and apologies it doesn't compile for this board.

The vMicro Serial debugger should work as expected, with an overview shown here of the features:
https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Explained.html

There is also a detailed guide for the Serial debugger as a walkthrough below:
https://www.visualmicro.com/page/User-Guide.aspx?doc=Debugging-Walkthrough-Start...
  
Back to top
IP Logged
 
Gio
Junior Member
**
Offline


Posts: 11
Joined: Feb 6th, 2022
Re: Adafruit Feather 32u4 Hardware Debug
Reply #4 - Feb 7th, 2022 at 3:51pm
Print Post  
Thanks for you support.
I know and just tested serial debugging however it is not what i am looking for. So Visual Micro hardware debugging doesn't support it, right?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2441
Joined: Feb 13th, 2019
Re: Adafruit Feather 32u4 Hardware Debug
Reply #5 - Feb 7th, 2022 at 5:40pm
Print Post  
The GDBStub implementation from the library detailed doesn't appear to work for this board no, and at present we haven't integrated other external debug probes for the ATMega chips as it often requires changing fuse bits on the chip to enable those features.

If you have an external debug probe e.g. Atmel ICE, it may be possible to debug in Atmel Studio, which also provides the fuse bit facility as well, whilst using Visual Micro.

The only alternative I have seen is to run your code in an emulator using SimAVR, with virtual peripherals, however this is not something I have used before:
http://fabricesalvaire.github.io/simavr/gitorious-get-started.html
  
Back to top
IP Logged
 
Gio
Junior Member
**
Offline


Posts: 11
Joined: Feb 6th, 2022
Re: Adafruit Feather 32u4 Hardware Debug
Reply #6 - Feb 7th, 2022 at 6:05pm
Print Post  
Thanks Simon,
I'm sad, I like Visual Micro much more than others that debug Adafruit cards with Atmel AVR on board. I therefore believe that all Adafruit cards with integrated debugging cannot work. I was hoping to use the custom and openocd solution.
Thank you.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint