Flashx, Some more Detail

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

Flashx, Some more Detail

Jump to solution
1,813 Views
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 Kudos
Reply
1 Solution
783 Views
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


View solution in original post

0 Kudos
Reply
2 Replies
784 Views
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 Kudos
Reply
783 Views
CarlFST60L
Senior Contributor II

Thanks PetrL. 

 

Message Edited by CarlFST60L on 2009-08-11 11:50 PM
0 Kudos
Reply