Forum: Compiler & IDEs Arduino avr-stub debugging


von Christoph M. (mchris)


Lesenswert?

Gerade bin ich über "avr-stub" gestolpert. Damit ist es scheinbar 
möglich, einen Atmega328 ohne Debugger zu debuggen:

https://docs.platformio.org/en/stable/plus/debug-tools/avr-stub.html

https://www.youtube.com/watch?v=7wx27FcluMg

Weis jemand, wie der Mechanismus genau funktioniert? Wird hier bei jedem 
Breakpoint das Flash umprogrammiert?

von Rolf M. (rmagnus)


Lesenswert?

Christoph M. schrieb:
> Weis jemand, wie der Mechanismus genau funktioniert? Wird hier bei jedem
> Breakpoint das Flash umprogrammiert?

Das ist doch alles ausführlich in der Dokumentation erklärt.

von Bauform B. (bauformb)


Lesenswert?

Christoph M. schrieb:
> Wird hier bei jedem Breakpoint das Flash umprogrammiert?

Und nicht nur einmal
1
The flash memory is overwritten often when debugging with flash
2
breakpoints. The flash memory in the Atmel AVR MCUs used in Arduino
3
should survive about 10 thousand rewrites. When breakpoint is
4
inserted or removed, part of the memory needs to be rewritten.
5
6
To make things worse breakpoints are inserted and removed not only
7
when you actually insert/remove a breakpoint in the IDE but also
8
automatically when you continue from a breakpoint (the original
9
instruction needs to be restored and executed) and also sometimes
10
when you step through the code the debugger will insert temporary
11
breakpoint, for example to stop the program after stepping over
12
a function.
13
14
In worst case you, you can expect one write to flash memory for
15
each step/continue click you do in the IDE. This seems scary but
16
it is still usable and similar to using the debugWIRE hardware
17
on-chip debugger module.
Ein gutes Argument für ATmega im DIL-Gehäuse mit Sockel :)
Das meinen die doch nicht ernst? Das ist doch eine Demo "gdb stub 
funktioniert auch auf ATmega"? Interessant, keine Frage, aber benutzbar?

von Harald K. (kirnbichler)


Lesenswert?

Bauform B. schrieb:
> Das meinen die doch nicht ernst?

Doch, natürlich. Die gehen halt nicht davon aus, daß man nur einen µC 
hat, und den auf Jahre immer und immer wieder für's Debuggen rauskramt.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.