Hello @SpeedyGonzalesss,
Sorry for taking a while to get back to you.
In the case that you are currently using XIP mode you cannot use the same FLASH to storage, this because the XIP needs to obtain the next instruction from the flash, and in the case that you want to read/write the core probably does not obtain the next instruction and consequently, the code becomes nonsense.
If this is the case, you can use non XIP, this means that the code is going to run in RAM obtaining the code from the FLASH. If you wish to try running it in RAM, you can consult this app note.
Also, if you experience any issue, do not hesitate to let me know.
BR
Habib.