 |
| Author |
Message |
|
|
Posted: Feb 13, 2011 - 08:06 AM |
|

Joined: Oct 05, 2010
Posts: 36
|
|
hi all ,
i work with the FreeRTOS ,
and i have a problem to add a task because the system can not allocate memory for it.
i work on UC3a0512 with 64 KB of SRAM.
I tried to use malloc and it let me allocate only 4 KB, but on the other hand it lets me declare and use a 52 KB of array .
does the malloc has any limits?
it seems like it doesn't use all the resourses .
any ideas?
thanx ahead. |
|
|
| |
|
|
|
|
|
Posted: Feb 16, 2011 - 01:05 PM |
|

Joined: Nov 18, 2010
Posts: 17
Location: FRANCE
|
|
Hi,
Checking for stack_size in linker script file.
May be I write a big bullshit ... or not.
Cpu |
|
|
| |
|
|
|
|
|
Posted: Feb 16, 2011 - 03:15 PM |
|


Joined: Mar 27, 2002
Posts: 18595
Location: Lund, Sweden
|
|
I'm no "AVR32-man" so "caveat emptor", but defining a global variable causes it to be allocated at compile time, defining it as a function-local variable causes it to be allocated on the stack at runtime.
Memory allocated with malloc() is done on the heap, which has a max size smaller than the available RAM since there has to be space for the statically allocated variables and the stack. |
|
|
| |
|
|
|
|
|
|
|