Malloc and similar function usage

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Locked
markintosh

Malloc and similar function usage

Post 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
chris

Re:Malloc and similar function usage

Post 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.
markintosh

Re:Malloc and similar function usage

Post by markintosh »

Thank you for the help!It works fine.
Cheers MARCO
Locked