Hello Priyank,
If I understood correct, you want to write in the flash while you are executing also from flash, right?
This is not possible, if you want to write in flash then you must be running from RAM. For example, you should move the specific functions that are writing on the flash to the RAM memory. I recommend you read the following community post to see how to do this. Relocating Code and Data Using the MCUXpresso IDE
Hope it helps!
Victor.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------