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.
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.
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 - 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 INT33 : origin = 0xFFC2, length = 0x0002, fill = 0xFFFF INT34 : origin = 0xFFC4, length = 0x0002, fill = 0xFFFF INT35 : origin = 0xFFC6, length = 0x0002, fill = 0xFFFF INT36 : origin = 0xFFC8, length = 0x0002, fill = 0xFFFF INT37 : origin = 0xFFCA, length = 0x0002, fill = 0xFFFF INT38 : origin = 0xFFCC, length = 0x0002, fill = 0xFFFF INT39 : origin = 0xFFCE, length = 0x0002, fill = 0xFFFF INT40 : origin = 0xFFD0, length = 0x0002, fill = 0xFFFF INT41 : origin = 0xFFD2, length = 0x0002, fill = 0xFFFF INT42 : origin = 0xFFD4, length = 0x0002, fill = 0xFFFF INT43 : origin = 0xFFD6, length = 0x0002, fill = 0xFFFF INT44 : origin = 0xFFD8, length = 0x0002, fill = 0xFFFF INT45 : origin = 0xFFDA, length = 0x0002, fill = 0xFFFF INT46 : origin = 0xFFDC, length = 0x0002, fill = 0xFFFF INT47 : origin = 0xFFDE, length = 0x0002, fill = 0xFFFF INT48 : origin = 0xFFE0, length = 0x0002, fill = 0xFFFF INT49 : origin = 0xFFE2, length = 0x0002, fill = 0xFFFF INT50 : origin = 0xFFE4, length = 0x0002, fill = 0xFFFF INT51 : origin = 0xFFE6, length = 0x0002, fill = 0xFFFF INT52 : origin = 0xFFE8, length = 0x0002, fill = 0xFFFF INT53 : origin = 0xFFEA, length = 0x0002, fill = 0xFFFF INT54 : origin = 0xFFEC, length = 0x0002, fill = 0xFFFF INT55 : origin = 0xFFEE, length = 0x0002, fill = 0xFFFF INT56 : origin = 0xFFF0, length = 0x0002, fill = 0xFFFF INT57 : origin = 0xFFF2, length = 0x0002, fill = 0xFFFF INT58 : origin = 0xFFF4, length = 0x0002, fill = 0xFFFF INT59 : origin = 0xFFF6, length = 0x0002, fill = 0xFFFF INT60 : origin = 0xFFF8, length = 0x0002, fill = 0xFFFF INT61 : origin = 0xFFFA, length = 0x0002, fill = 0xFFFF INT62 : origin = 0xFFFC, length = 0x0002, fill = 0xFFFF RESET : origin = 0xFFFE, length = 0x0002, fill = 0xFFFF } /****************************************************************************/ /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */ /****************************************************************************/ SECTIONS { .bss : {} > RAM /* GLOBAL & STATIC VARS */ .data : {} > RAM /* GLOBAL & STATIC VARS */ .sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */ .stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */ .text : {} > FLASH /* CODE */ .cinit : {} > FLASH /* INITIALIZATION TABLES */ .const : {} > FLASH /* CONSTANT DATA */ .cio : {} > RAM /* C I/O BUFFER */ //.codeData : {} > FLASH2 /* CODE READ ONLY DATA */ .bootloader : {} > BOOTLOADER /* BOOTLOADER CODE */ .infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */ .infoB : {} > INFOB .infoC : {} > INFOC .infoD : {} > INFOD /* MSP430 INTERRUPT VECTORS */ .int00 : {} > INT00 .int01 : {} > INT01 .int02 : {} > INT02 .int03 : {} > INT03 .int04 : {} > INT04 .int05 : {} > INT05 .int06 : {} > INT06 .int07 : {} > INT07 .int08 : {} > INT08 .int09 : {} > INT09 .int10 : {} > INT10 .int11 : {} > INT11 .int12 : {} > INT12 .int13 : {} > INT13 .int14 : {} > INT14 .int15 : {} > INT15 .int16 : {} > INT16 .int17 : {} > INT17 .int18 : {} > INT18 .int19 : {} > INT19 .int20 : {} > INT20 .int21 : {} > INT21 .int22 : {} > INT22 .int23 : {} > INT23 .int24 : {} > INT24 .int25 : {} > INT25 .int26 : {} > INT26 .int27 : {} > INT27 .int28 : {} > INT28 .int29 : {} > INT29 .int30 : {} > INT30 .int31 : {} > INT31 .int32 : {} > INT32 .int33 : {} > INT33 .int34 : {} > INT34 .int35 : {} > INT35 .int36 : {} > INT36 .int37 : {} > INT37 .int38 : {} > INT38 .int39 : {} > INT39 .int40 : {} > INT40 .int41 : {} > INT41 .int42 : {} > INT42 .int43 : {} > INT43 .int44 : {} > INT44 AES : { * ( .int45 ) } > INT45 type = VECT_INIT RTC : { * ( .int46 ) } > INT46 type = VECT_INIT LCD_B : { * ( .int47 ) } > INT47 type = VECT_INIT PORT2 : { * ( .int48 ) } > INT48 type = VECT_INIT PORT1 : { * ( .int49 ) } > INT49 type = VECT_INIT TIMER1_A1 : { * ( .int50 ) } > INT50 type = VECT_INIT TIMER1_A0 : { * ( .int51 ) } > INT51 type = VECT_INIT DMA : { * ( .int52 ) } > INT52 type = VECT_INIT CC1101 : { * ( .int53 ) } > INT53 type = VECT_INIT TIMER0_A1 : { * ( .int54 ) } > INT54 type = VECT_INIT TIMER0_A0 : { * ( .int55 ) } > INT55 type = VECT_INIT ADC12 : { * ( .int56 ) } > INT56 type = VECT_INIT USCI_B0 : { * ( .int57 ) } > INT57 type = VECT_INIT USCI_A0 : { * ( .int58 ) } > INT58 type = VECT_INIT WDT : { * ( .int59 ) } > INT59 type = VECT_INIT COMP_B : { * ( .int60 ) } > INT60 type = VECT_INIT UNMI : { * ( .int61 ) } > INT61 type = VECT_INIT SYSNMI : { * ( .int62 ) } > INT62 type = VECT_INIT .reset : {} > RESET /* MSP430 RESET VECTOR */ } /****************************************************************************/ /* INCLUDE PERIPHERALS MEMORY MAP */ /****************************************************************************/ -l cc430f6137.cmd
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