Malloc and similar function usage

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
markintosh
Newbie
Posts: 7
Joined: Mon Oct 27, 2008 5:05 pm

Malloc and similar function usage

Post by markintosh » Thu Nov 06, 2008 4:04 pm

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
Newbie
Posts: 16
Joined: Mon Sep 29, 2008 1:27 pm

Re:Malloc and similar function usage

Post by chris » Thu Nov 06, 2008 6:51 pm

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
Newbie
Posts: 7
Joined: Mon Oct 27, 2008 5:05 pm

Re:Malloc and similar function usage

Post by markintosh » Fri Nov 07, 2008 11:55 am

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

Post Reply