Hi,
I have a new prototype development board here, with an 512 MBit Flash chip, Micron N25Q512 (precise type is N25Q512A11G40). I managed to create a config [1] that reads fine, but fails to write [2].
I understand that flashrom cannot access chips larger than 16 MBytes, but the chip should still be able to work in 3-byte addressing mode for the lower 16 MBytes. This is what I have created in flashchips.c (copy & pasted, then adapted from the part N25Q128, assuming with a bit of good faith and some datasheet comparison that they should behave alike).
Has anyone ever successfully written to a small part of a 4-byte flash chip?
Thanks, David
=========================
[1] new stuff for flashchips.c
{ .vendor = "Micron/Numonyx/ST", .name = "N25Q512..3E", /* ..3E = 3V, uniform 64KB/4KB blocks/sectors */ .bustype = BUS_SPI, .manufacture_id = ST_ID, .model_id = ST_N25Q512__3E, /* .total_size = 65536,*/ .total_size = 16384, .page_size = 256, /* supports SFDP */ /* OTP: 64B total; read 0x4B, write 0x42 */ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, .tested = TEST_OK_PREW, .probe = probe_spi_rdid, .probe_timing = TIMING_ZERO, .block_erasers = { { /*.eraseblocks = { {4 * 1024, 16384 } },*/ .eraseblocks = { {4 * 1024, 4096 } }, .block_erase = spi_block_erase_20, }, { /*.eraseblocks = { {64 * 1024, 1024} },*/ .eraseblocks = { {64 * 1024, 256} }, .block_erase = spi_block_erase_d8, }, { /*.eraseblocks = { {65536 * 1024, 1} },*/ .eraseblocks = { {16384 * 1024, 1} }, .block_erase = spi_block_erase_c7, } }, .printlock = spi_prettyprint_status_register_n25q, /* TODO: config, lock, flag regs */ .unlock = spi_disable_blockprotect_n25q, /* TODO: per 64kB sector lock registers */ .write = spi_chip_write_256, /* Multi I/O supported */ .read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */ .voltage = {2700, 3600}, },
=========================
[2] output from flashrom trying to write, and failing:
# /root/flashrom -p ft2232_spi:type=232H,divisor=8 -c 'N25Q512..3E' -V -w flash.rom flashrom v0.9.7-r1711 on Linux 3.13.6-1-ARCH (x86_64) flashrom is free software, get the source code at http://www.flashrom.org
flashrom was built with libpci 3.2.1, GCC 4.8.2 20140206 (prerelease), little endian Command line (7 args): /root/flashrom -p ft2232_spi:type=232H,divisor=8 -c N25Q512..3E -V -w flash.rom Calibrating delay loop... OS timer resolution is 1 usecs, 1588M loops per second, 10 myus = 9 us, 100 myus = 117 us, 1000 myus = 1005 us, 10000 myus = 10324 us, 4 myus = 4 us, OK. Initializing ft2232_spi programmer Using device type FTDI FT232H channel A. Disable divide-by-5 front stage Set clock divisor MPSSE clock: 60.000000 MHz, divisor: 8, SPI clock: 7.500000 MHz No loopback of TDI/DO TDO/DI Set data bits The following protocols are supported: SPI. Probing for Micron/Numonyx/ST N25Q512..3E, 16384 kB: probe_spi_rdid_generic: id1 0x20, id2 0xba20 Found Micron/Numonyx/ST flash chip "N25Q512..3E" (16384 kB, SPI) on ft2232_spi. Chip status register is 0x00. Chip status register: Status Register Write Disable (SRWD, SRP, ...) is not set Chip status register: Block Protect 3 (BP3) is not set Chip status register: Top/Bottom (TB) is top Chip status register: Block Protect 2 (BP2) is not set Chip status register: Block Protect 1 (BP1) is not set Chip status register: Block Protect 0 (BP0) is not set Chip status register: Write Enable Latch (WEL) is not set Chip status register: Write In Progress (WIP/BUSY) is not set This chip may contain one-time programmable memory. flashrom cannot read and may never be able to write it, hence it may not be able to completely clone the contents of this chip (see man page for details). Reading old flash chip contents... done. Erasing and writing flash chip... Trying erase function 0... 0x000000-0x000fff:W, 0x001000-0x001fff:E FAILED at 0x00001000! Expected=0xff, Found=0x00, failed byte count from 0x00001000-0x00001fff: 0x1000 ERASE FAILED! Reading current flash chip contents... done. Looking for another erase function. Trying erase function 1... 0x000000-0x00ffff:E FAILED at 0x00000000! Expected=0xff, Found=0x00, failed byte count from 0x00000000-0x0000ffff: 0x10000 ERASE FAILED! Reading current flash chip contents... done. Looking for another erase function. Trying erase function 2... 0x000000-0xffffff:E FAILED at 0x00000000! Expected=0xff, Found=0x00, failed byte count from 0x00000000-0x00ffffff: 0x1000000 ERASE FAILED! Looking for another erase function. No usable erase functions left. FAILED! Uh oh. Erase/write failed. Checking if anything changed. 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!