hi Suman,
how did you protect the Pflash?
One solution in CW 10.1 would be to use Target Tasks to download the application.
To do that, from Target Tasks view, you need to:
- Import () Flash_Programmer/ARM/K40DX256Z.xml.

2 . Double click on the “Erase” action to edit it
3. Uncheck “Mass erase all devices”
4. Select only FTFL_PFlash256 from the left hand grid box and select the sectors you need to erase

5. Click “Update Erase Action”
7. Save Flash Programmer task with CTRL-S and you may choose to save it to a file in the project folder
8. Open Debug Configurations/<Your Download configuration>, Click on Debugger tab, then on Download Tab
9. Uncheck “Perform Standard Download”, and check “Execute Tasks”
10. Add... the previously edited target task “K40DX256Z”

11. Click Apply
Now the download procedure will not affect the D-Flash anymore.
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------