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.

TMS320F28388D: Local variable is not correct in function that called in NMI interrupt function

Genius 3186 points
Part Number: TMS320F28388D


Hi

My customer is developing F28388D with CCS.

In coding and debugging, Local variable was not correct in the function that called NMI interrupt function.

(In CCS browser, Local variable location is not CPU register, is in memory.)

To be exact, NMI interrupt call another user defined function -> user defined function call the function that have uncorrect.

But the function that had NOTcorrect local variable is works exactly as I expect it to, In called in main function.

(If called main function, Local variable located in CPU registers)

If you have information to help me, Could you let me?

Thanks.

GR

  • Hi GR,

    Do you mean:

    1. When NMI is called from another function, the variable is wrong

    2. When NMI is called from main, the variable is correct

    ??

    If so, can you make sure that the variable is not being set by another function in the code? You can do a global search of the variable by highlighting the variable name and pressing CTRL+H to find all the instances.

    Also you may want to define the variable as "volatile" if you are wanting it to be changing within interrupts but accessible from the main.

    Regards,

    Vince

  • Hi Vince,

    Thank you to your support.

    My customer had been solved this by change this that is in C2000were diverlib/interrupt.h (line 215).

    before : static void Interrupt_nmiHandler(void)

    after : __interrupt static void Interrupt_nmiHandler(void)

    Is there any reson  did not add the __interrupt Keyword in driverlib?

    Best Regards,

    GR

  • Hi GR,

    Thanks for your follow-up. I checking with the SW experts and asking whether this prefix should be added to the driverlib code.

    Regards,

    Vince

  • Hi Vince,

    Thank you to your support.

    If there is any update, please let me.

    Best Regards,

    GR

  • Hi GR,

    Customer is correct that __interrupt is required before the function, we have submitted this as a bug and will be corrected in a future version of driverlib. Thank you for your help and feedback.

    Regards,

    Vince

  • Hi Vince,

    Thank you to your support.

    I understand.

    Best Regards,

    GR