Hello again @jacob3,
According to the first image that you provided me I understand the next flow code (correct me if I am wrong):
You define a pointer that points to 0x4000000 that is the initial section of the RAM and puts 555 in this direction:

After, you select sector of the FLASH that you will write, and then is used the function called " RAM_to_FLASH", in order to support you better, can you provide me the code inside this function?
Finally, you make a pointer that will point to the FLASH address (0x1000) and you read the value:

However, in the debug section can be observed that the variable called "nn" already have the data that you have written in FLASH.
On the other hand, when you write a new image, the flash is erased, taking this in mind, if you read an address before writing, you do not know what data will have.
Also, in the chapter 29.8 called "IAP commands" explains the function of IAP and explains the "IAP Command Summary" that could be helpful.
BR
Habib.