Arduino avr-stub debugging

OP #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

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.