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.

AM6442: Clang warning : call to function without interrupt attribute could clobber interruptee's VFP registers

Part Number: AM6442

Hi 

My customer is using the MCU+SDK 7.3 within AM6442.

By writing a function and ISR like this:

void main(void)

{

        …

        functionA()

        …

        Enable interrupt.

}

__attribute__((interrupt(“IRQ”))) void ISR(void);

void ISR(void)

{

        …

        functionA()

         …

}

then, the clang complier 1.2 will give us this warning:==> call to function without interrupt attribute could clobber interruptee's VFP registers

If declaring A as this way:

__attribute__((interrupt("IRQ"))) void functionA(void);

The warning will disappear.

So, my questions are:

A. How to avoid this warning? If not, any side effect?

B. the AM6442 CLS layer has many this kinds of warning, is this okay?

BR Rio

  • https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/KERNEL_FREERTOS_PAGE.html

    Hi Rio,

    The SDK with FreeRTOS does not save/restore FPU registers unless between task switches unless you call the function vPortTaskUsesFPU()

    In IRQ it also needs the programmer to save/restore FPU registers when the FPU is used in an ISR.

  • Hi Ahmad:

    Thanks, more 3 questions:

    Q1: Does It mean if we don’t need to use any Float point, we don’t need to care this warning? => warning : call to function without interrupt attribute could clobber interruptee's VFP registers
    Q2. This API : vPortTaskUsesFPU is also working for OS + noneOS?
    Q3. If an ISR has a function inside it, do we need to deal with the FPU register in the ISR or in the functions?

    BR Rio

  • Hi Rio,

    The interrupt keyword is applied to an ISR function as below. This tells the compiler to perform the context save / restore on general purpose registers. The keyword is for the Clang compiler and is not OS dependent.

    void __attribute__((interrupt("IRQ"), section(".text.hwi"))) irq_handler_function_name(void)

    A1: When any functions are called within the ISR the warning will be displayed. So if you do not use float point / FPU in those functions then you can ignore the warning. You can suppress it using -Wno-extra 

    A2: This API is only for FreeRTOS and it applies to task switching. When multiple tasks are running, you also need to save/restore context in tasks. So you call this API to ensure the context save/restore includes FPU registers.

    A3: Let me see if we have a SW example for this. 

  • Deeply appreciated with your fast reply, Ahmad.

    plz wait our sync with customers.