EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Atmel flash memory issue, maybe?

Started by Vishnu Swaminathan October 31, 2006
Hello folks,

I am using Atmel flash AT49BV322DT in a custom dsp board i am building.
the dsp is a TI 320DM641. I have written test software that erases, writes
and reads from the flash.

When I send the sequence of erase commands to the flash, I am able to see
write signals on the scope. Shortly thereafter, I also see the Ready/Busy/
output from the flash go low, as expected. Same thing while writing. I cam
also read the data back from the flash. so far, so good.

yesterday, all of a sudden, after half a day's experimenting with flash
timing, the thing stopped working. the READY/BUSY signal would not respond
to any command sequence.

The only thing I can think of is that one must __ALWAYS__ do an erase
before a write. While exprimenting with flash timings, I performed quite a
few (8-10-20) writes. unfortunately, i did not scope the signals during
each write, so i do not know exactly when the thing stopped working.

So, my question is: do I always need to erase before reprogramming the
flash? Is this true of all flash memories?

tomorrow i am going to replace the chip.

Any help will be greatly appreciated.

Thanks!

--Vishnu

Vishnu Swaminathan wrote:
> Hello folks, > > I am using Atmel flash AT49BV322DT in a custom dsp board i am building. > the dsp is a TI 320DM641. I have written test software that erases, writes > and reads from the flash. > > When I send the sequence of erase commands to the flash, I am able to see > write signals on the scope. Shortly thereafter, I also see the Ready/Busy/ > output from the flash go low, as expected. Same thing while writing. I cam > also read the data back from the flash. so far, so good. > > yesterday, all of a sudden, after half a day's experimenting with flash > timing, the thing stopped working. the READY/BUSY signal would not respond > to any command sequence. > > The only thing I can think of is that one must __ALWAYS__ do an erase > before a write. While exprimenting with flash timings, I performed quite a > few (8-10-20) writes. unfortunately, i did not scope the signals during > each write, so i do not know exactly when the thing stopped working. > > So, my question is: do I always need to erase before reprogramming the > flash? Is this true of all flash memories? >
Not the whole flash, but yes u have to erase those specific sectors where you are going to rewrite. If you use any of flash writers, they actually erase the required sectors before reprogramming.
> tomorrow i am going to replace the chip. > > Any help will be greatly appreciated. > > Thanks! > > --Vishnu
Thanks Sudip.

But is rewriting without erasing so bad that it will destroy the entire
flash chip?

--Vishnu

Sudip wrote:
> Vishnu Swaminathan wrote: > > Hello folks, > > > > I am using Atmel flash AT49BV322DT in a custom dsp board i am building. > > the dsp is a TI 320DM641. I have written test software that erases, writes > > and reads from the flash. > > > > When I send the sequence of erase commands to the flash, I am able to see > > write signals on the scope. Shortly thereafter, I also see the Ready/Busy/ > > output from the flash go low, as expected. Same thing while writing. I cam > > also read the data back from the flash. so far, so good. > > > > yesterday, all of a sudden, after half a day's experimenting with flash > > timing, the thing stopped working. the READY/BUSY signal would not respond > > to any command sequence. > > > > The only thing I can think of is that one must __ALWAYS__ do an erase > > before a write. While exprimenting with flash timings, I performed quite a > > few (8-10-20) writes. unfortunately, i did not scope the signals during > > each write, so i do not know exactly when the thing stopped working. > > > > So, my question is: do I always need to erase before reprogramming the > > flash? Is this true of all flash memories? > > > > Not the whole flash, but yes u have to erase those specific sectors > where you are going to rewrite. If you use any of flash writers, they > actually erase the required sectors before reprogramming. > > > > tomorrow i am going to replace the chip. > > > > Any help will be greatly appreciated. > > > > Thanks! > > > > --Vishnu
swams wrote:
> Thanks Sudip. > > But is rewriting without erasing so bad that it will destroy the entire > flash chip? > > --Vishnu >
Not at all. What about reading the Data Sheet?
On Wed, 01 Nov 2006 20:55:16 -0800, swams wrote:
 
> But is rewriting without erasing so bad that it will destroy the entire > flash chip?
Production code in automotive engine controllers rewrites flash without erasing. We use certain bytes to indicate certain areas are erased, programming in-progress, programmed, and invalid. As long as we program 0's to bits which are 1's, there is no problem. The four states above would be: $FF -> $BF -> $AF -> $AB We allocate fixed size blocks in a flash sector and use the bytes to indicate the state of the blocks. When all the blocks in a sector have been used, we transfer to a second sector and erase the first sector. The controller writes a new block every power-down and invalidates the previous block. ~Dave~

The 2024 Embedded Online Conference