I'm using a MK10FN1M0VLQ12.
I must modify an old function from a previous project that writes to MCU flash (not the same MCU).
I have a lot of access to register PFB0CR in my old code.
But this register is doubled in MK10FN1M0VLQ12, called PFB01CR and PFB23CR.
I don't understand which one I should use. I must write to a region at address 0xFF000 to 0xFFFFF. What memory bank is this?
The reference manual says:
• For devices with program flash only: 4 blocks of program flash consisting of 4 KB
• FMC_PFB01CR controls the lower code addresses (blocks 0-1)
• FMC_PFB23CR controls the upper code addresses (blocks 2-3)
So is the flash memory (1MByte) divided in four parts so
block 0 = 0x00000000 - 0x001FFFFF
block 1 = 0x00200000 - 0x003FFFFF
block 2 = 0x00400000 - 0x005FFFFF
block 3 = 0x00600000 - 0x007FFFFF
And if this is correct I should use PFB23CR?
And one more question. Do I still need to invalidate the cache ways?
FMC->PFB01CR = PFB0CR_restore | FMC_PFB01CR_CINV_WAY(15);