I'm trying write a program to download codes into the flash. I've put the program in RAM, but it failed to modify the flash contents. I'm trying to change content start from 0x0100000. Sometimes it changed but the content is different with the source address, and sometimes it couldn't be modified at all.
My question is, am I doing the right way by write data to the coresponding flash address and validate it by writing the MC_FCR register? Do I need to erase the page first before I write it?