Arduino avr-stub debugging

#7481054
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?

#7481429
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?

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren