TMS320F28377D: TMS320F28377 Online upgrade problem?

Part Number: TMS320F28377D

Tool/software:

TMS320F28377 Online upgrade problem.docx

At present, in the process of online upgrade, when global optimization is enabled, the program runs into abnormal estop. At this time, global optimization is turned off, and the program is normal. Attempts to turn off optimization in the file where this error function is located have no effect. Then I tried to close the official flash library, and an error was reported. Below is a screenshot of the error after turning off local optimization:

I have two questions, 1, why is there no error when the global optimization is turned off, but the local optimization will report an error? 2. How to solve the error caused by optimization problems?