Look Here First

Curious why I created this blog? The following two posts explain it all. Click on the titles below to read more.

What this Blog is about.

Project Description.

Saturday, April 16, 2011

Game Design: Running Out of Ram

While coding the last bit of game, the compiler/linker setup game the following error.


Linking: main.elf
arm-elf-gcc -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2 -DROM_RUN  -D__WinARM__ -I ./Common_WinARM/src/ -Os -Wall -Wcast-align -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=Startup.lst  -I./SYSTEM/ -I././Common_WinARM/inc/ -Wcast-qual -MD -MP -MF .dep/main.elf.d Startup.o ./Common_WinARM/src/swi_handler.o  ./Common_WinARM/src/irq.o ./Common_WinARM/src/target.o ./Common_WinARM/src/timer.o main.o  system.o ./SYSTEM/syscalls.o  ./SYSTEM/rprintf.o  ./SYSTEM/serial.o MyLCD_Driver.o font.o gamescreen.o pacsprite.o MyAccelDriver.o Game.o IntersectionArray.o     --output main.elf -nostartfiles -Wl,-Map=main.map,--cref -lc  -lm -lc -lgcc     -Tmain_memory_block.ld 
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: region RAM is full (main.elf section .bss)
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld.exe: address 0x40008d00 of main.elf section .stack is not within region RAM
collect2: ld returned 1 exit status
make.exe: *** [main.elf] Error 1


The RAM space allocated by the linker had run out.  The student had planned on having two copies of the maze array, one that was the current maze, and one that stored the original state of the maze (so the user could do multiple levels.)  Having two copies of the array took 32kB or the 40 kB of static RAM available on the LPC2148.  With the program code and other memory needs, having multiple copies of the maze array is not feasible.  The Pac-Man game now only have one board.  There is certainly a way to store the backup array only non RAM memory, but due to the time constraint the student could not include such a feature.

No comments:

Post a Comment