I recently used malloc allocation of memory space, find the address space of the allocation in external SDRAM, how do I use malloc allocation to internal memory space?
See the malloc docs:
The malloc function returns a pointer to a block of memory of length size. The block of memory is uninitialized. The object is allocated from the current heap, which is the default heap unless set_alloc_type or heap_switch has been called to change the current heap to an alternate heap.
So, either you have multiple heaps defined and use the wrong one at that very moment or maybe there's something wrong in the linker definition file. (Speculation due to missing information on that).
Does this help?
Thanks ,I try to modify the LDF files, make the default stack allocation to data32 area, but failed.I try to use heap_malloc function, also failed.Can you provide me a demo?
you're confusing heap and stack.
I use VDSP, not CCES, so I don't think, I will be very helpful on that but usually, any demo shipped with CCES will do.
Just call malloc and everything should be fine, there.
The malloc function returns a pointer to a block of memory of length size. The block of memory is not initialized. The memory allocated is aligned to an 8-byte boundary.
Please refer in CCES help to use malloc fuction:CrossCore® Embedded Studio 2.5.0 > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > C/C++ Run-Time Library > malloc
Retrieving data ...