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 Linker Problem

Discussion in 'Embedded' started by Oliver, Jan 7, 2004.

  1. Oliver

    Oliver Guest

    Hi!



    I'm using an IAR Compiler for Hitachi H8-3687. This Controller has to RAM
    areas (0xE800-0xEFFF(2kByte) and 0xFB80-0xFF7F(1kByte). My segment UDATA1
    has more than 2kByte an is not linkable. How can I split the segment in two
    parts to locate it in both RAM areas?

    Oliver
     
    Oliver, Jan 7, 2004
    #1
    1. Advertisements

  2. Oliver

    Dave Hansen Guest

    I've not used that compiler, but a couple of general principles:

    1) Initialized and Uninitialized data usually go into two separate
    segments. A first guess would be IDATA1. Try initializing some data
    to see if it moves. Tell your linker script to put IDATA1 in one RAM
    area and UDATA1 in the other.

    2) The compiler usually decides where to put data. There may be an
    option or a pragma you can use when compiling to direct some modules
    to place data in one or another segment of your own choosing. Maybe
    UDATA2? Look for something like that.

    HTH,

    -=Dave
     
    Dave Hansen, Jan 7, 2004
    #2
    1. Advertisements

  3. I have not used the H8-3 IAR compiler, but on the IAR compilers I have
    used theres is a compiler flag that keeps text/string data in the ROM
    areas. Make sure this is enabled otherwise all text/string data is
    copied to RAM.
    For locating some variables in other data areas you need to use
    something like the following:
    #pragma memory=dataseg(anothersection)
    int var_in_anothersection;
    #pragma memory=default
    You can specify in the linker file where "anothersection" should be
    located.

    Regards
    Anton Erasmus
     
    Anton Erasmus, Jan 7, 2004
    #3
  4. Oliver

    jtp Guest

    Hi!
    If none of your projects translation units e.g. .c files consists more
    than
    2 kBytes uninitialized data, then the linker should be able to place
    uninitialilzed data to those two RAM areas automatically.
    But if one of these translation units have more than 2 kBytes
    uninitialized data
    then you better do what Dave said in his post.
     
    jtp, Jan 8, 2004
    #4
  5. Oliver

    Oliver Hager Guest

    Hi!

    Thanks, it's working now!!!!!!

    Oliver


     
    Oliver Hager, Jan 9, 2004
    #5
    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.