EmbDev.net

Forum: ARM programming with GCC/GNU tools Memory allocation failure


Author: Guest (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi all,
I have a c code which contains memory allocation functions calloc.I have
ported the code to ARM7 using Winarm.I have provided the system call
wrappers while porting.But while running the code in arm board memory
allocation fails.i Have 64 mb ram on board.Does the code need any
initialization??

Regards
mk

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
Guest wrote:

> I have a c code which contains memory allocation functions calloc.I have
> ported the code to ARM7 using Winarm.I have provided the system call
> wrappers while porting.

Please show your sbrk-implementation. It is difficult to comment without
seeing the implemenation.

> But while running the code in arm board memory
> allocation fails.i Have 64 mb ram on board.Does the code need any
> initialization??

Which target? There might be an some kind of memory-bus initialisation
needed or some kind of remapping. Please show the startup-code.

- Is the the heap-start-address set correctly in the linker-script?
(something like "provide (end = _HEAP_START_)" or "provide (end = .)")
if the label "end" is used for the sbrk-init
- Is the (correct) heap-start-address value visible to sbrk?

Create a minimal example for the toolchain for which the original code
has been developed. Verify it works. Port the minimal example to the
GNU-toolchain, verify you see the same problem as with your "real"
application, pack everything (source incl. startup-code, linker-script,
makefile) together and place it on an "internet-server" and post the URL
here. If the other toolchain does not use linker-scripts and makefiles
try to find the "linker-setup-files" and "project-defintion-files" and
include them in the archive.

> Regards
> mk
Personaly I still prefer real names instead of pseudonyms and initials.


Martin Thomas

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]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.