EmbDev.net

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

Author: Ruvinda Dhambarage (Company: NA) (ruvindad)
Posted on:

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.
Author: na sowas (Guest)
Posted on:

> 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?
Author: Ruvinda Dhambarage (Company: NA) (ruvindad)
Posted on:

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.
Author: klaus (Guest)
Posted on:

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 ?

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]






webmaster@embdev.netContactAdvertising on EmbDev.net