I'm trying to use dynamic memory on str912fw44. The code compiles well but when it starts to debug, it gives some error : "*** error 34: undefined identifier Non-Aligned Access: Thumb Instruction at 0000C072H, Memory Access at 0000C230H ... *** error 65: access violation at 0x00080000 : no 'execute/read' permission"
The code I tried was :
ubyte *ptr; int main() { ptr=(ubyte*)calloc(10,sizeof(ubyte)); }
Tools : Keil uVision IDE, Keil Ulink2.
Could you please tell me what could be the problem ? I don't know where to look. How can I know the size of the memory area used as heap ?
Thank you all, Yes you are right, I just did not want to occupy much memory if not needed, because min values will be in use mostly, and max value will be for future needs. But, as you all say, for all reasons it is the best to use static allocation. Thank you again.
There's the rub: if it's going to be supported for "future needs", then that support has to be there from the start!
Of course, if you need to do a firmware update anyhow to support these "future needs" when they arise, then you can adjust the static allocation at that time...