From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Wed, 11 Oct 2006 17:48:50 -0500 Subject: [U-Boot-Users] Can I write to flash using mw command In-Reply-To: References: <20061006033619.65376.qmail@web33205.mail.mud.yahoo.com> <45264A79.1090600@smiths-aerospace.com> Message-ID: <452D74D2.3080300@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de bilahari wrote: > Hi, Jerry, > > Took your advice on flash addresses I should put > into my command sequences with my current flash > configuration (2 16-bit spansion s29GL064M chips > interleaved to form 32-bit flash system). You pointed me > to the right direction, thanks. Although I couldnt I guess Jerry guessed right how your flash chips are interfaced to the CPU bus since you did not disclose the complete information before. Without this information you cannot program the flash correctly. > But one thing that doesnt work with my code and also > with u-boot is that if I want to write two different > values to the same flash locationconsecutively > ( for example when I try to write 0x12 to flash address > 0xff000000 and then write 0x34 to same flash address, > u-boot gives me a message "flash not erased". > My driver makes the program simply loop forever in a status > register polling loop, I guess). > > Is it something natural with flash programming ?. Yes. With NOR flash devices erasing turns flash to all 1s. By write you can turn 1s to 0s. But you cannot turn 0s to 1s without doing an erase of the erase unit (block/sector). > Should I always erase the whole sector before I re-program > a location ? (doesnt sound like a good approach to me), It does not sound that you have experience in embedded devices in particular with flash parts. I suggest you do some reading to familiarize yourself with the devices on your board. BTW, all this is really not U-Boot related and off topic on the list. > is it not possible to write consecutively as with > the conventional memory? It works as long as do not try to turn 1 bits to 0. Best regards, Tolunay