Page 1 of 1

Error on \"Could not allocate data memory\"

Posted: Fri May 08, 2009 8:33 am
by kailup
Hi again,

I\'ve been testing the FLEX Full with DMB with the SCICOS generator, and when my constants, gains ... increase to a certain number I get the \"Could not allocate data memory\" error.

From the error below, seems that the memory allocated is \"near\", anyway to reallocate the memory to \"far\"?

Thanks

Regards,
Chin Luh

****Error Message*******************
ee_board.o: Link Error: Could not allocate section .ndata, size = 22 bytes, attr
ibutes = data near
dmmul1.o: Link Error: Could not allocate section .nbss, size = 22 bytes, attribu
tes = bss near
ee_board.o: Link Error: Could not allocate section .nbss, size = 14 bytes, attri
butes = bss near
ee_hal_c.o: Link Error: Could not allocate section .nbss, size = 6 bytes, attrib
utes = bss near
dmmul.o: Link Error: Could not allocate section .ndata, size = 4 bytes, attribut
es = data near
brk.o: Link Error: Could not allocate section .nbss, size = 2 bytes, attributes
= bss near
dmmul1.o: Link Error: Could not allocate section .ndata, size = 2 bytes, attribu
tes = data near
errno.o: Link Error: Could not allocate section .nbss, size = 2 bytes, attribute
s = bss near
Link Error: Could not allocate data memory
make: *** [pic30.cof] Error 1

Re:Error on \"Could not allocate data memory\"

Posted: Sun May 17, 2009 9:13 pm
by paolo.gai
Deat Chin Luh,

there is no differenbce between near and far on dsPIC... basically the microcontroller has only 30Kb RAM!

It is probably the case that you exceeded the total RAM which is available for the system. The fact is that the code currently generated by scilab is not optimized for microcontrollers, and most of the data are still stored in RAM instead of ROM.

Things will change soon, but for the moment we have to live with these limitations.

How many blocks did you instantiated? could you please send me the map file generated by the linker?

Ciao,

PJ

Re:Error on \"Could not allocate data memory\"

Posted: Mon May 18, 2009 2:23 am
by kailup
Dear Paolo,

Thanks for the reply.
Please find the attached file for the zip file (which contain the map before and after the \"limit\"). The attached image is the memory map for the successful compilation (near to limit case, any extra block to the model will not compile), and seems like it just occupied 6k data memory.

I found some similar question for Microchips: http://www.microchip.com/forums/tm.aspx?m=343461, but not too sure whether is relevant to my problem.

Thanks

Regards,
Chin Luh [img width=448]http://www.erika.tuxfamily.org/images/f ... memmap.jpg[/img]

Re:Error on \"Could not allocate data memory\"

Posted: Mon May 18, 2009 8:12 am
by paolo.gai
You are right. it\'s a problem of data models. Go in the template you are currently using (something like
c:/evidence/evidence/examples/pic30/pic30_scicos on EE 1.4.3
or
c:/evidence/evidence/eclipse/plugins/com.eu.evidence.ee_1.0.0.XXX/examples/pic30/pic30_scicos

and add

CFLAGS = \"-mlarge-data\";

in the OS section of the OIL file. this should solve the problem. We\'ll commit the change in the 1.5.0 version we are currently working on...

Thanks again for the feedback!

PJ

Re:Error on \"Could not allocate data memory\"

Posted: Mon May 18, 2009 8:47 am
by kailup
Dear Paolo,

Thanks for the reply.

the change in the first location oil file give new error:

***error message***
.\\libee.a(ee_thendin.o)(.text+0x16): In function `EE_thread_end_instance\':
c:\\Evidence\\Evidence\\ee\\pkg\\kernel\\fp\\src\\ee_thendin.c:67: Link Error: Cannot ac
cess symbol (_EE_sys_ceiling+34) with file register addressing. Value must be le
ss than 8192.
make: *** [pic30.cof] Error 1
***error message***

while the change in the second directory gives no different.

Thanks.

Regards,
Chin Luh

Re:Error on \"Could not allocate data memory\"

Posted: Wed Jun 10, 2009 8:24 am
by paolo.gai
Dear Chin Luh,

Just a quick update (for all the forum also): The problem has been solved by francesco and nino in the last days, and will be included into the new version of EE...

Ciao,

PJ