public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Flash Erase/Write error in uboot
@ 2007-05-02  0:22 Shiju Mathew
  2007-05-02  0:29 ` Wolfgang Denk
  2007-05-02  5:01 ` Stefan Roese
  0 siblings, 2 replies; 12+ messages in thread
From: Shiju Mathew @ 2007-05-02  0:22 UTC (permalink / raw)
  To: u-boot

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070501/37649788/attachment.htm 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-02  0:22 [U-Boot-Users] Flash Erase/Write error in uboot Shiju Mathew
@ 2007-05-02  0:29 ` Wolfgang Denk
  2007-05-02 16:24   ` Shiju Mathew
  2007-05-02  5:01 ` Stefan Roese
  1 sibling, 1 reply; 12+ messages in thread
From: Wolfgang Denk @ 2007-05-02  0:29 UTC (permalink / raw)
  To: u-boot

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

-- 
DENX Software Engineering GmbH,    CEO: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Witch!  Witch!  They'll burn ya!
	-- Hag, "Tomorrow is Yesterday", stardate unknown

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-02  0:22 [U-Boot-Users] Flash Erase/Write error in uboot Shiju Mathew
  2007-05-02  0:29 ` Wolfgang Denk
@ 2007-05-02  5:01 ` Stefan Roese
  1 sibling, 0 replies; 12+ messages in thread
From: Stefan Roese @ 2007-05-02  5:01 UTC (permalink / raw)
  To: u-boot

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
=====================================================================

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-02  0:29 ` Wolfgang Denk
@ 2007-05-02 16:24   ` Shiju Mathew
  2007-05-02 23:10     ` Tolunay Orkun
  0 siblings, 1 reply; 12+ messages in thread
From: Shiju Mathew @ 2007-05-02 16:24 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-02 16:24   ` Shiju Mathew
@ 2007-05-02 23:10     ` Tolunay Orkun
  2007-05-03 18:40       ` Shiju Mathew
  0 siblings, 1 reply; 12+ messages in thread
From: Tolunay Orkun @ 2007-05-02 23:10 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-02 23:10     ` Tolunay Orkun
@ 2007-05-03 18:40       ` Shiju Mathew
  2007-05-03 21:31         ` Tolunay Orkun
  0 siblings, 1 reply; 12+ messages in thread
From: Shiju Mathew @ 2007-05-03 18:40 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-03 18:40       ` Shiju Mathew
@ 2007-05-03 21:31         ` Tolunay Orkun
  2007-05-05  2:46           ` Shiju Mathew
  0 siblings, 1 reply; 12+ messages in thread
From: Tolunay Orkun @ 2007-05-03 21:31 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-03 21:31         ` Tolunay Orkun
@ 2007-05-05  2:46           ` Shiju Mathew
  2007-05-05  5:18             ` Stefan Roese
                               ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Shiju Mathew @ 2007-05-05  2:46 UTC (permalink / raw)
  To: u-boot

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


-- 
Regards,
Shiju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20070504/5030e495/attachment.htm 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-05  2:46           ` Shiju Mathew
@ 2007-05-05  5:18             ` Stefan Roese
  2007-05-05  5:26             ` Tolunay Orkun
       [not found]             ` <c166aa9f0705050648p16b150c2sfb123108f7b0bce6@mail.gmail.com>
  2 siblings, 0 replies; 12+ messages in thread
From: Stefan Roese @ 2007-05-05  5:18 UTC (permalink / raw)
  To: u-boot

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
=====================================================================

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-05  2:46           ` Shiju Mathew
  2007-05-05  5:18             ` Stefan Roese
@ 2007-05-05  5:26             ` Tolunay Orkun
       [not found]             ` <c166aa9f0705050648p16b150c2sfb123108f7b0bce6@mail.gmail.com>
  2 siblings, 0 replies; 12+ messages in thread
From: Tolunay Orkun @ 2007-05-05  5:26 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
       [not found]             ` <c166aa9f0705050648p16b150c2sfb123108f7b0bce6@mail.gmail.com>
@ 2007-05-08 18:36               ` Shiju Mathew
  2007-05-08 18:59                 ` Wolfgang Denk
  0 siblings, 1 reply; 12+ messages in thread
From: Shiju Mathew @ 2007-05-08 18:36 UTC (permalink / raw)
  To: u-boot

On Sat, 2007-05-05 at 08:48 -0500, Andrew Dyer wrote:
> On 5/4/07, Shiju Mathew <mshiju@gmail.com> wrote:
> > 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
> 
> I suspect the code is reading the status word instead of the array
> data.  You have to be careful with handling the array, as there is no
> separate status port, so the status data will show up as read data if
> you aren't careful.
> 
> One thing you might check is to make sure the flash 'timeout' variable
> isn't getting set to zero.  I found a problem with this a long time
> ago - it had to do with how the CFI timeout data (reported in usec)
> was being converted to a value for timeout (in msec).  If timeout was
> zero, the status read stuff would time out before reding the data the
> second time through.  I think was fixed, but it's worth checking.
> 
Thanks for all your comments. I could get a few sector erase/write
success if I reduce the system clock to 398 MHz and bus speed to 66 MHz
and also make the below changes for erase status check. Previouly it was
running at 532 MHz/133 MHz (CPU/bus).Now I could update uboot without
any problem.  But if I try to erase/write large no: of sectors, says 100
sectors, it fails with the same error as before. So I think the problem
is realated to timming.
			
#define TIMEOUT 10000000
               timeout = TIMEOUT;
                while (1) {
                     if (flash_isset (info, sect, 0, 0x08)) {
	                    debug("Operation complete\n");
         	            break;
                      }
                      if (!timeout--) {
                             printf("Operation Timed Out!!n");
                             break;
                      }
               }
               timeout = TIMEOUT;
               while (1) {
                      if (flash_isset (info, sect, 0,
FLASH_STATUS_DONE)) {
                            debug("Flash erase done\n");
                            break;
                      }
                      if (!timeout--) {
                            printf("Erase Timed Out!!\n");
                            break;
                      }
              }


> 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.

If I disconnected the extension board, I don't have any issues. I could
also run the system at 532/133 MHz without any flash write issues. The
problem happens when the load increases on the bus. I made sure that the
CS are configured right.I disabled CS1( where extension board is
connected) without any success.

> Wow, 3 bootloaders for one board! What luxury. :)
> 
We got eboot and redboot along with the board. But we want to move to
uboot to support all the OS runnning on the board because of its feature
rich and has good support from the community.

Thanks,
Shiju

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot-Users] Flash Erase/Write error in uboot
  2007-05-08 18:36               ` Shiju Mathew
@ 2007-05-08 18:59                 ` Wolfgang Denk
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Denk @ 2007-05-08 18:59 UTC (permalink / raw)
  To: u-boot

In message <1178649400.8335.26.camel@localhost> you wrote:
>
> #define TIMEOUT 10000000
>                timeout = TIMEOUT;
...
>                       if (!timeout--) {
>                              printf("Operation Timed Out!!n");
>                              break;

You shouldreally use a delay based timeout here,not a counter based
one (where youwill never know how long exactly your timeout runs).

Add for example an "udelay (100);" (delay for 10 microseconds) and
adjust TIMEOUT to a reasonable value, say 100000 (10 seconds).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,    CEO: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I will not say that women have no character;  rather, they have a new
one every day.                                               -- Heine

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-05-08 18:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-02  0:22 [U-Boot-Users] Flash Erase/Write error in uboot Shiju Mathew
2007-05-02  0:29 ` Wolfgang Denk
2007-05-02 16:24   ` Shiju Mathew
2007-05-02 23:10     ` Tolunay Orkun
2007-05-03 18:40       ` Shiju Mathew
2007-05-03 21:31         ` Tolunay Orkun
2007-05-05  2:46           ` Shiju Mathew
2007-05-05  5:18             ` Stefan Roese
2007-05-05  5:26             ` Tolunay Orkun
     [not found]             ` <c166aa9f0705050648p16b150c2sfb123108f7b0bce6@mail.gmail.com>
2007-05-08 18:36               ` Shiju Mathew
2007-05-08 18:59                 ` Wolfgang Denk
2007-05-02  5:01 ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox