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.

CCS/MSP430G2955: GNU compiler v4.9.1 optimization problem

Part Number: MSP430G2955

Tool/software: Code Composer Studio

Dear TI-team,

I'm using CCS  Version: 6.0.1.00040 and GNU compiler v4.9.1. In my project in msp430g55.ld file I have divided FLASH memory space into two parts: my own bootloader (in MY_SEGMENT) and other project functions (in ROM), and they should works independent!. As I can see in a *.map file all my bootloader functions are located in MY_SEGMENT address space. But in generated assembler listing files I see that compiler uses some optimization functions like "__mspabi_srli_4" from ROM address space in my bootloader functions. But my bootloader should works independent, even if other FLASH memory space is empty. I have tryed to use  __attribute__(optimize("O0"))) for each function of my bootloader, but problem still remain. How can I force compiler to optimize within each code segment only, or how can I disable this substitutions for dedicated functions?

Thank you in advance.

  • Hi,

    If I understood your question correctly, you are trying to completely segregate your code between a custom bootloader and the application, but found out the compiler is using some functions that do not originally belong to your code, is that so?

    The function you mentioned is part of the GCC runtime support library (RTS) and discussed below:
    e2e.ti.com/.../412062

    Therefore, it is possible that you either:
    - need to use a more aggressive optimization to remove these stub calls (as mentioned in the thread above)
    - substitute the RTS calls by creating the functions yourself
    - move parts of the RTS library to the memory segment MY_SEGMENT. For that, you would need to change your linker command file. Check this reference: www.math.utah.edu/.../ld_3.html

    Hope this helps,
    Rafael