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 while compiling zstack for msp430f2619

Other Parts Discussed in Thread: CC2520, MSP430F5438A

hi all

i m trying to run zstack on msp430f2619+cc2520 custom board

i used msp430f2619.xcl form iar ide folders as a linker file. instead of default msp430f2618.xcl

when i try to compile i m getting the below error

Building configuration: GenericApp - EndDevice
Updating build tree...
Linking
Error[e16]: Segment DATA16_N (size: 0x802 align: 0x1) is too long for segment definition. At least 0xbe more bytes needed. The problem occurred while processing the  
segment placement command "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=1100-20ff", where at the moment of placement the  
available memory ranges were "CODE:19bc-20ff"
   Reserved ranges relevant to this placement:
   1100-1189            DATA16_I
   118a-20ff            DATA16_Z
Error while running Linker
 
Total number of errors: 1
Total number of warnings: 0

what i need to do... kindly. help...

if anybody have proper xcl file kindly provide..

thank u

  • Hallo Kiran, 

    I am also experiencing the same problem, I am working with MSP430F5438A (from EXP5438) with CC2520. Nothing is modified, I am just trying to run the sample code and get the following similar error.

    Error: 

    Error[e16]: Segment HAL_OTA_CHKDL_SEG (size: 0xb0 align: 0x1) is too long for segment definition. At least 0x2 more bytes needed. The problem 
    occurred while processing the segment placement command "-Z(CODE)HAL_OTA_CHKDL_SEG=0xFD14-0xFDC1", where at the moment of placement 
    the available memory ranges were "CODE:fd14-fdc1" 
    Reserved ranges relevant to this placement: 
    fd14-fdc1 ?FILL3 
    Error while running Linker

    I have seen some posts, where they wrote some solutions to be:  changing the data model to large, reducing global variables/other variables and reducing the stack size. I couldnt resolve my error with the above solutions however. 

    In your case, it sounds like it gets resolved, if you increase your heap size. 

    Best, 

    Vidya. 

  • thanks for reply

    i tried to increase it and got some new  errors.

    do u knw what are the exact values ?

    but in your case the processor is different so u need to use MSP430F5438A's xcl file .. ryt?

    zstack by default takes 2618's memory map.. which is not needed for us..

  • Dear Kiran,

    When I check the options as shown above, I have seen Data 16 heap size is set to zero by default.  Change this to 64 or 128 and try it out please. This might resolve your error. Please let me know regarding the same.

    Best regards, 

    Vidya. 

  • hi vidya

    thank u for the suggestions

    but that didnt help much.. same error continuing.. 

    i wonder why TI engineers are not responding for this.. 

  • The error message contains all information you need:

    There is a memory range from 0x1100 to 0x20ff. In which the segments ADA16_I, DATA16_Z, DATA16_N, DATA16_HEAP and  _DATA16_HEAP_SIZE have to be fit.
    Not the linker is ttrying to place DATA16_N (~2k size) into this range and finds it occupied from 0x1100 up to 0x19bb. And the remaining space is too small by 0xbe bytes.

  • thank u vey much for the reply

    i also understand  what error msg says.. but my problem is not that

    what values i need to set to get rid of these errors.. and wher i have to modify to what values to compile smoothly

    i tried by reducing the DATA_16 n range in the ide and that is leading to some other error

    if i want to make DATA_16 range 1k .. where should i do it ?

  • kiran nayak said:
    if i want to make DATA_16 range 1k

    Normally, it should be as large as it requires.
    You must differentiate between the DATA_16 and the DATA_16 heap. The heap is a placeholder which reserves space for use with malloc or dynamic object generation (when using C++ classes) or such. If you don't need dynamic heapspace allocation, it can be left to 0.
    The 'stack size' also just places a big placeholder into the ram segment. It does not influence at all how much space the stack will take or not (a chane of this settign won't change a single bit in the generated binary). If you call a function, the stack will grow, whether you have reserved that much or not. Same for local variables in a function. THis settign jsut forces a linker error if there isn't that much memory left when all other objects have been placed. SO you might want to reduce this setting to a value that is suitable for your application (and some reserve space).
    If you don't use printf and don't have large amounts local variables in your functions, some hundred bytes are enough.

    You might want to set the stack size to 0 bytes or whatever teh linekr will allow as minimum, so the linker will link the project and generate a map file (enable map file generation in the linker settings). Then you can look at the map file to determine what takes all the memory in your ram segment.

**Attention** This is a public forum