Issue #553 has been updated by Anastasia Klimchuk.
Miklos, thank you for adding a bug! always a good idea to have a bug described , and now it can be shared.
I have two things to say:
1) If you would like to continue working on this, you can try defining an empty array for `block_erasers`. Look at chip with vendor "Unknown" and name "SFDP-capable chip" as an example. From the error, you've probably set something in `block_erasers` array, and it is detected as invalid. But empty array might work.
2) You have created this bug in coreboot project, and I can only add comments here. If you change the project to flashrom, I will be able fill in some fields (affected version, category, watchers etc)
---------------------------------------- Bug #553: M95M02 write failure https://ticket.coreboot.org/issues/553#change-1904
* Author: Miklos Marton * Status: New * Priority: Normal * Target version: none * Start date: 2024-08-21 * Affected hardware: STLinkV3 * Affected OS: Linux ---------------------------------------- While trying to add support for EEPROM devices (which lacks the erase capability) I came across some issues with implementing it. The only device so far which lacks erase capability is the M95M02.
When trying to write it via force I receieve a SIGSEV and the following output:
``` shell 08:17:18: Debugging /home/mm/Projektek/flashrom/flashrom -p stlinkv3_spi -c M95M02 -f -w /tmp/myfile ... could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libcap.so.2 flashrom 1.4.0-rc2 (git:v1.4.0-rc2-1-gbd3c5f31) on Linux 6.8.0-40-generic (x86_64) flashrom is free software, get the source code at https://flashrom.org
Connected to STLink V3 with bridge FW version: 5 SCK frequency set to 750 kHz Assuming ST flash chip "M95M02" (256 kB, SPI) on stlinkv3_spi. === This flash part has status UNTESTED for operations: WP The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to flashrom@flashrom.org if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. You can also try to follow the instructions here: https://www.flashrom.org/contrib_howtos/how_to_mark_chip_tested.html Thanks for your help! spi_get_opcode_from_erasefn: unknown erase function (0x1). Please report this at flashrom@flashrom.org ```
Backtrace: ```
~"#0 0x000055555558f047 in check_block_eraser (flash=flash@entry=0x7fffffffd9d0, k=k@entry=0, log=log@entry=0) at flashrom.c:489\n" ~"#1 0x000055555558f0c7 in count_usable_erasers (flash=flash@entry=0x7fffffffd9d0) at flashrom.c:508\n" ~"#2 0x000055555558f15f in chip_safety_check (flash=flash@entry=0x7fffffffd9d0, force=1, read_it=read_it@entry=0, write_it=write_it@entry=1, erase_it=erase_it@entry=0, verify_it=verify_it@entry=1) at flashrom.c:2019\n" ~"#3 0x0000555555591426 in prepare_flash_access (flash=flash@entry=0x7fffffffd9d0, read_it=read_it@entry=false, write_it=write_it@entry=true, erase_it=erase_it@entry=false, verify_it=verify_it@entry=true) at flashrom.c:2121\n" ~"#4 0x0000555555591821 in flashrom_image_write (flashrom_flashctx=flashrom_flashctx@entry=0x7fffffffd9d0, buffer=buffer@entry=0x7ffff7ea5010, buffer_len=buffer_len@entry=262144, refbuffer=refbuffer@entry=0x0) at flashrom.c:2287\n" ~"#5 0x00005555555795d6 in do_write (flash=flash@entry=0x7fffffffd9d0, filename=0x55555565c2c0 "/tmp/myfile", referencefile=0x0) at cli_classic.c:535\n" ~"#6 0x000055555557a455 in main (argc=<optimized out>, argv=<optimized out>) at cli_classic.c:1255\n"
```