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.

Linker errors Failed placement

Other Parts Discussed in Thread: MSPMATHLIB, DRV8313EVM

Hi,

I am facing linker errors failed memory allocation.

<Linking>
error #10099-D: program will not fit into available memory.  run placement with alignment fails for section "DATA_GROUP" size 0xee .  Available memory ranges:
   RAM          size: 0x200        unused: 0x25         max hole: 0x25      
remark #10422-D: (ULP 6.2) Detected use of a device with available 32-bit hardware multiplier and not also using MSPMATHLIB library (libmath.a).  Recommend using MSPMATHLIB library (libmath.a) for improved performance.
error #10010: errors encountered during linking; "DRV8313EVM_RevB.out" not built

wile adding code lines to existing program am getting these errors,i have tried optimization assistance but still no improvement,i also tried modifying stack and heap sizes in MSP430Linker still it is same.

Am unable to solve the issue however i have one doubt in Memory Allocation RAM size is 512Bytes and if i comment one function in the program the used space it shows 297(58%) and it is successfully getting compiled when i uncomment the function the used space is 475(92%) why there is so much difference my function consists only few lines of code and here comes linker errors.

Kindly suggest  ways to solve these errors

PL find the attached

Thank you in advance

  • This question has been answered a gazillion times before.

    Also, the linker is telling you what’s wrong: It tries to put the DATA_GROUP section of size 0xee into ram but there are only 0x25 bytes still unused. The rest is already occupied by other data segments or reserved for stack or heap.

    You simply have too many variables for the tiny 512 bytes of total ram.

    Your function most likely calls some library function which only then has to be included into the binary - and with it all the global or static variables it requires.
    Or your function itself has a large amount of static local variables. Static variables are globally allocated, while non-static local variables go onto the stack (which then will of course grow too, and eventually grow larger than the space reserved for it by the linker).
    Also, when calling a function form a different .c file, the linker usually has to link the whole content of this .c file, not just this function, even if all the other functions in it are not used. This does, however, depend on the compiler/linker and its settings.

    In any case, it would have been more helpful to see the code of repeat_delay rather than how you call it.

**Attention** This is a public forum