EmbDev.net

Forum: ARM programming with GCC/GNU tools program gets stuck when .bin > 28KB


von Ruvinda D. (Company: NA) (ruvindad)


Rate this post
useful
not useful
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.

von na sowas (Guest)


Rate this post
useful
not useful
> 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?

von Ruvinda D. (Company: NA) (ruvindad)


Rate this post
useful
not useful
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.

von klaus (Guest)


Rate this post
useful
not useful
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 ?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.