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.

Compiler/CC430F6137: Cannot place variable to specific memory location anymore with eabi/ELF output format

Part Number: CC430F6137

Tool/software: TI C/C++ Compiler

I need to make some change to an old project that use MSP430 TI 4.4.5 compiler and there is a warning message. 

warning #10204-D: could not resolve index library "libmath.a" to a compatible

Then, I change the build output format to ELF to resolve this warning message. Once I do that, I realize the linker no longer place the following variable to the specific memory location anymore. It works if I change the output back to legacy COFF. Do I miss anything?

#pragma DATA_SECTION(Image_boot, ".memlocation")
const unsigned char Image_boot[1024]={
#include "boot_sym.dat"
};


Thanks,

Jonathan

 

 

  • For this issue ...

    Jonathan Cheng26 said:
    warning #10204-D: could not resolve index library "libmath.a" to a compatible

    I suspect the linker attempted to build the missing RTS library, and this step failed.  To understand what happened, I need to see exactly how the linker is invoked, and all the resulting diagnostics.  Please copy-n-paste that from the Console (not Problems) view in CCS.

    For this issue ...

    Jonathan Cheng26 said:
    I realize the linker no longer place the following variable to the specific memory location anymore

    There has to be specific syntax in the linker command file which allocates the output section .memlocation to the specific memory location.  Please attach the linker command file to your next post.  Because the forum only accepts a few different kinds of files, add the file extension ".txt" to it.

    Thanks and regards,

    -George

  • Hi George,

    As mentioned in the question, I've already resolved the following warning message. 

    <Linking>
    warning #10204-D: could not resolve index library "libmath.a" to a compatible
    remark #10372-D: (ULP 4.1) Detected uninitialized Port C in this project.
       Recommend initializing all unused ports to eliminate wasted current
       consumption on unused pins.
       library
    'Finished building target: bed_tag.out'

    Basically, the TI CGT 4.4.5 math library is in ELF format. Therefore I need to change the output format from legacy COFF to eabi (ELF). Once I did that there is no more warning message.

    <Linking>
    remark #10372-D: (ULP 4.1) Detected uninitialized Port C in this project.
       Recommend initializing all unused ports to eliminate wasted current
       consumption on unused pins.
    'Finished building target: bed_tag.out'

    But the question I have is that, once I use ELF format, the bootloader section is not there anymore. It used to work with COFF format.

    Output Format legacy COFF
     
    MEMORY CONFIGURATION
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      SFR                   00000000   00000010  00000000  00000010  RWIX
      PERIPHERALS_8BIT      00000010   000000f0  00000000  000000f0  RWIX
      PERIPHERALS_16BIT     00000100   00000100  00000000  00000100  RWIX
      INFOD                 00001800   00000080  00000000  00000080  RWIX
      INFOC                 00001880   00000080  00000000  00000080  RWIX
      INFOB                 00001900   00000080  00000000  00000080  RWIX
      INFOA                 00001980   00000080  00000000  00000080  RWIX
      RAM                   00001c00   00000ffe  00000ff8  00000006  RWIX
      FLASH                 00008000   00007a00  00007a00  00000000  RWIX  ffff
      BOOTLOADER            0000fa00   00000400  00000400  00000000  RWIX

    .bootloader
    *          0    0000fa00    00000400    
                      0000fa00    00000400     main.obj (.bootloader)

    Output Format eabi (ELF)
    MEMORY CONFIGURATION
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      SFR                   00000000   00000010  00000000  00000010  RWIX
      PERIPHERALS_8BIT      00000010   000000f0  00000000  000000f0  RWIX
      PERIPHERALS_16BIT     00000100   00000100  00000000  00000100  RWIX
      INFOD                 00001800   00000080  00000000  00000080  RWIX
      INFOC                 00001880   00000080  00000000  00000080  RWIX
      INFOB                 00001900   00000080  00000000  00000080  RWIX
      INFOA                 00001980   00000080  00000000  00000080  RWIX
      RAM                   00001c00   00000ffe  00000df3  0000020b  RWIX
      FLASH                 00008000   00007a00  00007a00  00000000  RWIX  ffff
      BOOTLOADER            0000fa00   00000400  00000000  00000400  RWIX

    The .bootloader section is used in the code

    #pragma DATA_SECTION(Image_boot, ".bootloader")
    const unsigned char Image_boot[1024]={
    #include "boot_sym.dat"
    };

    I have attached the linker cmd file that define the memory section. As I mentioned before, there is no change in the linker cmd file and the code. But somehow the .bootloader section is empty when using ELF output format.

    Thanks,

    -Jonathan

    lnk_cc430f6137_cmd.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /******************************************************************************/
    /* lnk_cc430f6137.cmd - LINKER COMMAND FILE FOR LINKING CC430F6137 PROGRAMS */
    /* */
    /* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */
    /* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */
    /* */
    /*----------------------------------------------------------------------------*/
    /* These linker options are for command line linking only. For IDE linking, */
    /* you should set your linker options in Project Properties */
    /* -c LINK USING C CONVENTIONS */
    /* -stack 0x0100 SOFTWARE STACK SIZE */
    /* -heap 0x0100 HEAP AREA SIZE */
    /* */
    /*----------------------------------------------------------------------------*/
    /****************************************************************************/
    /* SPECIFY THE SYSTEM MEMORY MAP */
    /****************************************************************************/
    MEMORY
    {
    SFR : origin = 0x0000, length = 0x0010
    PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
    PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
    RAM : origin = 0x1C00, length = 0x0FFE
    INFOA : origin = 0x1980, length = 0x0080
    INFOB : origin = 0x1900, length = 0x0080
    INFOC : origin = 0x1880, length = 0x0080
    INFOD : origin = 0x1800, length = 0x0080
    FLASH : origin = 0x8000, length = 0x7A00, fill = 0xFFFF
    //FLASH2 : origin = 0xF9F0, length = 0x0010
    BOOTLOADER : origin = 0xFA00, length = 0x0400
    EMPTY : origin = 0xFE00, length = 0x0180, fill = 0xFFFF
    INT00 : origin = 0xFF80, length = 0x0002, fill = 0xFFFF
    INT01 : origin = 0xFF82, length = 0x0002, fill = 0xFFFF
    INT02 : origin = 0xFF84, length = 0x0002, fill = 0xFFFF
    INT03 : origin = 0xFF86, length = 0x0002, fill = 0xFFFF
    INT04 : origin = 0xFF88, length = 0x0002, fill = 0xFFFF
    INT05 : origin = 0xFF8A, length = 0x0002, fill = 0xFFFF
    INT06 : origin = 0xFF8C, length = 0x0002, fill = 0xFFFF
    INT07 : origin = 0xFF8E, length = 0x0002, fill = 0xFFFF
    INT08 : origin = 0xFF90, length = 0x0002, fill = 0xFFFF
    INT09 : origin = 0xFF92, length = 0x0002, fill = 0xFFFF
    INT10 : origin = 0xFF94, length = 0x0002, fill = 0xFFFF
    INT11 : origin = 0xFF96, length = 0x0002, fill = 0xFFFF
    INT12 : origin = 0xFF98, length = 0x0002, fill = 0xFFFF
    INT13 : origin = 0xFF9A, length = 0x0002, fill = 0xFFFF
    INT14 : origin = 0xFF9C, length = 0x0002, fill = 0xFFFF
    INT15 : origin = 0xFF9E, length = 0x0002, fill = 0xFFFF
    INT16 : origin = 0xFFA0, length = 0x0002, fill = 0xFFFF
    INT17 : origin = 0xFFA2, length = 0x0002, fill = 0xFFFF
    INT18 : origin = 0xFFA4, length = 0x0002, fill = 0xFFFF
    INT19 : origin = 0xFFA6, length = 0x0002, fill = 0xFFFF
    INT20 : origin = 0xFFA8, length = 0x0002, fill = 0xFFFF
    INT21 : origin = 0xFFAA, length = 0x0002, fill = 0xFFFF
    INT22 : origin = 0xFFAC, length = 0x0002, fill = 0xFFFF
    INT23 : origin = 0xFFAE, length = 0x0002, fill = 0xFFFF
    INT24 : origin = 0xFFB0, length = 0x0002, fill = 0xFFFF
    INT25 : origin = 0xFFB2, length = 0x0002, fill = 0xFFFF
    INT26 : origin = 0xFFB4, length = 0x0002, fill = 0xFFFF
    INT27 : origin = 0xFFB6, length = 0x0002, fill = 0xFFFF
    INT28 : origin = 0xFFB8, length = 0x0002, fill = 0xFFFF
    INT29 : origin = 0xFFBA, length = 0x0002, fill = 0xFFFF
    INT30 : origin = 0xFFBC, length = 0x0002, fill = 0xFFFF
    INT31 : origin = 0xFFBE, length = 0x0002, fill = 0xFFFF
    INT32 : origin = 0xFFC0, length = 0x0002, fill = 0xFFFF
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Jonathan Cheng26 said:
    But somehow the .bootloader section is empty when using ELF output format.

    Add this pragma ...

    #pragma RETAIN(Image_boot)

    Your program must not have any reads or writes of the array Image_boot.  In EABI, a data object that is never referenced is removed (left out, really) by the linker.  This is default behavior of the linker under EABI.  Under the old COFFABI, the default behavior is opposite.  A data object that is never referenced is still part of the program, unless special steps are taken. 

    I apologize for not recognizing this sooner. 

    Thanks and regards,

    -George