On Mon, 24 Feb 2014 10:51:20 -0500 "Tim Sebastian" timtok239@linuxmail.org wrote:
Hello, I'm trying to use flashrom to write a new bios to my device. It successfully writes the beginning of the bios and then fails with the error:
0x040000-0x040fff:W writing sector at 0xb7ea0000 failed! And again with the second erase function : Trying erase function 1... 0x000000-0x00ffff:EW, 0x010000-0x01ffff:S, 0x020000-0x02ffff:S, 0x030000-0x03ffff:S, 0x040000-0x04ffff:W writing sector at 0xb7ea0000 failed! leaving the bios in an unstable state.
Further experimentation shows that writing the bios fails on both erasing and writing any sector after 0x040000, which is exactly halfway through the bios (2Mb out of 4Mb). Reading from those areas works without a problem. The lock status for every block is reported as 00, full access. Full log is below.
Our code contains the following comment: /* Contrary to the data sheet, TBL# on the SST49LF004B affects the top 128kB (instead of 64kB) * and is only honored for 64k block erase, but not 4k sector erase. */
While this does not explain the problem you are seeing, I would not be too surprised, if there are chips out there, where the affected area is even 256kB... the lock statuses are not related to this kind of protection (TBL pin) but are a software lock IIRC. If you have a multimeter then you should measure the voltage level of TBL# against ground. If it is 0 then my theory is probably correct. In that case your boards need a so-called board enable.
What board is this?