Author Topic: SPI_DATA_FLASH  (Read 8853 times)

Offline hervé

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
« on: March 05, 2012, 05:53:27 PM »
Hi Mark,

I need to use two differents SPI FLASH memories, they have different block size

Even if I set SPI_FLASH_MULTIPLE_CHIPS, How can I manage to have different FILE_GRANULARITY for each memory ?


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3238
    • View Profile
    • uTasker
« Reply #1 on: March 08, 2012, 04:24:53 AM »
Hi Hervé

It is assumed that when multiple chips are used that they are of the same device type. The reason for this is that only one SPI Flash driver is used at a time.
Also it is assumed that the device size of constant - the reason being that when the page size changes ther is often a different driver operation (calculation of the page addressing).

The uFileSystem then expects to have a constant file granularity across the whole memory area. This Flash granularity can change across the area but it is the largest of all available Flash granularities that determines this minimum file granularity.

Therefore, if you have different SPI Flash devices, the single driver must be able to control them all. This is however unlikely due to the fact that the driver generally needs to know the correct page size to operare correctly - it would be possible to change the page calculation depending on the device which is presently being accessed quite easily though to make this dynamic (rather than fixed based on the page size define).

If you select the FILE_GRANULARITY to respect the largest FLASH_GRANULARITY value it should then be able to work like this over the complete range.

It is presently not possible to vary the FILE_GRANULARITY across the memory area since this is a fixed value.

I am wondering why there would be the need to have different types of SPI Flash in the uFileSystem area? Usually it makes sense to have multiple devices of the same type since it means that greater quantities of a single type are used and only one type needs to be purchased (logistics is optimised).