2. program 0x01020304 at 0x1000_0000
3. read data from 0x1000_0000. Then, read value is still 0xFFFFFFFF as same with the value at step1.
4. read data from 0x1000_0008. Then, read data from 0x1000_0000, again. Read value got 0x01020304 as programmed value.
With the buffer enabled, you can reprogram DFlash at location X, then read another location Y and only after that read X, and the data at X should be correct.
((*(volatile uint32*)(MSCM_BASE+FLS_OCMDR1_OFFSET))|= (FLS_MSCM_OCMDR1_OCMC1_U32));
((*(volatile uint32*)(MSCM_BASE+FLS_OCMDR1_OFFSET))&= (~(FLS_MSCM_OCMDR1_OCMC1_U32)));
prefetch buffer have to be disabled when modifying the contents of flash. This can be done by setting MSCM OCMDR both of bit #4 and #5 to '1'. read Dataflash will correct.
I give some explain if customer meet this issue when read S32K14x Dataflash. thanks.
Could you clarify your question?
MSCM->OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u);
MSCM->OCMDR[1u] |= MSCM_OCMDR_OCM1(0x3u);