[U-Boot-Users] Flash Erase/Write error in uboot

Hello, I have a board with flash part S71WS256N. I was using CFI driver and didn't had any problems programming the device. But from today I am getting an unusual error while writing to flash sectors. It always gives erase successful. But when I try to write data after erase, I get a message that the flash is not erased. I use uboot-1.2. Below is the debug message on running saveenv. Could someone help me to resolve this problem.
Saving Environment to Flash... Protect off A0060000 ... A007FFFF Un-Protecting sectors 6..6 in bank 1 fwc addr a0060000 cmd 50 0050 16bit x 16 bit fwc addr a0060000 cmd 60 0060 16bit x 16 bit fwc addr a0060000 cmd d0 00d0 16bit x 16 bit flash_is_busy: 0 . done Un-Protected 1 sectors Erasing Flash...Erase Flash from 0xa0060000 to 0xa007ffff in Bank # 1 fwc addr a0060aaa cmd aa 00aa 16bit x 16 bit fwc addr a0060554 cmd 55 0055 16bit x 16 bit fwc addr a0060aaa cmd 80 0080 16bit x 16 bit fwc addr a0060aaa cmd aa 00aa 16bit x 16 bit fwc addr a0060554 cmd 55 0055 16bit x 16 bit fwc addr a0060000 cmd 30 0030 16bit x 16 bit flash_is_busy: 0 done Erased 1 sectors Writing to Flash... Flash not Erased Protecting sectors 6..6 in bank 1 fwc addr a0060000 cmd 50 0050 16bit x 16 bit fwc addr a0060000 cmd 60 0060 16bit x 16 bit fwc addr a0060000 cmd 1 0001 16bit x 16 bit flash_is_busy: 0 . done Protected 1 sectors
Thanks, Shiju

In message f3cea0230705011722q2a88618bg371fdd67eeed18c8@mail.gmail.com you wrote:
I have a board with flash part S71WS256N. I was using CFI driver and didn't had any problems programming the device. But from today I am getting an unusual error while writing to flash sectors. It always gives erase successful. But when I try to write data after erase, I get a message that the flash is not erased. I use uboot-1.2. Below is the debug message on running saveenv. Could someone help me to resolve this problem.
Is it correct to assume that this is just on one board? Seems your flash died. This happens.
------=_Part_14465_22402792.1178065379050 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Please never post HTML here. Never.
Best regards,
Wolfgang Denk

On Wed, 2007-02-05 at 02:29 +0200, Wolfgang Denk wrote:
In message f3cea0230705011722q2a88618bg371fdd67eeed18c8@mail.gmail.com you wrote:
I have a board with flash part S71WS256N. I was using CFI driver and didn't had any problems programming the device. But from today I am getting an unusual error while writing to flash sectors. It always gives erase successful. But when I try to write data after erase, I get a message that the flash is not erased. I use uboot-1.2. Below is the debug message on running saveenv. Could someone help me to resolve this problem.
Is it correct to assume that this is just on one board? Seems your flash died. This happens.
The flash is not dead. I could flash uboot using RVI debugger without any problem. Basically I load two uboot images onto RAM using RVI- one to run from RAM and writes the second image to flash. This is always succussfull. ONce the uboot is written to flash, and reboot the board, I get the error that the "flash is not errased". Today I tested with the top-of-git version. Still have the same problem. Anyone have experienced this problem before.
Thanks, Shiju

Shiju Mathew wrote:
On Wed, 2007-02-05 at 02:29 +0200, Wolfgang Denk wrote:
In message f3cea0230705011722q2a88618bg371fdd67eeed18c8@mail.gmail.com you wrote:
I have a board with flash part S71WS256N. I was using CFI driver and didn't had any problems programming the device. But from today I am getting an unusual error while writing to flash sectors. It always gives erase successful. But when I try to write data after erase, I get a message that the flash is not erased. I use uboot-1.2. Below is the debug message on running saveenv. Could someone help me to resolve this problem.
Is it correct to assume that this is just on one board? Seems your flash died. This happens.
The flash is not dead. I could flash uboot using RVI debugger without any problem. Basically I load two uboot images onto RAM using RVI- one to run from RAM and writes the second image to flash. This is always succussfull. ONce the uboot is written to flash, and reboot the board, I get the error that the "flash is not errased". Today I tested with the top-of-git version. Still have the same problem. Anyone have experienced this problem before.
Thanks, Shiju
Does this happen with DEBUG enabled? Did you check with DEBUG disabled? I noticed that DEBUG distrupts some of the registers used for status checking...
If you have to have DEBUG enabled for testing something else please put #undef DEBUG towards the beginning of cfi_flash.c (after #include etc)
Tolunay
Tolunay

On Wed, 2007-02-05 at 18:10 -0500, Tolunay Orkun wrote:
Shiju Mathew wrote:
On Wed, 2007-02-05 at 02:29 +0200, Wolfgang Denk wrote:
Does this happen with DEBUG enabled? Did you check with DEBUG disabled? I noticed that DEBUG distrupts some of the registers used for status checking...
If you have to have DEBUG enabled for testing something else please put #undef DEBUG towards the beginning of cfi_flash.c (after #include etc)
Looks likes some other issue. On our Freescale imx31 ADS board we have connected an extension board(RAM like device) to CS1 through the logical analyser interface. The problem happens when I connect the extension board(even without powering up the extension board). If I remove the extension board the flash erase/writes are successfull.
Thanks, Shiju

Shiju Mathew wrote:
On Wed, 2007-02-05 at 18:10 -0500, Tolunay Orkun wrote:
Shiju Mathew wrote:
On Wed, 2007-02-05 at 02:29 +0200, Wolfgang Denk wrote:
Does this happen with DEBUG enabled? Did you check with DEBUG disabled? I noticed that DEBUG distrupts some of the registers used for status checking...
If you have to have DEBUG enabled for testing something else please put #undef DEBUG towards the beginning of cfi_flash.c (after #include etc)
Looks likes some other issue. On our Freescale imx31 ADS board we have connected an extension board(RAM like device) to CS1 through the logical analyser interface. The problem happens when I connect the extension board(even without powering up the extension board). If I remove the extension board the flash erase/writes are successfull.
Thanks, Shiju
Looks like an hardware/interfacing issue...
Tolunay

On 5/3/07, Tolunay Orkun listmember@orkun.us wrote:
Shiju Mathew wrote:
On Wed, 2007-02-05 at 18:10 -0500, Tolunay Orkun wrote:
Shiju Mathew wrote:
On Wed, 2007-02-05 at 02:29 +0200, Wolfgang Denk wrote:
Does this happen with DEBUG enabled? Did you check with DEBUG disabled? I noticed that DEBUG distrupts some of the registers used for status checking...
If you have to have DEBUG enabled for testing something else please put #undef DEBUG towards the beginning of cfi_flash.c (after #include etc)
Looks likes some other issue. On our Freescale imx31 ADS board we have connected an extension board(RAM like device) to CS1 through the logical analyser interface. The problem happens when I connect the extension board(even without powering up the extension board). If I remove the extension board the flash erase/writes are successfull.
Thanks, Shiju
Looks like an hardware/interfacing issue...
I was debugging the problem further. We have two other bootloaders running
on this board - redboot and Eboot. Both does not have this problem. Only on Uboot I am experiencing this problem. On debugging what I could find is that when I erase a sector, the function flash_is_busy() returns immidiatly with success(not busy). Usually it should loop for a while in this function before returning that the flash is not busy. Before writing to the erased sector, the "md" command displayed 0xffffffff for the erased sector. But when I tried to write data to the erased location using cp.b, the function flash_write_cfiword() returns with error "flash is not erased" since it failed to find 0xffffffff in the erased locations(Check if Flash is (sufficiently) erased). So why does "md" displays 0xffffffff for erased locations and flash routine says it is not 0xffffffff ? Could someone explain why this difference.
Thanks, Shiju

On Saturday 05 May 2007 04:46, Shiju Mathew wrote:
Looks likes some other issue. On our Freescale imx31 ADS board we have connected an extension board(RAM like device) to CS1 through the logical analyser interface. The problem happens when I connect the extension board(even without powering up the extension board). If I remove the extension board the flash erase/writes are successfull.
Thanks, Shiju
Looks like an hardware/interfacing issue...
I was debugging the problem further. We have two other bootloaders running on this board - redboot and Eboot.
Wow, 3 bootloaders for one board! What luxury. :)
Both does not have this problem. Only on Uboot I am experiencing this problem. On debugging what I could find is that when I erase a sector, the function flash_is_busy() returns immidiatly with success(not busy). Usually it should loop for a while in this function before returning that the flash is not busy. Before writing to the erased sector, the "md" command displayed 0xffffffff for the erased sector. But when I tried to write data to the erased location using cp.b, the function flash_write_cfiword() returns with error "flash is not erased" since it failed to find 0xffffffff in the erased locations(Check if Flash is (sufficiently) erased). So why does "md" displays 0xffffffff for erased locations and flash routine says it is not 0xffffffff ? Could someone explain why this difference.
Does this problem also occur when you disconnect the "extension board"?
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk Office: Kirchenstr. 5, D-82194 Groebenzell, Germany =====================================================================

Shiju Mathew wrote:
On 5/3/07, *Tolunay Orkun* <listmember@orkun.us mailto:listmember@orkun.us> wrote:
> Looks likes some other issue. On our Freescale imx31 ADS board we have > connected an extension board(RAM like device) to CS1 through the logical > analyser interface. The problem happens when I connect the extension > board(even without powering up the extension board). If I remove the > extension board the flash erase/writes are successfull. > > Thanks, > Shiju > Looks like an hardware/interfacing issue...
I was debugging the problem further. We have two other bootloaders running on this board - redboot and Eboot. Both does not have this
Check how CS configuration etc. is correctly configured. If it is working with the extension board not installed but not obviously you have something wrong. It could be that your CS1 configuration is incorrect. Possibilities are endless. But I do not see this as a flash driver issue.
Tolunay

On Wednesday 02 May 2007 02:22, Shiju Mathew wrote:
I have a board with flash part S71WS256N. I was using CFI driver and didn't had any problems programming the device. But from today I am getting an unusual error while writing to flash sectors. It always gives erase successful. But when I try to write data after erase, I get a message that the flash is not erased. I use uboot-1.2.
Are you using 1.2.0 release or top-of-git version? Please use top-of-git version, there were some changes regarding io-ordering/barrier in the CFI driver lately.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk Office: Kirchenstr. 5, D-82194 Groebenzell, Germany =====================================================================
participants (4)
-
Shiju Mathew
-
Stefan Roese
-
Tolunay Orkun
-
Wolfgang Denk