Flashx, Some more Detail

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Flashx, Some more Detail

跳至解决方案
1,559 次查看
CarlFST60L
Senior Contributor II

Can someone shed some light on exactly what and why these would be used?

 

FLASH_IOCTL_FLUSH_BUFFER

FLASH_IOCTL_ENABLE_BUFFERING

FLASH_IOCTL_ENABLE_SECTOR_CACHE

 

There is some information on these in the MQXIOUG.pdf, but nothing seems to say why these exsist i.e. whats their use? Obviously they are there for a reason...

 

 

 

 

 

0 项奖励
1 解答
529 次查看
PetrL
NXP Employee
NXP Employee

I will try to explain it.

 

FLASH_IOCTL_ENABLE_BUFFERING, FLASH_IOCTL_DISABLE_BUFFERING, FLASH_IOCTL_FLUSH_BUFFER


  • - in this mode driver internally allocate RAM buffer of FLASH sector size(4KB for MCF52259)
  • - if you writing to flash device writes to same sector are buffered and written to flash at once

 

FLASH_IOCTL_ENABLE_SECTOR_CACHE, FLASH_IOCTL_DISABLE_SECTOR_CACHE


  • - intend of this is RAM saving, but it restrict functionality of driver
  • - when you want to write new data to flash - driver have to store read current content of flash sector to RAM buffer, clear flash sector, modify data in buffer and write it back to flash. For this buffer of Flash sector size is required.
  • - if you know that you will do only listed actions, you do not need RAM buffer

    •  * Incremental write to erased area
    •  * Full sector write
    •  * Partial sector overwrite when the remaining area of

      sector is erased.
  • - this feature can be used e.g.. if you are saving whole parameter structure still on the same place in flash, overwriting all previously stored data.. Then you do not need quite big RAM sector buffer.

 

PetrL


在原帖中查看解决方案

0 项奖励
2 回复数
530 次查看
PetrL
NXP Employee
NXP Employee

I will try to explain it.

 

FLASH_IOCTL_ENABLE_BUFFERING, FLASH_IOCTL_DISABLE_BUFFERING, FLASH_IOCTL_FLUSH_BUFFER


  • - in this mode driver internally allocate RAM buffer of FLASH sector size(4KB for MCF52259)
  • - if you writing to flash device writes to same sector are buffered and written to flash at once

 

FLASH_IOCTL_ENABLE_SECTOR_CACHE, FLASH_IOCTL_DISABLE_SECTOR_CACHE


  • - intend of this is RAM saving, but it restrict functionality of driver
  • - when you want to write new data to flash - driver have to store read current content of flash sector to RAM buffer, clear flash sector, modify data in buffer and write it back to flash. For this buffer of Flash sector size is required.
  • - if you know that you will do only listed actions, you do not need RAM buffer

    •  * Incremental write to erased area
    •  * Full sector write
    •  * Partial sector overwrite when the remaining area of

      sector is erased.
  • - this feature can be used e.g.. if you are saving whole parameter structure still on the same place in flash, overwriting all previously stored data.. Then you do not need quite big RAM sector buffer.

 

PetrL


0 项奖励
529 次查看
CarlFST60L
Senior Contributor II

Thanks PetrL. 

 

Message Edited by CarlFST60L on 2009-08-11 11:50 PM
0 项奖励