Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
manshayo
PostPosted: Feb 13, 2011 - 08:06 AM
Rookie


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.
 
 View user's profile Send private message  
Reply with quote Back to top
cpu
PostPosted: Feb 16, 2011 - 01:05 PM
Newbie


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
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Feb 16, 2011 - 03:15 PM
10k+ Postman


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.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits