Forum: Compiler & IDEs sections + ld script


von Mario (Gast)


Lesenswert?

Hallo...

Ich versuche über ein Linkerscript eine bestimmte Section an eine 
bestimmte Stelle im Flash zu schreiben.
Allem Anschein nach funktioniert das auch ohne Fehler.

Überprüfe ich jedoch das *.map File so steht der Wert bzw. die Konstante 
die sich in dieser section befindet an der falschen Adresse.

Ach ja es handelt sich um die section "poof". Diese taucht im *.map File 
direkt hinter .data bei 0x104007b0 auf?

Hier einmal ein Auszug aus dem Linkerscript:
1
SECTIONS 
2
{  
3
    
4
  . = 0x10400000; /* set location counter to address zero */ 
5
  .text :     /* collect all sections that should go into FLASH after startup */ 
6
  { 
7
    *(.text)       /* all .text sections (code) */ 
8
    *(.rodata)       /* all .rodata sections (constants, strings, etc.) */ 
9
    *(.rodata*)     /* all .rodata* sections (constants, strings, etc.) */ 
10
    *(.glue_7)       /* all .glue_7 sections (no idea what these are) */ 
11
    *(.glue_7t)     /* all .glue_7t sections (no idea what these are) */
12
  } >flash         /* put all the above into FLASH */ 
13
14
  .data :         /* collect all initialized .data sections that go into RAM */ 
15
  { 
16
    *(.data)       /* all .data sections */ 
17
  } >flash     /* put all the above into RAM (but load the LMA initializer copy into FLASH) */ 
18
19
  .bss :           /* collect all uninitialized .bss sections that go into RAM */ 
20
  { 
21
    *(.bss)       /* all .bss sections */ 
22
  } >ram           /* put all the above in RAM (it will be cleared in the startup code */ 
23
24
  . = ALIGN(4);       /* advance location counter to the next 32-bit boundary */ 
25
  _bss_end = . ;       /* define a global symbol marking the end of the .bss section */ 
26
27
  
28
  . = 0x104FF800;
29
  poof :
30
  { 
31
    *(poof) 
32
  }>flash
33
34
}

Ich weiss wirklich nicht woran das liegt...

Vielen Dank für Eure Hilfe...

von Fabian S. (rosepeter)


Lesenswert?

> Hier einmal ein Auszug aus dem Linkerscript:

hm, das ist ja zunächst mal noch kein vollständiges Binderskript, 
zumindest hast du die Definition der Memory-Regions nicht angegeben, ich 
gehe einfach mal davon aus, dass die passen oder gibt es irgendwelche 
Warnungen beim Binden?

Übergibst du das Binderskript mit -T oder "einfach so" - in letzterem 
Fall könnte ja das "eingebaute" Binderskript noch Probleme bereiten.

Ansonsten - hast du es schon mal so probiert:
1
  poof 0x104FF800 :
2
   {
3
     *(poof)
4
   }>flash

Auf den ersten Blick würde ich aber sagen, das von dir gepostete 
Binderskript sollte tun, auch denn ich deine .data-Sektion etwas seltsam 
finde - da vermisse ich das "AT (...)", außerdem sollte die ja 
eigentlich ins RAM, nicht ins Flash.

Ciao, Fabian

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.