EmbeddedRelated.com
Forums

Quick question: Compiler Error

Started by finfets August 26, 2005
Hi,

I am using IAR Kickstart (free) compiler, and I am getting this error
when I put in a certain chunk of code:

Error[e16]: Segment CSTACK (size: 0x50 align: 0x1) is too long for
segment definition. At least 0x19 more bytes needed. The problem
occurred while processing the segment placement  
command "-Z(DATA)CSTACK+_STACK_SIZE#", where at the moment of
placement the available memory ranges were "CODE:2c9-300" 
   Reserved ranges relevant to this placement: 
   200-209              DATA16_I 
   20a-2c8              DATA16_Z 
   2c9-300              CSTACK 



Does anyone know what this is? Does this have to do with going over
the compilable C-code size IAR free version limit?


Thanks!
Rich



Beginning Microcontrollers with the MSP430

Looks like you might be trying to reserve more memory that the processor
has
In this case I think it is probably RAM  ( because of the address *(0x200) 
that it is complaining about)

Looks for array constructs such as
char array_name[VERY_BIG_VALUE];

What part are you using? Have you setup the IAR tools to use the correct 
part definition?
Did your code ever work? (if so what was the last thing you added to it?)

I am not familiar with the IAR tools but as far a I understand it the limit 
is on the amount of flash (ie. program memory) you use not the about of data 
memory (RAM).
RTFM. I would be surprised if the limitation of the free tools are not 
clearly documented.

HTH
Let use know how you get on.

Ivan



----- Original Message ----- 
From: "finfets" <finfets@finf...>
To: <msp430@msp4...>
Sent: Saturday, August 27, 2005 8:42 AM
Subject: [msp430] Quick question: Compiler Error


> Hi,
>
> I am using IAR Kickstart (free) compiler, and I am getting this error
> when I put in a certain chunk of code:
>
> Error[e16]: Segment CSTACK (size: 0x50 align: 0x1) is too long for
> segment definition. At least 0x19 more bytes needed. The problem
> occurred while processing the segment placement
> command "-Z(DATA)CSTACK+_STACK_SIZE#", where at the moment of
> placement the available memory ranges were "CODE:2c9-300"
>   Reserved ranges relevant to this placement:
>   200-209              DATA16_I
>   20a-2c8              DATA16_Z
>   2c9-300              CSTACK
>
>
>
> Does anyone know what this is? Does this have to do with going over
> the compilable C-code size IAR free version limit?
>
>
> Thanks!
> Rich
>
>
>
>
>
> .
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 


finfets wrote:

>Hi,
>
>I am using IAR Kickstart (free) compiler, and I am getting this error
>when I put in a certain chunk of code:
>
>Error[e16]: Segment CSTACK (size: 0x50 align: 0x1) is too long for
>segment definition. At least 0x19 more bytes needed. The problem
>occurred while processing the segment placement  
>command "-Z(DATA)CSTACK+_STACK_SIZE#", where at the moment of
>placement the available memory ranges were "CODE:2c9-300" 
>   Reserved ranges relevant to this placement: 
>   200-209              DATA16_I 
>   20a-2c8              DATA16_Z 
>   2c9-300              CSTACK 
>
>
>
>Does anyone know what this is? Does this have to do with going over
>the compilable C-code size IAR free version limit?
>  
>

No, the limit is on code size, not on RAM usage.

Basically, the problem is that your application uses to much RAM. The 
available RAM for the device you have selected is described in the 
corresponding linker command file (i.e. files with extension .xcl). 
Apparently, you only have 256 bytes to play with, from 0x200 to 0x2FF. 
Given the error you have 10 bytes of data that has been assigned to some 
value other than zero (DATA16_I). However, most of your RAM is used by 
210 bytes of zero-initialized data (DATA16_Z), this could be a structure 
or an array of some sort. In addition to this you have specfied that you 
need 80 bytes (that is hex 0x50) for the run-time stack.

You can, of course, specify a smaller stack... However, if you specifies 
a stack that is too small the stack will grow into whatever memory layes 
byond it, typically this could be your normal variables. This means that 
your application simply will start be behave strangely... Note that the 
80 bytes that initially was reserved for the stack isn't necessarily 
enough for your application.

    -- Anders Lindgren, IAR Systems

-- 
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.