Reply by October 17, 20052005-10-17
amirxahmadi@gmail.com wrote:
> Many thanks, > The problem was because of code and data memory. > Funny mistake! > by changing > array[x][y]; > to > const int array[x][y]; > the data resides in code memory. > Cheers, > Amir > > Grzegorz Mazur wrote: > > amirxahmadi@gmail.com wrote: > > > Hi Gene, > > > I defined some arrays like: > > > unsigned short int Array[x][y] = {{1,4,5,6},{66...},.....}; > > > and as the size of these tables increased they fell outside a segment. > > > > If the arrays are constant zou should declare them with "const" keyword. > > Also, read the compiler docs and chck the possible syntax for forcing > > constants into code section (some #pragma?) > > > > > But I think compiler should manage all these; besides, I increased heap > > > and stack size in projects option but there was no effect. > > > > The compiler cannot guess that an object declared as variable is in fact > > constant that could be placed in ROM.
A question about this error message comes up, either here or on the MSP430 newsgroup, every other week and is always down to the fact that the author has not grasped the fact that their processor has a vey limited RAM resource. This time the over definition of RAM was quite mild - some of the posters get quite upset when they find out that their 2K of RAM cannot hold a megabyte buffer. This error message is actually from the linker not the compiler. It is only at the link stage that you actually tell the tools precisely which processor vvariant you are targetting and hence define the memory map. The compiler has no idea whether you are working with 128 bytes or 10kbytes of RAM. Any const data will be stored in FLASH automatically, no need to use any #pragmas. Increasing the heap or stack sizes declared in the tools cannot increase the amount of RAM that TI have built into the chip and as there is no external bus, the scope for adding more is somewhat limited. Ian
Reply by October 16, 20052005-10-16
Many thanks,
The problem was because of code and data memory.
Funny mistake!
by changing
array[x][y];
to
const int array[x][y];
the data resides in code memory.
Cheers,
Amir

Grzegorz Mazur wrote:
> amirxahmadi@gmail.com wrote: > > Hi Gene, > > I defined some arrays like: > > unsigned short int Array[x][y] = {{1,4,5,6},{66...},.....}; > > and as the size of these tables increased they fell outside a segment. > > If the arrays are constant zou should declare them with "const" keyword. > Also, read the compiler docs and chck the possible syntax for forcing > constants into code section (some #pragma?) > > > But I think compiler should manage all these; besides, I increased heap > > and stack size in projects option but there was no effect. > > The compiler cannot guess that an object declared as variable is in fact > constant that could be placed in ROM.
Reply by Grzegorz Mazur October 15, 20052005-10-15
amirxahmadi@gmail.com wrote:
> Hi Gene, > I defined some arrays like: > unsigned short int Array[x][y] = {{1,4,5,6},{66...},.....}; > and as the size of these tables increased they fell outside a segment.
If the arrays are constant zou should declare them with "const" keyword. Also, read the compiler docs and chck the possible syntax for forcing constants into code section (some #pragma?)
> But I think compiler should manage all these; besides, I increased heap > and stack size in projects option but there was no effect.
The compiler cannot guess that an object declared as variable is in fact constant that could be placed in ROM.
Reply by October 15, 20052005-10-15
Hi Gene,
I defined some arrays like:
unsigned short int Array[x][y] = {{1,4,5,6},{66...},.....};
and as the size of these tables increased they fell outside a segment.
But I think compiler should manage all these; besides, I increased heap
and stack size in projects option but there was no effect.
I will appreciate to have your comment (or anyone who could give me
some hints).
Thanx
Amir

Reply by Gene S. Berkowitz October 14, 20052005-10-14
In article <1129333718.477585.49710@f14g2000cwb.googlegroups.com>, 
amirxahmadi@gmail.com says...
> Hi there, > Does anyone knows following error? > and how can cope it? > > ----------------------------------------------------------------- > Error[e16]: Segment DATA16_I (size: 0x404 align: 0x1) is too long for > segment definition. At least 0x3 more bytes needed. > The problem occurred while processing the segment placement command > "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,HEAP+_HEAP_SIZE=0200-0600", where > at the moment of placement the > available memory ranges were "CODE:200-600" > Reserved ranges relevant to this placement: > 200-600 DATA16_I > ------------------------------------------------------------------ > > I have some data tables with in my program memory and as I want to > reach the data using arrays I face this error. > > Many thanks, > > Amir > >
You are asking the compiler to allocate 0x404 bytes from the heap which is only 0x400 bytes deep. How did you declare the data tables? --Gene
Reply by October 14, 20052005-10-14
Hi there,
Does anyone knows following error?
and how can cope it?

-----------------------------------------------------------------
Error[e16]: Segment DATA16_I (size: 0x404 align: 0x1) is too long for
segment definition. At least 0x3 more bytes needed.
The problem occurred while processing the segment placement command
"-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,HEAP+_HEAP_SIZE=0200-0600", where
at the moment of placement the
available memory ranges were "CODE:200-600"
   Reserved ranges relevant to this placement:
   200-600              DATA16_I
------------------------------------------------------------------

I have some data tables with in my program memory and as I want to
reach the data using arrays I face this error.

Many thanks,

Amir