Page 1 of 1

Malloc and similar function usage

Posted: Thu Nov 06, 2008 4:04 pm
by markintosh
Hi guys,
I\'d like to use the dinamic memory assignment function (malloc, realloc) on the dsPIC33FJ256MC710 and when I use them I get a compile error:

Code: Select all


A heap is required, but has not been specified
I think I\'ve to redefine the .oil file adding the heap properties but I\'nt know how. Can someone give me some help?
Cheers, MARCO

Re:Malloc and similar function usage

Posted: Thu Nov 06, 2008 6:51 pm
by chris
It\'s easy.
As you said you have to specify the heap using the C30 option --heap= and this can me done in the .oil adding the LDFLAGS attribute as described below.

Code: Select all


CPU mySystem {
	OS myOs {
		EE_OPT = \"DEBUG\";		
		CFLAGS = \"\";
                LDFLAGS = \"--heap=1024\"
                
	};
        
};
This should help you.
Regards,
Chris.

Re:Malloc and similar function usage

Posted: Fri Nov 07, 2008 11:55 am
by markintosh
Thank you for the help!It works fine.
Cheers MARCO