Issues with dynamic memory allocation on bare metal cortex-m4 using rdimon
In the course of setting up TDD environment, I am trying to have dynamic memory allocation & semihosting for my bare-metal cortex-m4 based platform. Semihosting is enabled by linking -lrdimon and using initialise_
Now, when I use malloc, initially it gave an error as "undefined reference to 'end'"
In my linker script, I defined 'end' which marks beginning of heap section.
After this, compilation was successful, but malloc always returns NULL. As _sbrk defined in syscalls.c in newlib nano source only uses end symbol from linker script, I am not sure why malloc fails. I could access 'end' from other files in the project and it seemed okay.
Am I missing something very basic here? I would really appreciate some help.
Also, a more general question, when I use nosys.specs, system calls are not at all used?
Thanks.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Tejas Belagod
- Solved:
- Last query:
- Last reply: