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.

TMS320F280049C: Hwi_getIrp() always return 0

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE, LAUNCHXL-F280049C

Tool/software:

Hi,

I am using F280049C microcontroller in my project.

I been having FPU overflow ISR raised in my project and I would like to trace the memory address of the function that cause the issue for better debugging purpose.

I have hooked the FPU overflow vector ID to a callback function and enabled the interrupt that got triggered.

I did the following trying to trace the address of the function but the hwi handle is optimised and Hwi_getIrp() is returning 0U.

// hook interrupt vect id to isr
void HwiISR_init(void) {
    Hwi_plug(126U, FPU_isr);
    Hwi_enableInterrupt(126U);
}

// hook interrupt to callback function
__interrupt void FPU_isr(void) {

    processFloatingPointOptErrors();
}

// process error and get address of function causing issue
void processFloatingPointOptErrors() {
    static Hwi_Handle isrHandle;
    
    isrHandle = Hwi_getHandle(126U); // the handle is always optimised
    
    uint32_t addr = Hwi_getIrp(isrHandle); // return 0U
    
}

What did I missed? 

My environment is as below:

Optimisation level: 0 - Register Optimisations

Speed vs. size trade-offs: 0 (szie)

CCS Version: 10.3.1.00003 

Compiler version: TI v22.6.0.LTS

C2000Ware version: C2000Ware_4_02_00_00

Hardware: LAUNCHXL-F280049C Evaluation board

  • So you haven't created a Hwi instance for the FPU interrupt? You're just using Hwi_plug? Since the interrupt doesn't actually have an associated Hwi instance, I wouldn't expect the Hwi_getHandle or Hwi_getIrp functions to be able to return valid values.

    What happens if you just single step through the return of the FPU_isr() function? Does that work? Since you've used Hwi_plug(), it shouldn't go back through the Hwi dispatcher and should instead return back to the code that caused the issue.

    Whitney

  • Hello,

    So yes I figured out to configure the Hwi in .config file to handle creating the Hwi instance.

    One thing I wasn't sure was I have to manually do Hwi_enableInterrupt() to get the isr triggered despite the fact that I have checked the box of "Enable at startup" of the Hwi instance.

  • So once you created the Hwi in the cfg file and removed the Hwi_plug() call, did the Hwi_getIrp() start working? Or are you still having trouble narrowing down the FPU error location?

    Not sure why the "Enable at startup" checkbox wouldn't work. I would check to see if it's enabled at the start but maybe there's some code inadvertently clearing the IER registers?

    Whitney