This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error[e16]: Segment XDATA_I

Other Parts Discussed in Thread: CC2431, CC2430

I'm trying to compile modified code of Location sample with IAR 7.20H with zstack 1.4.2-1.1.0 using CC2430 and CC2431 nodes and SmartRF04EB but I get this error:

Error[e16]: Segment XDATA_I (size: 0x3a5 align: 0) is too long for segment definition. At least 
0x93 more bytes needed. The problem occurred while processing the segment placement 
command "-Z(XDATA)XDATA_N,XDATA_Z,

XDATA_I=_XDATA_START-_XDATA_END", 
where at the moment of placement the available memory ranges were "XDATA:fbee-feff"
   Reserved ranges relevant to this placement:
   XDATA:e000-e007      XDATA_AN
   XDATA:e008-e307      XSTACK
   XDATA:e308-feff      XDATA_Z
   BIT:0-7              BREG
   BIT:80-97            SFR_AN
   BIT:a0-af            SFR_AN
   BIT:b8-c7            SFR_AN
   BIT:d8-df            SFR_AN
   BIT:e8-ef            SFR_AN

I tryed to check between the options of the project but I don't know what to do to resolve this problem.

Thank you in advance
  • Its telling you there isn't enough room for all of your global variables.  The XDAT_I segment is for initialized global and static variables.  The size of the data the compiler determined needed to go into this segment was 0x3A5 (933) bytes.  At the time of placement the XDATA allocation pointer was pointing at 0xFBEE and the XDATA segment ends at 0xFEFF leaving only 0xFEFF-0xFBEE+1=0x312 (786) bytes to place these variables.  Note that 0x3A5-0x312=0x93 (147) bytes as the error indicates are needed if you are going to place this amount of data.

    You have a couple of options.

    1. See if you can reduce the number or sizes of your global or static variables.  Perhaps you have many debugging variables or arrays are allocated larger than necessary.
    2. Tell the compiler to place initialized constants into ROM instead of RAM.  This will free up memory which is basically read only.  You can also use the type modifier __code or possibly __xdata_rom to place only certain larger variables or arrays in flash.
    3. Your stack size is 768 bytes in size.  This amount may not be necessary and if you can make it smaller then you will free up memory for more global variables.

    Jim Noxon

  • Hi,

    I have similar problem, but with the ISTACK: - after adding and the USB section start to receive the following messages:

     

    Error[e16]: Segment ISTACK (size: 0xdf align: 0) is too long for segment definition. At least 0xf more bytes needed. 

    The problem occurred while processing the segment placement command 

    "-Z(IDATA)ISTACK+_IDATA_STACK_SIZE#08-_IDATA_END", where at the moment of placement the available 

    memory ranges were "IDATA:30-ff"

       Reserved ranges relevant to this placement:

       IDATA:8-f            VREG

       IDATA:10-11          XSP

       IDATA:12-1f          DATA_I

       IDATA:21-2f          DATA_Z

       IDATA:30-ff          ISTACK

       BIT:0-7              BREG

       BIT:80-97            SFR_AN

       BIT:a0-af            SFR_AN

       BIT:b8-c7            SFR_AN

       BIT:e8-ef            SFR_AN

       BIT:f8-ff            SFR_AN

    Error while running Linker

     Total number of errors: 1

     

    I played with the value of the ISTAK size from the project options and the best I achieved was with 0xD1

     

    Error[e16]: Segment ISTACK (size: 0xd1 align: 0) is too long for segment definition. At least 0x1 more bytes needed.  ...

     

    Going further down to 0xD0 already become a complete mess:

    Linking

    Error[e46]: Undefined external "currentLineCoding" referred in hal_uart ( C:\Texas Instruments\...\Obj\hal_uart.r51 )

    Error[e46]: Undefined external "usbDescriptorMarker" referred in usb_descriptor_parser ( C:\Texas Instruments\

    ...\Obj\usb_descriptor_parser.r51  )

    Error[e46]: Undefined external "usbvrHookProcessOut::?relay" referred in usb_framework ( C:\Texas Instruments\

    ...\Obj\usb_framework.r51 )

    .....

     

     

    Could you tell me what are my options to solve this problem or to give some link wher could get info?

    Thanks

  • Oops, sorry for the posting before  - my mistake - with 0xD0 works fine, just forgot to add and class_cdc files :( 

    After realise that IAR could not give all the errors in the first case (it just stops dump when have Error[e16]), but when reason(s) for Error[e16] is/are fixed, then   starts to dump and all the rest errors ;)

  • So all is copacetic now?

    Jim Noxon

  • Hi Jim,

    Not all, but at least the USB part is now Ok ;) 

    Unfortunately debugging with IAR is like extreme sport L  (I'm not quite sure who should blame about this IAR or TI ;)   Even without  USB part, it freezes , moves and disables debug points etc.... When I tried to debug and with included USB part /framework/driver– then become  disaster * 2 J – I forgot how many times had to restart the IAR as even the reset button on the CC Debugger most of the times doesn’t help either.