Forum: Mikrocontroller und Digitale Elektronik [ARM] Versionsinfo im Flash ablegen


von J. S. (jojos)


Lesenswert?

ich möchte eine Versionsinfo an eine feste Adresse im Flash ablegen. Die 
ist vom Bootloader und die danach startende Firmware soll diese Info 
auch finden können.
Dazu lege ich eine section an und im Code wird die Info Struktur die per 
gcc section attribute auf die Adresse gelegt, soweit ok.
Aber zum Linkerfile habe ich noch Fragen:
1
  .fini_array :
2
  {
3
    . = ALIGN(4);
4
    PROVIDE_HIDDEN (__fini_array_start = .);
5
    KEEP (*(SORT(.fini_array.*)))
6
    KEEP (*(.fini_array*))
7
    PROVIDE_HIDDEN (__fini_array_end = .);
8
    . = ALIGN(4);
9
  } >FLASH
10
11
  /* Used by the startup to initialize data */
12
  _sidata = LOADADDR(.data);
13
14
  /* Initialized data sections into "RAM_D1" Ram type memory */
15
  .data : 
16
  {
17
    . = ALIGN(4);
18
    _sdata = .;        /* create a global symbol at data start */
19
    *(.data)           /* .data sections */
20
    *(.data*)          /* .data* sections */
21
22
    . = ALIGN(4);
23
    _edata = .;        /* define a global symbol at data end */
24
    
25
  } >RAM_D1 AT> FLASH
26
27
  /* Modification start */
28
29
  .version_info_data :
30
  {
31
    . = ABSOLUTE(0x08040000 - 32);
32
    *(.version_info) 
33
  } >FLASH
34
  
35
  /* Modification end */
36
37
  /* Uninitialized data section into "RAM_D1" Ram type memory */
38
  . = ALIGN(4);
39
  .bss :
40
  {
41
    /* This is used by the startup in order to initialize the .bss section */
42
    _sbss = .;         /* define a global symbol at bss start */
43
    __bss_start__ = _sbss;
44
    *(.bss)
45
    *(.bss*)
46
    *(COMMON)
47
48
    . = ALIGN(4);
49
    _ebss = .;         /* define a global symbol at bss end */
50
    __bss_end__ = _ebss;
51
  } >RAM_D1

das erzeugt .version_info_data im Ram, warum?
1
.version_info_data
2
                0x000000000802262c    0x1d9b4
3
                0x000000000803ffe0                . = ABSOLUTE (0x803ffe0)
4
 *fill*         0x000000000802262c    0x1d9b4 
5
 *(.version_info)
6
                0x000000000803ffe0                . = ALIGN (0x4)

wenn ich die version_info_data Sektion vor .data definiere, dann bekomme 
ich einen Linkerfehler das .data nicht in das Flash passt weil die 
Startadresse dann schon auf Flash Ende steht.
Wie müsste das richtig aussehen?

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.