Folks,
I have an issue when storing data into flash memory during my program's run time (I need to use one page of Flash memory in my program instead of using the EEPROM).
These are the steps I follow during testing:
1) I flash a new firmware into my ICE (I have never manually written anything to Flash before this step, other than bootloader and firmware flashing)
2) I run my program and write one page of data to Flash, I read it back to confirm. Then I power cycle, and repeat process. I do this several times, and it always works.
3) I flash a new firmware into my ICE board (something happens during this step that seems to block my flash for manual use)
4) I repeat step 2, but this time I get back zeros when I read the same page from my Flash.
Now, in order to initialize SPI0 to manually write to flash, then I have to set SPI0 to SINGLE CHANNEL mode. I don't know why it only works there. But I can flash my firmware with either SINGLE or MULTI CHANNEL mode. I tried flashing the firmware both modes, and I still have the same problem as in step 4 above. I am writing my page in location 0xB0000 (page location suggestions are welcomed).
Is there a blocking or write protect being enabled, perhaps, after I write data and then flash my firmware?