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.

msp430f2002 linking error, placement failed .text

Other Parts Discussed in Thread: MSP430F2002

Hi,

I got some troubles using the msp430f2002 target board (with the usb programming interface).

everything worked perfecly until i had do a operation with 2 variables, for exemple

var3=var1-var2; ( or * / + ..)

Since i've written this into my code, there were some error in debugging the project :

placement fails ogt object ".text"

linking failed. Check the console window for details

error encountered during linking "project.out" not built

The console error displays the follwing messages :

c:\ program \.....\CC essantials v3.1\utils\gmake\gmaker :  *** [project.out] Error 1

c:\ program \.....\CC essantials v3.1\utils\gmake\gmaker : 

target 'all' not remade becaus of errors

 

This probleme is only when i try this kind of operations... any idea of the problem?

 

Thanks for your help

 

Nicolas

 

 

  • The linker error, in general, means that the linker was not able to allocate the specificed section, in this case .text, to the emory region it is allocated to.

    Please take a look at this FAQ for a general explanation: http://tiexpressdsp.com/wiki/index.php?title=CCE_FAQs#What_does_the_CCE_linker_error:_.27placement_fails_for_object_.22xxx.22.27_mean_and_how_to_fix_it.3F

    In this case, it means your code (.text section) is too large to fit into the available FLASH memory for the device you are using. As suggested in the FAQ, the link map file will be helpful in looking at the size and allocation of the different sections.

  • Hi,

    thanks for your reply :)

    you're right, it seems that code is too large for memory. I produced the file map, and saw that CC failed to allocate memory to the .text

    So i tried the simpliest programm to test operation with 2 variable and that work.

    Here' s my code, without any comment, useless space or linebreak, wich seems to be still too large :

    #include  "msp430x20x2.h"
    void main(void)
    {
    double ocv,v2,resistor;
    signed int value,value2;
    WDTCTL=WDTPW+WDTHOLD;                
      ADC10CTL0=ADC10SHT_3+ADC10ON+ADC10IE+SREF_1+REFON+REF2_5V;
      ADC10CTL1=INCH_1;                      
      ADC10AE0|=0x02;                        
      P1DIR|=0x01;                           
    ADC10CTL0|=ENC + ADC10SC;            
    while(TAIFG!=1)        
    {}
    value=ADC10MEM;
    ocv=(value*2.579)/(1023*0.62305296);
      TAR=0;
      CCTL0=CCIE;                           
      CCR0=32;       
      TACTL=TASSEL_1+MC_1;              
    P1DIR=0x10;
    P1OUT=0x10;
    while(TAR<7)
    {}
    ADC10CTL0|=ENC+ADC10SC;
    while(TAIFG!=1)        
    {}
    value2=ADC10MEM;
    v2=(value2*2.579)/(1023*0.62305296);
    P1OUT^=0x10;
    resistor=(ocv-v2)/0.001;
    }

    I don't really know what to do about this issue. Any workaround or solution in your mind ?

    Another question : i didn't managed to let the timer start counting in debug mode (even if in runmode i checked that the timer was properly running with a timered led blinking). is it normal that TAR stay at 0 in debugmode?

    Thank you again for your support :)

  • My .text is 1070 bytes weight, and if i'm not mistaking there's only a 1kB memory on the msp430f2002 ..

    any ideas for saving 70bytes :) ? 

  • Hi nicolas,

    what are your settings for code optimization? In case of IAR have a look at PROJECT-->OPTIONS-->COMPILER-->OPTIMITZATION.

    The screen below shows the default settings.

    I would recommend to try out MEDIUM AND HIGH. Pls note that HIGH may result in code which may cause problems during debugging but NOT in your application.

    In case of CCS you should have a look at PROJECT-->PROPERTIES-->C.. BUILD-->COMPILER-->BASIC OPTIONS. I would recommend to try --opt_for_speed = 0 and --opt_level = 3 (see screen below).

    Rgds
    aBUGSworstnightmare

  • that's working perfectly now :)

    Thanks you for your help, support and pleasant answers

    Nicolas

     

     

  • Dear Sir

     

    I bought MSP-FET430UIF from Farnell. After 5min. working LEDs are off and nothing doing since this time. Only push on or pull off USB cable PC HW manager recognize it. Is it possible to find mistake and repair it?

    Thank you.

  • Hi Bohdan,

    I have seen and responded to your other post.  Lets look at this there.  I will mark this as a duplicate.

    Best Regards,
    Lisa

**Attention** This is a public forum