1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

IAR C Problem with Memory Size

Discussion in 'Embedded' started by Steven Woody, Feb 28, 2006.

  1. Steven Woody

    Steven Woody Guest

    hi,

    i am using IAR Embedded Workbench for C, the target is M16C. i met
    problems when setting heap/stack size in the project options.

    currently, the working setting is: stack = 1920, interrupt stack =
    128, data 16 heap = far heap size = data20 heap size = 1024. though
    i've not yet well unstood what the above really mean, but it works.

    the problem is, it seems that i can not most of these values. for
    example, if i change the data 16 heap from 1024 to 2048, i will get an
    error:

    Error[e16]: Segment DATA16_Z (size: 0x59aa align: 0x1) is too long for
    segment definition. At least 0x372 more bytes
    needed. The problem occurred while processing the segment placement
    command
    "-Z(NEAR)DATA16_I,DATA16_Z,DATA16_N,DATA16_AN", where at the moment of
    placement the available memory
    ranges were "CODE:29c8-7fff"
    Reserved ranges relevant to this placement:
    400-b7f CSTACK
    b80-bff ISTACK
    c00-13ff DATA16_HEAP
    1400-7fff DATA16_I

    but i can successfully change the stack from 1920 to 2048.

    i heard the M16C gets more than 31k memory, so i feel the error is
    confusing.

    by the way, in the data mode option, if i disable ( uncheck ) the
    'Writable constants' check box, i will get another error:

    Fatal Error[e72]: Segment DATA16_C must be defined in a segment
    definition option (-Z, -b or -P)

    what this mean? i believe enable the 'Writable constants' is not a good
    solution.

    thanks.

    -
    woody
     
    Steven Woody, Feb 28, 2006
    #1
    1. Advertisements

  2. Steven Woody

    Daniel W Guest

    Hi Steven,

    The linker lets you know that it cannot place the segment DATA16_Z
    as there is not enough space available in the defined RAM area.
    Increasing the stack from 1920 to 2048 bytes only require 128 bytes
    whereas increasing the heap size from 1K to 2K requires a whole
    kilobyte of RAM. You probably only have about 136 bytes of free RAM
    (deduced by looking at the error message).

    The linker command file tries to describe your target system, i.e.
    where there is ROM and where there is RAM. You can verify which
    ..xcl file that is used by checking in the options dialog under
    XLINK->Input. Make sure this file matches your actual hardware,
    perhaps you've added more external RAM?

    The message above indicates that the area 0x29C8 through 0x7FFF
    is used when placing __data16 variables.
    As I said, make sure that your .xcl file is properly reflecting
    your hardware.
    The M16Cs usually do not have ROM in the lower part of the memory,
    this option is used to copy-initialize variables instead of placing
    them in __far memory. This generates much more efficient code at the
    cost of sarificing RAM to store constants. If you do not want this,
    then you must use a data model where the default pointer is a __far
    pointer.

    If you have any other questions, please feel free to direct them at
    IAR Systems Support. They are very good at what they do.

    Regards
    /D

    P.s. remove underscores from e-mail address if replying via e-mail.
     
    Daniel W, Feb 28, 2006
    #2
    1. Advertisements

  3. Steven Woody

    npbedbur

    Joined:
    Feb 19, 2010
    Messages:
    1
    Likes Received:
    0
    Similar Error - [E16]

    Using IAR Embedded workbench, I receive a similar error with the CC2430EM as my target device:

    Error[e16]: Segment IDATA_Z (size: 0xba align: 0) is too long for segment definition. At least 0x2d more bytes needed. The problem occurred while
    processing the segment placement command "-Z(IDATA)IDATA_I,IDATA_Z,IDATA_N=08-_IDATA_END", where at the moment of placement the
    available memory ranges were "IDATA:73-ff"
    Reserved ranges relevant to this placement:
    IDATA:8-f VREG
    IDATA:10-1f IDATA_I
    IDATA:21-ff IDATA_I
    BIT:0-7 BREG
    BIT:80-87 SFR_AN
    BIT:90-97 SFR_AN
    BIT:a0-af SFR_AN
    Error while running Linker

    Total number of errors: 1
    Total number of warnings: 0


    I'm trying to download the simple_peer_to_peer.eww CC2430-LinkListen example application to the module using the SmartRF04EB board. The CC2430EM has "CC2430EM" written on the board but there is actually a CC2431 processor. Would a CC2431 (rather than a CC2430) cause errors similar to those above?

    Nick
     
    npbedbur, Feb 19, 2010
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.