spi-flash-programmer icon indicating copy to clipboard operation
spi-flash-programmer copied to clipboard

Unable to write to the chip

Open marecl opened this issue 5 years ago • 6 comments

Using ESP8266 as programmer, compiles good. I can read and verify data.

I can enter commands manually, but that's not working. Client program also dosen't work, instantly returns "Could not write page 0x00000000". Chip is new, unlocked.

marecl avatar Apr 10 '19 17:04 marecl

I've not tried using spi-flash-programmer on an esp8266, but maybe others can help you... do you get any error message when you try to enter the write commands manually? Does the client work for e.g. reading?

nfd avatar Apr 11 '19 03:04 nfd

[update] Didn't work on Leonardo either.

SPI is wired correctly as I can read chip signature, chip content and protection status. Serial console commands work for reading and filling the buffer with data. Writing returns no error, but after verification - it clearly dosen't work (together with chip/page erase).

marecl avatar Apr 13 '19 20:04 marecl

Which kind of flash do you use? I recently phased in some extensions. I tested with standard Winbond & Gigadevice flashes. Can you send me the spi_flash_programmer_client.py status-register spi_flash_programmer_client.py id-register output?

userid0x0 avatar Apr 16 '19 08:04 userid0x0

I have used W25Q64CVSSIG and FT25H04 chips. Neither of them worked. I don't have my programming "rig" anymore, but I remember both chips were unlocked.

marecl avatar Apr 20 '19 15:04 marecl

Well, from the description it's not 100% sure what fails here. The Arduino implementation polls the status register after every "page program". The loop in impl_wait_for_write_enable() has no end condition other than the WriteInProgress-Bit being 0x0. The client implementation typically waits 3 seconds for the arduino to confirm a successful "page program" and following sends a "read" command to verify a successful write using a CRC.

It sounds like the latter condition is the case that the client cannot verify the CRC what also means that the "page program" did not happen on the device or the data got corrupted (I have really bad experience with flying wire setups). Without the possibility to reproduce the problem and being able to enable the debug mode of the client I am out of ideas right now. The flash chips you tested are "standard" ...

userid0x0 avatar Apr 24 '19 07:04 userid0x0

[update] Didn't work on Leonardo either.

On Leonardo it's a buffering issue I'm sure. With my flasher I'm unable to fill the whole 256 byte buffer at once. I have to send data in 32 byte chunks otherwise Leonardo locks up.

snsdosen avatar May 17 '19 21:05 snsdosen