Hello
I am working with very big array. So i decide to use malloc to allocate the memory as bellow.
http://pastebin.com/778bb0cT
The problem is the buffers cannot be allocated correctly. I starts with heap size 10000, only buffer_a is allocated. If I inscrease the heap to 20000, both buffer_a and buffer_b cannot be allocated. I tried to change the heap size to very big. But it doesn't work. Please help me to solve this problem. Here is the linker.cmd file:
-stack 0x4000 /* PRIMARY STACK SIZE */
-sysstack 0x4000 /* SECONDARY STACK SIZE */
-heap 0x70000 /* HEAP AREA SIZE */
MEMORY
{
MMR (RW) : origin = 0000000h length = 0000C0h /* MMRs */
VEC (RX) : origin = 00000C0h length = 000300h /* on-chip ROM vectors */
DARAM (RW) : origin = 0000400h length = 00FC00h /* on-chip DARAM */
SARAM (RW) : origin = 0010000h length = 100000h /* on-chip SARAM */
}
SECTIONS
{
vectors : > VEC
.text : > DARAM
.stack : > SARAM
.sysstack : > SARAM
.data : > DARAM
.bss : > DARAM
.cinit : > DARAM
.const : > DARAM
.switch : > DARAM
.sysmem : > SARAM
.cio : > DARAM
}