FlexNV programming issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FlexNV programming issue

474 Views
davidsherman
Senior Contributor I

I'm seeing something strange when programming the FlexNV data section.  If I use it as data flash (not EEPROM), I can program it successfully, however, it does not read back the correct data even though the verify operation passes.  I see this with both the driver I wrote and with the KSDK driver for the KE18F512.  If I restart the debugger, I can then see what I've programmed.  Is there some secret to getting it to refresh and show correct data after programming?

0 Kudos
2 Replies

365 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

The Flash access via FMC(Flash Memory Controller), which has the 128 (64 for bank1, Data Flash)-bit prefetch speculation buffer with controls for instruction/data access per master and bank.

In default, the speculation buffer is enabled for instruction and data.

Customer could use MSCM_OCMDR1 register (related to data Flash) [OCMC1] bit5 & bit4 to invalidate the speculation buffer.

OCMDR1[4] or OCMDR1[5] bit controls whether prefetches (or speculative accesses) are initiated in
response to instruction fetches or data references, see section FMC speculative reads.
• OCMDR bit 4: Data Prefetch. Value 0 means enable and value 1 means disable.
• OCMDR bit 5: Flash Speculate. Value 0 means enable and value 1 means disable.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

365 Views
davidsherman
Senior Contributor I

Thank you, Ma Hui, that led me on the right track.  It turns out the cache was enabled for the FlexNVM as well, so that also had to be disabled to see the change take effect.  Now that I understand what was going on I can figure out how to get the cache back in sync.  Thanks!

0 Kudos