IAR EW430 error message

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

Reply to
amirxahmadi
Loading thread data ...

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 to
Gene S. Berkowitz

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 to
amirxahmadi

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?)

The compiler cannot guess that an object declared as variable is in fact constant that could be placed in ROM.

Reply to
Grzegorz Mazur

Reply to
amirxahmadi

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 to
ian_okey

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.