If compiler optimize is closed, EDMA is right.
I open compiler optimize. The level is o1, EDMA is right.
When the level is o3, EDMA is wrong. The program halts at judging if EDMA is over. Then I set the optimize level of the file which realizes the function of my_sing_edma1() is o1, the problem also exists. IPR is set in register window, so the program shouldn't halt. If I add a printf in front of judging if edma is over, the program is right. Why does this occur? How to slove this problem?