Microchip Studio + Atmel-ICE, can't step inside function.

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

Hi

I have a problem with Microchip Studio + Atmel-ICE.

I can upload the program on the board (MKRWiFi1010), I can go step-to step, I can set a breakpoint:

 

 

But if I press F11 (Step inside) I can't go inside the function and the line became green:

 

 

Can anyone explain this behavior to me?

When I Clean Solution and Build is show a warning:

 

Command Line Exceeds Limit libArduinoCore.a   

 

Any relation to this?

 

Thank you

Livio

Last Edited: Mon. Feb 8, 2021 - 06:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have the source for that function?

 

If it's coming via a ready-built binary library, was that library built with debug info?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 
Yes, I have the source.
This thing happens a few times, it looks like doing: Clean Solution and Build Solution the problem disappears.

 
I still have a problem. The step-by-step function doesn't work well for me, in some areas it takes steps forward and then steps back and then forward again, has anyone noticed?
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rlivio wrote:
The step-by-step function doesn't work well for me, in some areas it takes steps forward and then steps back and then forward again,

That's Optimisation.

 

https://www.avrfreaks.net/forum/tutcoptimization-and-importance-volatile-gcc

 

 Even without optimisation, the generated code won't always follow the source linearly; eg, a 'for' loop will often have the test condition at the end - so will appear to "start" at the end ...

 

You need to understand what a C program really means: https://blog.regehr.org/archives/28

 

EDIT

 

See: https://www.avrfreaks.net/commen...

 

EDIT

 

What optimisation setting are you using?

 

-Og is the one intended for the "best debugging experience"

 

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Feb 9, 2021 - 09:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, I will read you link.

In fact sometimes it is really difficult to follow it step by step, when I wrote in Assembler it was easier.smiley

Now the Optimisation is  -Os,  I will change for debugging.

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

Is the file that contains that function being built with "-g" ?

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

clawson wrote:
Is the file that contains that function being built with "-g" ?

 

Yes now I set Optimization Level: Optimize debugging experience (-Og), goes better, thank you.

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

Not what I asked/meant (-Og is only distantly related to -g) but if it helps... ;-)

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

clawson wrote:
Not what I asked/meant (-Og is only distantly related to -g) but if it helps... ;-)

 

Sorry, I don't know where to set this -g

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

It will depend on your build system. -g is simply the switch that sys "build this with debug tracking info included". If you have a final link where some of the objects are built -g and some are not then as you step and "go into" code without the -g info the debugger will either simply switch to Asm or will pop up to say "no debug info". Your experience sounded a lot like this which is why I thought that when the source containing the Ethernet class was built maybe that bit of the code had been built without -g. That's all.

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

My system is Microchip Studio with two projects in one Solution, ArduinoCore and my project.

In both the project I can set the Optimitazion in two places each, ARM/GNU C Compiler and ARM/GNU C++ Compiler.

I have set in this four place: Optimization level: Optimize debugging experience (-Og)

I haven't done much testing yet, but it seems to be doing better.

Thank you Clawson

Livio

Last Edited: Wed. Feb 17, 2021 - 05:29 AM