diff mbox series

Re: failed write to an erased chip

Message ID fbaacddab18d7480ae61b0b4660ca397c02551c3.camel@yandex.ru
State New
Headers show
Series Re: failed write to an erased chip | expand

Commit Message

Сергей Янович Nov. 25, 2021, 2:02 p.m. UTC
On Wed, 2021-11-24 at 13:17 +0300, Mike Banon wrote:
> Your log looks right to me, like a file has been programmed into your
> chip successfully. How did you check that the writing operation was a
> failure instead?

Thanks for looking into this. The error message didn't make into the
log, b/c it was on stderr. The diff is:

# flashrom -p ... -VVV -w 8.bin > log3 2>&1
$ diff -aU 1 log2 log3

If I read the image from chip, I get 8Mib of 0xFF.

I can attach the full log if necessary.

> P.S. I hope that your 1.8V chip wasn't partially damaged by a
> temporary usage of 3.3V on it

It is possible, but seems unlikely. The chip correctly responds to
flasrom probing queries. I suspect I activated a write protection of
some kind. /WP is high at 1.81V now. So I am investigation software WP
in the chip now.

Comments

Сергей Янович Nov. 25, 2021, 5:56 p.m. UTC | #1
On Thu, 2021-11-25 at 17:02 +0300, Сергей Янович wrote:
> On Wed, 2021-11-24 at 13:17 +0300, Mike Banon wrote:
> 
> > P.S. I hope that your 1.8V chip wasn't partially damaged by a
> > temporary usage of 3.3V on it
> 
> It is possible, but seems unlikely. The chip correctly responds to
> flasrom probing queries. I suspect I activated a write protection of
> some kind. /WP is high at 1.81V now. So I am investigation software WP
> in the chip now.

SOLVED. For reference.

I guessed correctly. Both CMP and WPS bits got set in the status
register. The chip was successfully flashed after both bits were
cleared. I used a small C program for reading and writing. The program
was made along examples in [1].

1. https://www.emcraft.com/stm32f769i-discovery-board/accessing-spi-devices-in-linux
Ivan Ivanov Nov. 26, 2021, 1:35 p.m. UTC | #2
Hi Sergey,

> Both CMP and WPS bits got set in the status register. The chip was successfully flashed after both bits were cleared.

I'm curious: Please tell, how you clear these CMP and WPS bits? What
command do you run to do this?

чт, 25 нояб. 2021 г. в 23:44, Сергей Янович <sergei.ianovich@yandex.ru>:
>
> On Thu, 2021-11-25 at 17:02 +0300, Сергей Янович wrote:
> > On Wed, 2021-11-24 at 13:17 +0300, Mike Banon wrote:
> >
> > > P.S. I hope that your 1.8V chip wasn't partially damaged by a
> > > temporary usage of 3.3V on it
> >
> > It is possible, but seems unlikely. The chip correctly responds to
> > flasrom probing queries. I suspect I activated a write protection of
> > some kind. /WP is high at 1.81V now. So I am investigation software WP
> > in the chip now.
>
> SOLVED. For reference.
>
> I guessed correctly. Both CMP and WPS bits got set in the status
> register. The chip was successfully flashed after both bits were
> cleared. I used a small C program for reading and writing. The program
> was made along examples in [1].
>
> 1. https://www.emcraft.com/stm32f769i-discovery-board/accessing-spi-devices-in-linux
>
> _______________________________________________
> flashrom mailing list -- flashrom@flashrom.org
> To unsubscribe send an email to flashrom-leave@flashrom.org
Сергей Янович Nov. 26, 2021, 1:50 p.m. UTC | #3
On Fri, 2021-11-26 at 16:35 +0300, Ivan Ivanov wrote:
> > Both CMP and WPS bits got set in the status register. The chip was successfully flashed after both bits were cleared.
> 
> I'm curious: Please tell, how you clear these CMP and WPS bits? What
> command do you run to do this?

https://github.com/yanovich/spitest.git

The head commit is for SR3 (it is where WPS is).

I've used a debian bullseye bootstrap and schroot with multiarch to
build this tools for raspberry pi. Then from RPi (with raspberry
provided fork of debian):

$ ./spitest /dev/spidev0.0
diff mbox series

Patch

--- log2	2021-11-23 19:06:06.693202071 +0300
+++ log3	2021-11-25 16:51:28.493684854 +0300
@@ -1084,2 +1084,6 @@ 
 Erase/write done.
-Verifying flash... programmer_unmap_flash_region: unmapped 0x00000000
+Verifying flash... FAILED at 0x00000010! Expected=0x5a, Found=0xff, failed byte count from 0x00000000-0x007fffff: 0x3489ce
+Your flash chip is in an unknown state.
+Please report this on IRC at chat.freenode.net (channel #flashrom) or
+mail flashrom@flashrom.org, thanks!
+programmer_unmap_flash_region: unmapped 0x00000000