Hallo, ich habe ein kleines Problem mit Winarm. ich habe ein grosses Bild-Array, welches ich gerne ins Flash speichern möchte. Ich habe dieses Array mit const u16 ... deklariert. Damit ist es doch im Flash oder?? Dieses Array ist sehr groß, als Datei 156kB! Verkleinere ich dieses Array zum testen, habe ich keinen Fehler!! WinArm Meldung : Linking: main.elf arm-elf-gcc -mcpu=arm7tdmi -I. -gdwarf-2 -DROM_RUN -O0 -Wall -Wcast-align -Wcast-qual -Wimplicit -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=crt.lst -I../../inc -I../../conf -MD -MP -MF .dep/main.elf.d crt.s main.o uart.o startup.o vs1011.o spi_polling.o disp.o --output main.elf -nostartfiles -Wl,-Map=main.map,--cref -lc -lm -lc -lgcc -lefsl -L../../ -Tlpc2148-rom.ld c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: region ram is full (main.elf section .data) collect2: ld returned 1 exit status C:\WinARM\utils\bin\make.exe: *** [main.elf] Error 1 Ich hoffe es hat einer ne Lösung :-) world
// ------------------------------------------------------ // GLCD Picture name: house.bmp // GLCD Model: KS0108 128x64 // ------------------------------------------------------ unsigned char const house_bmp[1024] = { 0, 0, 0, 0, 4, 10, 58, 62,122,210,208,208,208,208,208, 48, 188, 60,172,172,246,247,255,110,254,190,126,126, 92,152, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128,128,128,128, 0,129,129,141,143,136,192, 80,208,200, 8, 8, 140, 12, 58, 58, 71,130,135, 0,161,208,112,240,160,166,166,153, 139,142,141,143, 15, 27, 23, 23, 27, 15, 15,143,190,187,191,159, 204,140,143,246,246,246,230,189,255,177,189,238,195, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 28,222,126,123, 57, 63,125,120, 15, 15, 3, 3, 65,193,225,193,192,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 29, 153,192, 66,199,132,132,133,135, 0, 0,128, 80,120, 81,113,118, 126, 63, 31, 22,227,253,248,224,192,193,194,194,194,195,129, 0, 1,131,131,191,191,230,234,234,188,248,241,195, 66, 71,129,133, 133,174,255,255,247,255,255,254,254,255,251,253,210,208, 0, 0, 0, 0, 0, 0, 32, 60, 52,247,254,241,245,239,255,188,182,254, 252,230,243,233,247,151,153,255,247,243,223,221,252,120,120,248, 104,120,248,112,112, 48, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 31, 31, 31, 31, 17, 17, 17, 17, 17, 17, 17, 18, 18, 25, 25, 44, 15, 31, 63, 63,111,127, 58, 63,119,119,255,191, 53, 22, 31, 11, 31, 31, 47, 63, 63,255,207,255,255, 47, 37, 0, 0, 0, 0, 0, 0, 0, 32,251,255,255,255,255,255,131,129,193, 227,227, 51, 55,229,199, 7, 15, 11, 27, 31, 28, 56,240, 96, 96, 97, 97, 97, 97, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,224, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 99, 98,102,108,248,240, 96, 96, 0,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 2, 23, 29, 33, 33,255,255,255,255,167,167, 58, 24,120,248,232,121,123,122,158,144, 0,252,158,159,127, 96,128, 14, 10, 10, 10, 10, 10, 10, 14, 0, 0, 0, 14, 10, 10, 10, 10, 10, 14, 14, 0, 0,128,255,248,232,192,192,254,254,254, 34, 34, 34, 34, 34, 34,254, 34, 34, 34, 34, 34, 34, 34,254,254,254, 50, 0, 0, 0,254,130,186, 58, 58, 98, 98, 98, 98, 2,254, 0, 0, 0,254,254,254,254, 34, 34, 34, 34,254,254, 34, 34, 34, 34, 34, 254,254,254,224,127,255,194,222,126,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128, 96,191,255,127,255,255,225,195, 207,140,137, 8, 8, 8, 8, 25, 63, 59, 11, 79, 79, 73,233,254, 168,160,160, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 60, 63, 39, 47, 63, 63,125, 73, 9,225, 64, 72, 120,120,120,121, 73, 65, 77, 81, 25,121, 73,121, 49,113, 73, 73, 200,200,120,127, 80, 81, 64, 64, 64, 80, 80,240,224,127, 24,152, 144,201,233,249,249, 56,136, 8,144,241,121,120,160,248,240,112, 9,121, 63,127,120,104, 77, 76,124,255,255,255,255,248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 3, 3, 6, 6, 12, 12, 24, 24, 16, 48, 32, 96, 96, 192,192,128,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 6, 6, 0, 0, 4, 0, 0, 2, 2, 34, 98, 98,208,209,145, 145, 16, 16, 16, 8, 8, 8, 4, 6, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128,192,192,224,224,248,231,239,255,119, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,128, 0,192,192,192,192,192,192, 192,192,192,192,192,192,192,192,192,192,192,192,192, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 96, 64, 64, 65, 65, 99, 99, 98,102,102,108,108,120,120,120,112,112, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 2, 6, 6, 12, 12, 24, 24, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 16, 16, 0, 0, 0, 0, 0, 0 };
Konstanten landen wohl im RAM, und der ist keine 156+x kiB groß. Entweder die Section (.text) in der C-Datei vorgeben oder am besten gleich ne eigene anlegen. Dazu steht was in der Doku. AFAIR irgendwie __section oder attribute section. irgendwas in der Richtung.
Der arm-*-gcc Compiler (der arm-elf-gcc in WinARM) sollte schon Arrays, die z.B. mit const unsigned char test[] = { ... } der c-Section rodata zuweisen, die man im Linker-Script dann in der Flash/ROM memory-section zuweist. Irgendwelche "Tricks" mit extra Attribute wie bei avr-gcc sind nicht erforderlich. Zur Diagnose: - testweise statt unsigned char const: const unsigend char - map-file erzeugen (Linkeroption -map) und nachsehen, ob das array .rodata zugwiesen wurde - im Linkerscript nachsehen, ob rodata auch dem Flashspeicher zugwiesen wird. In der Art:
1 | .text : |
2 | { |
3 | [...] |
4 | *(.rodata .rodata.*) |
5 | [...] |
6 | } > ROM |
Martin Thomas
hallo, ichhabe es hinbekommen mit der .text section!! danke world
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
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.