hi
ich hab ein kleines Problem.
µC ist ein LPC1768
IDE CoIDE (http://www.coocox.org/CooCox_CoIDE.htm)
Ich habe eine Datenstruktur [4096] und möchste diese vorbelegen.
In dem HEX/BIN file sollen diese vor dem flashen geändert werden.
Im linkerscript habe ich eine section angelegt die ab Adresse
0x00078000 beginnt. Das ist quasi der EEPROM bereich...
1 | MEMORY
|
2 | {
|
3 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00078000
|
4 | rom1 (rx) : ORIGIN = 0x00078000, LENGTH = 0x00008000
|
5 | ram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
|
6 | ram1 (rwx) : ORIGIN = 0x2007C000, LENGTH = 32K
|
7 | }
|
8 | .eeprom : ALIGN(4)
|
9 | {
|
10 | KEEP (*(.eeprom))
|
11 | } > rom1
|
in der main.c steht nun folgendes :
1 | __attribute__ ((aligned(4)))
|
2 | const device_t deveep __attribute__((__section__(".eeprom"),used))= {
|
3 | .memstat = 0x00,
|
4 | .serial[5] = 0x01,
|
5 | .serial[6] = 0x23,
|
6 | .serial[7] = 0x47,
|
7 | };
|
nach dem kompilieren ist dies auch korrekt in dem mapfile zu finden.
1 | .eeprom 0x00078000 0x1000
|
2 | *(.eeprom)
|
3 | .eeprom 0x00078000 0x1000 ..\obj\main.o
|
4 | 0x00078000 deveep
|
5 | [/c
|
6 | alle Daten stehen auch korrekt in dem struct.
|
7 |
|
8 |
|
9 |
|
10 | Nun zu meinem Problem:
|
11 | Da das ganze nun recht unübersichlich groß ist, wollte ich die vorbelegten Daten verkleinern.
|
12 | Anpassung im linker:
|
13 | [c]
|
14 | MEMORY
|
15 | {
|
16 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x0007F000
|
17 | rom1 (rx) : ORIGIN = 0x0007F000, LENGTH = 0x00001000
|
18 | ram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
|
19 | ram1 (rwx) : ORIGIN = 0x2007C000, LENGTH = 32K
|
20 | }
|
21 | .eeprom : ALIGN(4)
|
22 | {
|
23 | KEEP (*(.eeprom))
|
24 | } > rom1
|
in der main.c:
1 | __attribute__ ((aligned(4)))
|
2 | const uint8_t eep[8] __attribute__((__section__(".eeprom"),used))=
|
3 | {0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x23, 0x47};
|
nach dem kompilieren:
1 | .eeprom 0x0007f000 0x8
|
2 | *(.eeprom)
|
3 | .eeprom 0x0007f000 0x8 ..\obj\main.o
|
4 | 0x0007f000 deveep
|
5 | [/c
|
6 |
|
7 |
|
8 |
|
9 | Das blöde ist nur ... es stehen keine Daten drin.
|
10 | nur ein übliches 0xFF
|
11 |
|
12 |
|
13 | im HEX file steht folgendes:
|
14 | [c]
|
15 | :0200000270008C
|
16 | :08F0000000000000000123479D
|
17 | :00000001FF
|
das sagt mir das es eigentlich drin stehen müsste...
jemand eine idee?