before recompiling code i'm ask to stop debugging MK2

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

Everytime I change my code, studio6 ask me if I want to stop debugging.
Why is this ? and can this pop up screen be disabled ?
It there maybe a pre-compile command which disconnects without getting these pop up messages ?
The problem is that it disconnects the MK2.

With IAR and Studio4 it just asked once: object code has changed, do you want to load ?

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

Quote:
Everytime I change my code, studio6 ask me if I want to stop debugging.
It only asks me when I want to BUILD/REBUILD the code not when I edit the code if I am into a debug session.

If you are doing changes to the code and want to continue the debugging session use RESTART from the debug tab.
If the code compiles without errors then the new code gets downloaded into the chip and the debug restarts.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

The debugger works from COMPILED code loaded into the simulator or a live chip.

If you change something, the code in your editor window no longer matches what is being debugged. So, it HAS to be recompiled. It will not recompile while debugging.

Consider the following scenario as to why this is necessary.

1. Suppose, during the initialization, you have X = 2;

2. Now, after running a bit, you decide it should be X = 3;

3. You make that change but your breakpoint is well after this statement.

4. The program would have behaved differently if it had run with X=3 but it did not since it ran with X = 2.

5. So, you have changed it, but the program no longer behaves according to the change you made.

6. At the very minimum, it must restart to be a valid simulation.

7. In debugging, that code is running from a program that is downloaded into the target machine. Often, the SAME link is used for program downloading and debugging. The compiler can only generate the code to be downloaded by recompiling. It simply cannot do all this while debugging and, as described in steps 1-6, there is no point trying.

Solution: stop debugging before changing code.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

ka7ehk wrote:
The debugger works from COMPILED code loaded into the simulator or a live chip.

If you change something, the code in your editor window no longer matches what is being debugged. So, it HAS to be recompiled. It will not recompile while debugging.

Solution: stop debugging before changing code.

Jim

Eyes get really big... I guess this is just a but but AVR Studio 4 whine, but with AVR Studio 4 I do this all the time. I often have several debug sessions going at once, and am editing while letting the various bits of firmware go through their paces. If I can't do this, this is really bad for me.

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

So, if you have several debug sessions going at once, which one represents the code actually IN the chip?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

Building your project has nothing to do with debugging it on an mkii for example. So the debugging of your previous version should not stop.

Once you stop the debugger, than the debugger finds out that new code is available and only than it should ask to reload or not.

This was the way it worked with Studio4 in combination with for example IAR compiler.

My point is, during developing you want as littel annoying pop up screens as possible.

The same counts for the Terminal window (part of Studio6). Every time you stop debugging it closes the terminal window and disconnects the serial port.

Again this is a total different process. It should not close this window. Everytime you reload, you have to open the terminal window and connect to the serial port again. These are in my view unnesceserry actions.

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

Quote:
It should not close this window
I don't bother with the AS6 terminal, I have several terminal programs I use all the time.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Quote:

The same counts for the Terminal window (part of Studio6). Every time you stop debugging it closes the terminal window and disconnects the serial port.

I've added internal bug AVRSV-4245 regarding this.

The reason for the disconnect is that the "perspective" changes between debug and normal coding, and hides the Terminal. To avoid serial port locking, the terminal disconnects from any active connection when it is hidden.

You could maybe alleviate the issue by floating the terminal, but then it probably becomes a bit more intrusive

:: 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.