Hi Joe,
The most important data is the Flash configuration filed:

The flash configuration field is in the bootloader area, so you don't need to afraid that the APP will modify it.
Just make sure the 0X40D, 0X40C data is which you need, if you want to secure and enable the erase, don't protect the area which you want to erase, and set 0X40C data to 0x03.
Wish it helps you!
If you still have question, please contact me!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------