Skip to contentSkip to conversation

flash question

U-Boot-Users jack W 3 participants 4 messages Dec 4, 2004

lore
Share & tools
lore

jack W

author
#0 lore raw

hi everyone

i am a newer i have a question about flash , i have a nor flash and its type is SST39VF160 . I don't know how to set the CFG_MAX_FLASH_SECT. the flash's sector is 2k .and i think that the CFG_MAX_FLASH_SECT is 4096/2=2148 right?

thank you

#1 lore raw

Hi Jack,

Quoted 4 lines · jack W

i am a newer i have a question about flash , i have a nor flash and
its type is SST39VF160 . I don't know how to set the CFG_MAX_FLASH_SECT. the flash's sector is 2k .and i think that the CFG_MAX_FLASH_SECT is 4096/2=2148 right?

No! You have to configure the maxmium sector count with this define (and _not_ the sector-size!). Most of the time I set this to 256. This should sufficient for most flash's.

Best regards,
Stefan

#2 lore raw
Quoted 4 lines · In message <[email protected]> Stefan Roese wrote:
Quoted 2 lines · jack W

i am a newer i have a question about flash , i have a nor flash and
its type is SST39VF160 . I don't know how to set the CFG_MAX_FLASH_SECT.

Jack: there is a standard way of finding out thing one doesn't know:
RTFM!!!

In this case the Manual is the SST39VF160 datasheet, which can easily be found (first hit when googeling for "SST39VF160"). It's at
http://www.sst.com/downloads/datasheet/S71145.pdf

Quoted 2 lines
Quoted 2 lines

the flash's sector is 2k .and i think that the CFG_MAX_FLASH_SECT is 4096/2=2148 right?

No. This flash can be operated in sector mode, with a uniform sector size of 2 KWords, or in block mode, with a uniform block size of 32 KWords. The datasheet uses "x16" or 16 bit "words". So one sector is 4 KiB (Kibibyte - to use the official SI unit), and the size of one block is 64 KiB. Given a total size of 2 MiB or 2048 KiB, there are 512 sectors or 32 blocks on the chip.

So any number between 32 and 512 may be correct for your system...

Depending on how you want to use your flash device you can either decide to use sectors (fine grid; advantage: low cut, disadvantage:
many sectors to erase, thus long erase times), or blocks, or any combination of it.

I'd recommend to use blocks normally, but secors for one block (using one or more sectors to store the U-Boot envrionment). For such a configuration, CFG_MAX_FLASH_SECT = 47 would be correct.

Quoted 3 lines

No! You have to configure the maxmium sector count with this define (and _not_ the sector-size!). Most of the time I set this to 256. This should sufficient for most flash's.

Stefan: as you can see, this is actually a bad advice, as it would be wrong here.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"355/113 -- Not the famous irrational number PI,  but  an  incredible
simulation!"
#3 lore raw
Quoted 3 lines · Wolfgang Denk

I'd recommend to use blocks normally, but secors for one block (using one or more sectors to store the U-Boot envrionment). For such a configuration, CFG_MAX_FLASH_SECT = 47 would be correct.

Yes. But keep in mind: If you sometime want to use bigger flash's with more sectors (blocks) you will have to increase this setting!

Quoted 6 lines
Quoted 3 lines

No! You have to configure the maxmium sector count with this define (and _not_ the sector-size!). Most of the time I set this to 256. This should sufficient for most flash's.

Stefan: as you can see, this is actually a bad advice, as it would be wrong here.

OK, since we use these SST flash's alway in block mode I forgot about the sector mode.

By the way: Erase time is not a real issue with the SST flash's. Even chip erase is done in a few ms.

Best regards,
Stefan