hi, Iam using gcc 4.1.0 to compile code for a ARM922T. my code runs from the internal 64KB SRAM. when i run some functions it gets stuck or behaves unexpectedly when the .bin file gets larger than ~28KB. curiously, its the functions in the .o files that i added last that gets stuck. The functions in the .o which were added first, work without getting stuck. what are the possible causes? thanks.
> my code runs from the internal 64KB SRAM. > what are the possible causes? My assumption is: Stack Overflow Do you have lots of variables, lokal variables, big arrays oder arrays of structs?
Yes! there are quite a bit of variables. but i dont think that it is a stack overflow because, i dont have to call several nested functions to make the code get stuck. a particular function will get stuck if the .bin >~28KB and if the .o file it contains in is added at the end. e.g. ...... OBJECTS+= Test1.o OBJECTS+= Test2.o OBJECTS+= Test3.o OBJECTS+= Test4.o ....... if I run a function "func4()" from Test4.o, it gets stuck. but if I add that file sooner, i.e. ...... OBJECTS+= Test1.o OBJECTS+= Test4.o OBJECTS+= Test2.o OBJECTS+= Test3.o ....... now "func4()" will run, but "func3()" from Test3.o will get stuck. hope this will make my problem clear.
Is the stack or heap initially cleared by the startup code ? If your stack overlaps your program code this can explain the problem. Do you want to post the linker script ?