Interrupt Vektoren beim ATmegaxx

Gast #76478
Lesenswert?

beim mega64 scheinen es immerhin knapp 0x88 = 136 Byte zu sein, wenn ich
das Linkerlisting richtig deute.

Bei einem Bootloader mit Daten-Entschlüsselung wäre das schon mal
hilfreich


Gruß Martin



Disassembly of section .text:

00000000 <__vectors>:
   0:  0c 94 85 01   jmp  0x30a
   4:  0c 94 a0 01   jmp  0x340
   8:  0c 94 a0 01   jmp  0x340
   c:  0c 94 a0 01   jmp  0x340
  10:  0c 94 a0 01   jmp  0x340
  14:  0c 94 a0 01   jmp  0x340
  18:  0c 94 a0 01   jmp  0x340
  1c:  0c 94 a0 01   jmp  0x340
  20:  0c 94 a0 01   jmp  0x340
  24:  0c 94 a0 01   jmp  0x340
  28:  0c 94 a0 01   jmp  0x340
  2c:  0c 94 a0 01   jmp  0x340
  30:  0c 94 a0 01   jmp  0x340
  34:  0c 94 a0 01   jmp  0x340
  38:  0c 94 a0 01   jmp  0x340
  3c:  0c 94 a0 01   jmp  0x340
  40:  0c 94 a0 01   jmp  0x340
  44:  0c 94 a0 01   jmp  0x340
  48:  0c 94 a0 01   jmp  0x340
  4c:  0c 94 a0 01   jmp  0x340
  50:  0c 94 a0 01   jmp  0x340
  54:  0c 94 a0 01   jmp  0x340
  58:  0c 94 a0 01   jmp  0x340
  5c:  0c 94 a0 01   jmp  0x340
  60:  0c 94 a0 01   jmp  0x340
  64:  0c 94 a0 01   jmp  0x340
  68:  0c 94 a0 01   jmp  0x340
  6c:  0c 94 a0 01   jmp  0x340
  70:  0c 94 a0 01   jmp  0x340
  74:  0c 94 a0 01   jmp  0x340
  78:  0c 94 a0 01   jmp  0x340
  7c:  0c 94 a0 01   jmp  0x340
  80:  0c 94 a0 01   jmp  0x340
  84:  0c 94 a0 01   jmp  0x340
  88:  0c 94 a0 01   jmp  0x340

0000008c <__ctors_end>:
  8c:  d3 dd         rc
immerh
Gast #76479
Lesenswert?

Beim einem Bootloader funktioniert es mit einem "Trick":
Beschrieben ist das (etwas kryptisch) in der Dokumentation der
avr-libc.

Man versieht alle Funktionen, die im Bootloader benutzt werden mit
einem eigenen "section attribute" also z.B. BOOTLOADER nach dem
Beispiel der avr-libc/boot.h. Dann teilt man dem Linker mit, wo die
bootloader section abgelegt werden soll (also z.B. bei Byte-Adresse
0x3800). Der Interrupt Vector wird in die ".text" section abgelegt,
die typischerweise bei 0x0000 beginnt. Flasht man die
bootloader-hex-Datei wird der Interrupt-Vector bei 0x0000 geschrieben
(.text) und der Bootloader code bei der gegeben Startadresse fuer die
Bootloader Sektion. Sobald man nun eine Applikation ueber den
Bootloader auf den AVR programmiert, wird der ueberfluessige
Interrupt-Vektor aus dem Bootloader-Code mit dem "gewollten" der
Applikation ueberschrieben.
Gast #76482
Lesenswert?

Hallo Martin,
es gibt für den Linker eine option .noinit damit kann es verhindert
werden, das die Vektoren und Starup-code eingebunden werde. Siehe die
Docus avr libc manual bei memory sections.

Wolfgang

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