Hi Wulin,
Please disable the global interrupt before you do the flash operation.
If it is still not ok, please upload the project, I would like to help you to check it.
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------