Page 1 of 1

RAM problem

PostPosted: Wed Aug 09, 2006 1:19 am
by marco
Using Salvo PRO for pic C18
I have a lot of task and events and
linker report:
Error - section '.udata_mem.o' can not fit the section. Section '.udata_mem.o' length=0x00000101
There is a configuration option (or a workaround) to force objects to be allocated in more than a single bank ?
Thank you

Marco


Re: RAM problem

PostPosted: Thu Aug 10, 2006 2:30 am
by marco
Probably I found a solution:
in my linker script enlarge a DATABANK,
Is it safe ?

Marco


Re: RAM problem

PostPosted: Fri Aug 11, 2006 4:38 am
by aek
Hi Marco.

With Salvo and MPLAB-C18, the location of Salvo objects is controlled by the near/far attribute in Salvo (Pro build, or library) and the size of the various data objects.

There are some discussions in this Forum about how to get the Salvo objects into the appropriate memory spaces when certain Salvo objects (e.g. the tcbArea[] array) get large ...

------------------


Re: RAM problem

PostPosted: Thu Aug 24, 2006 4:55 am
by kamyip
Hi Andrew,

I'm facing the same problem. The C18 compiler is complaining :-

Error - section 'OSVarsTcbArea' can not fit the section. Section 'OSVarsTcbArea' length=0x00000108
Errors : 1

I have all in 33 tasks.

Previously I added in :
/* for big memory model add this */
#pragma udata OSVarsTcbArea
OSgltypeTcb OStcbArea[OSTASKS];
/* */
#pragma udata OSVars

it works until I add in task #33.

Anyway I can put Salvo a bit further?


Re: RAM problem

PostPosted: Thu Aug 24, 2006 8:21 am
by aek
It's been a while since I visited this issue (and I should have documented it better).

basically, what the compiler is saying is that it can't handle an array that is larger than 256 byts in size, at least in the sense that the memory map for the chosen part does not have a section defined that is bigger than 256 bytes.

If you follow the discussions on Microchip's forums as to how to deal with large (i.e. > 256 bytes) arrays, then you can solve this problem with Salvo simply by editing the link file to create a section larger than 256 bytes, AND by placing Salvo's OStcbArea[] array in it -- the latter will likely require a mnor edit to your mem.c file. The best way to do that is to copy the mem.c file to your local project directory, use that local copy in your builds, and edit it to suit.

------------------


Re: RAM problem

PostPosted: Thu Aug 24, 2006 8:34 am
by kamyip
OK, I've got it. For those who is interested the answer is in this link:
http://forum.microchip.com/tm.aspx?m=39357