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.

error #10099-D: program will not fit into available

Other Parts Discussed in Thread: MSP430F2234

please help me! when i use acos() function in C,  error: 

"./lnk.cmd", line 48: error #10099-D: program will not fit into available
    memory.  placement with alignment fails for section ".text" size 0x2b12 .
    Available memory ranges:
    FLASH        size: 0x1000       unused: 0xe56        max hole: 0xe56    
please tell me the method fix error!!
Thanks very much
  • The immediate reason for your problem is that the .text section is size 0x2b12, which doesn't fit in a FLASH memory range of size 0x1000.

    You seem to imply that it all fit before you added the call to acos.  That says calling acos caused your .text section to increase in size by much more than 0x1000.  While acos, and all the things it requires, can require a lot of memory, it can't be that much.  There must be something else going on.

    I expect this wiki article to be at least somewhat helpful.

    Thanks and regards,

    -George

  • Hi,

    I am using ccs 6.1.1 version for my purpose. when i give for compilation for below code , ccs is throwing error(#10099-D).

    #include <msp430.h>

    #include <math.h>

    /*

    * main.c

    */

    void main(void) {

       WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

        acos(0);

    }

    #10010 errors encountered during linking; "test_target.out" not built

    #10099-D</a>  program will not fit into available memory.  placement with alignment fails for section ".text" size 0x20d8 .  Available memory ranges: lnk_msp430f2234.cmd

    Am i missing any thing in the code ?

  • The function acos, and everything it requires, takes up 8368 bytes of code space.  You don't have enough memory for that on a MSP430F2234 device.

    Thanks and regards,

    -George

  • Shafi t a77 said:
      acos(0);

    Do you need the double precision provided by acos?

    The reason is that changing to use the single-precision acosf function reduces the code size required to 2910 bytes, and the following fits in a MSP430F2234:

    #include <msp430.h>
    #include <math.h>
    
    /*
     * main.c
     */
    void main(void) {
        WDTCTL = WDTPW | WDTHOLD;	// Stop watchdog timer
    	
    	acosf (0);
    }

  • Hi All,

    Thank you for replying. I am in need of double precision.
    I want to Implement haversine formula to find the distance between two gps co-ordinates.
    Is there any other alternative method or code to find the distance between two GPS co-ordinates? which will fit in available memory of MSP430F2234 Microcontroller
  • Shafi t a77 said:
    Is there any other alternative method or code to find the distance between two GPS co-ordinates? which will fit in available memory of MSP430F2234 Microcontroller

    From a search found the Stackoverflow thread How do I calculate distance between GPS co-ordinates on a processor with poor floating point support?. One of the answers in that thread suggests to use the Rhumb Line algorithm with fixed point maths.

    I haven't attempted to implement the algorithm on a MSP430 device to determine the code size or accuracy.