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.

Compiler/TMS320F28377D: Error after executing division operation in TMS320F28377

Part Number: TMS320F28377D

Tool/software: TI C/C++ Compiler

Hi everyone, I am working on a TMS320F28377 project and there is a weird bug. 

I set an EPWM1 interrupt and execute a series of functions in the interrupt function. Several division operations are included in the codes.

The bug is that after executing the division operation, the entrance address of the interrupt disappears.  The DSP will no longer return to the upper level calibrate() function, it enter a trap interrupt and stops at address 0x3fe493. Meanwhile, the calculation results of the division operation is also incorrect.

 

I've tried to remove the division operation codes and the DSP runs smoothly. I also tried to execute the code on another DSP and the bug still exists.

 

It looks like there are something wrong with my compiler or linker configurations. The related pictures are shown below. Could someone help me with this issues? Thanks a lot!

Before Executing the Division Operation

function call stack

code

data


 

After Executing the Division Operation

function call stack (The entrance address in function calibrate() disappears) 

code


data (The execution result of elec is incorrect, the expected value should be around 0.0004)

The compiler configuration

The linker configuration