Erasing NOR block 0

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,443件の閲覧回数
jBrizzle
Contributor I

Hello,

I'm working writing a custom bootloader for a MK20FN1MVMD12, but I'm running into an issue when I erase block 0. After erasing the entire block by successively calling the erase sector command, any software reads to an address in block 0 results in reading the previous value (not 0xFF). No error is being reported, and the "read 1s section" command indicates that everything was erased properly.

Some potentially important information:

  • This only happens when I erase block 0.
  • I read the data by doing something like "data = ( ( volatile uint32 * )0x00000000 )[ offset ]" where offset is a value < ( block size / 4 ).
  • I am executing out of RAM while performing the erase.
  • The FTFE is unsecure at all times during this process.
  • If I attempt to write >= 0xC1 bytes after erasing the block, I am able to read properly, but no data is actually written at that point. Any subsequent write calls complete as expected.
  • If I use a debugger to look at the erased block, I see that everything was erased, and all subsequent reads in my code work properly.

Any thoughts?

ラベル(1)
0 件の賞賛
返信
1 解決策
1,322件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

The flash memory controller will come up in a valid configuration with the cache and prefetch buffers enabled.

If a firmware driver is used to program flash values, then a flush of the cache might be needed. The cache has no means of snooping to know when a program operation occurs, so a flush is needed to ensure that the cache does not return stale data.

Wish it helps.   

best regards,

Ma Hui

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,323件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

The flash memory controller will come up in a valid configuration with the cache and prefetch buffers enabled.

If a firmware driver is used to program flash values, then a flush of the cache might be needed. The cache has no means of snooping to know when a program operation occurs, so a flush is needed to ensure that the cache does not return stale data.

Wish it helps.   

best regards,

Ma Hui

0 件の賞賛
返信
1,322件の閲覧回数
jBrizzle
Contributor I

The cache was definitely the problem for me. My NOR driver was not flushing the cache after it wrote or erased which was causing all my problems.

Thanks for your help,

Jordan

0 件の賞賛
返信
1,322件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

I am checking this issue. I will let you know when there with any updated info.

Thank you for the patience.

Best regards,

Ma Hui

0 件の賞賛
返信