spansion (Cypress)flash的坑

   


      最近在一个项目中需要用到QSPI Flash,因为Micron的芯片采购不到,只好换成了Spansion(现在被Cypress收购)的,型号是S25FL256s, 没想到这个当年NOR Flash界的老大做产品居然挖了这么大一个坑,而且居然不在产品手册中告知,太无耻了。
      事情是这样滴。在uboot和linux driver中把该型号支持上后,flash擦写都没有问题。于是满心欢喜的准备结项,然后问题来了。
      启动过程中断电,。。。,居然岂不起来了。
      没关系,可能是flash上的数据内容被破坏了,重新烧写一遍吧。
      进入uboot, sf erase,。。。,Timeout?
      好吧,看看flash还在不在
      sf probe, flash ID居然变成了全FF,这是什么鬼?

      于是开始了痛苦的排查过程,更痛苦的是,手上的10块样品被这种问题搞掉了7块了,都没得用了。

      偶尔在Spansion的网站(http://core.spansion.com/article/how-do-you-avoid-corrupted-registers-in-flash-memory-during-power-loss/#.WRP1QWiGNEb)发现了这么一段话,

Q:  Regarding the Spansion S25FL-S flash memory device, I understand there are risks of corrupting the configuration and status registers if a power loss or system reset occurs when the system is modifying non-volatile and OTP bits.  Are there precautions I can take to help minimize that risk?

A:  Yes, there are some recommendations that you should follow to help minimize risks and issues should a system reset or power loss occur when modifying those bits. First, let me provide some background. The Spansion S25FL-S flash memory product family offers status registers (SR1 and SR2) and configuration registers (CR1) to query the device status, control the features of the device, and permit user configuration.  Some of these bits can be modified while others are read only; some are volatile while others are non volatile.  Further, some bits can be programmed only once, while others may be programmed back and forth as a logical 0 or 1.

The Write Registers (WRR) command is used to modify the contents of the status register (SR1) and configuration register (CR1) at the same time.  As you would suspect, it’s critical to maintain a stable operating condition while the command is executed since these registers control the lock status and I/O configuration. Any power loss or system reset during this operation may corrupt the register settings, possibly resulting in a locked or misconfigured device. If this occurs, the user application may be unrecoverable.

    红字是我标注的,也就是说如果在用WRR命令写SR和CR时断电或Reset,有可能把flash 芯片弄废掉。这么重大的缺陷居然藏在这么一个不起样的地方轻描淡写的写出来,以后选型还是告别这种不靠谱的公司吧。

评论

此博客中的热门博文

dBm, dBi, dBd, dB, dBc 详解

STM32F072的I2C的使用方法