[U-Boot-Users] Can I write to flash using mw command

Tolunay Orkun listmember at orkun.us
Thu Oct 12 00:48:50 CEST 2006


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





More information about the U-Boot mailing list