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.

AM2634: How to enable TLO in an engineering that has Low Latency Interrupt enabled

Part Number: AM2634

Tool/software:

In the Low Latency Interrupt routine, the compiler by default does not enable LTO. After manually enabling LTO, the compilation results in an error. The specific phenomena are as follows:

I would like to know if Low Latency Interrupt and LTO are incompatible with each other?If they are compatible, could you provide a specific modification plan?

  • Hi Way

    To fix this issue, please modify line 46 of the example as such:

    uint32_t gVimBaseAddr __attribute__((used)) = CSL_VIM_U_BASE;

    By adding __attribute__((used)) to gVimBaseAddr, we are explicitly telling the compiler (and thus the LTO process) that this symbol must be kept, regardless of whether the optimizer thinks it's used or not. Once gVimBaseAddr was guaranteed to be present, the LTO process could then correctly see that all the other interrupt-related functions and variables were indeed using it (or using functions that use it), so they were also preserved and linked correctly.

    Let me know if it helps!

    Regards,
    Akshit