BrianSidebotham/arm-tutorial-rpi

malloc (_sbrk) hangs in arm013

Closed this issue · 1 comments

Hi,

Since you moved the stack from the end of the RAM to before the code (and before the heap) the _sbrk function will hang always because the following condition will be always true:
(heap_end + incr) > _get_stack_pointer()

If the stack is before the heap then I would check something like this:
(heap_end + incr) > END_OF_RAM

Regards,
Bertalan

Hi Bertalan,

Thanks for reporting this! Sorry I didn't see it earlier. I've just fixed it in the current code base.

Best Regards, Brian.