Error when trying to flash in binmode using flashrom

Hi @red-red-green, welcome to the forum. I moved this to a new topic so it will get noticed.

@Dreg wrote the legacy binmode, so he would be best positioned to help.

2 Likes

thank you. i’m available if you need me to run any commands for testing @Dreg. just let me know!

2 Likes

Hi @red-red-green, Welcome!

It finds the chip via SPI and seems to be able to read its entire contents…

Found Macronix flash chip “MX25U12835F” (16384 kB, SPI) on buspirate_spi.  
...  
Reading old flash chip contents… done.

@red-red-green , The problem seems to be that it gets stuck waiting after writing part of the data, right?

I need the following to help you:

  • Use the latest release of Flashrom (you’re using 1.2, which is already outdated): Flashrom Release Notes.
  • Run Flashrom with different verbosity levels to gather more information:
    • First, -V
    • Then, -VV
    • Finally, -VVV
    • Attach the output files.
  • Do you have a CH341A or a similar programmer that works with Flashrom? This will help determine if the issue is with Flashrom itself, the Bus Pirate integration in Flashrom, or binlegacymode.
  • Is the 1.8V voltage correct? Measure it on the target chip’s pins / PCB with a multimeter, if possible.
  • Can you try 150mA instead of 50mA?
  • Make sure you’re using the latest Bus Pirate firmware from the forum.
  • If possible, connect a short, high-quality USB cable directly to the PC, without using USB hubs or virtual machines.
  • @red-red-green Before anything else, try a lower SPI speed:
buspirate_spi:spispeed=30k

This mode on Bus Pirate 5, 5XL, and 6 is still in beta. Thx @ian !

2 Likes

Thanks for your reply. I wasn’t aware the flashrom on my system was so outdated. It appears 1.2 is the version which is installed as part of ubuntu 22.04.4’s default apt repository.

I went ahead and compiled/installed flashrom 1.6-dev. I then initialized Buspirate v5 (using the latest firmware) and set the voltage to 1.8v (which is correct for the MX25U12835F chip) and upped the limit to 150mA as you suggested.

Everything worked! Here’s the verbose output from flashrom:

flashrom -p buspirate_spi:dev=/dev/ttyACM1 -c MX25U12835F -w Image_UEFI_UEFI_image.rom -V

flashrom v1.6.0-devel (git:v1.5.0-19-g971ea27d) on Linux 6.8.0-52-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

flashrom was built with GCC 11.4.0, little endian
Command line (7 args): flashrom -p buspirate_spi:dev=/dev/ttyACM1 -c MX25U12835F -w Image_UEFI_UEFI_image.rom -V
Initializing buspirate_spi programmer
Detected Bus Pirate hardware 2.5
Detected Bus Pirate firmware 7.1
Using SPI command set v2.
SPI speed is 8MHz
Raw bitbang mode version 1
Raw SPI mode version 1
Driving AUX high.
The following protocols are supported: SPI.
Probing for Macronix MX25U12835F, 16384 kB: compare_id: id1 0xc2, id2 0x2538
Added layout entry 00000000 - 00ffffff named complete flash
Found Macronix flash chip “MX25U12835F” (16384 kB, SPI) on buspirate_spi.
Chip status register is 0x00.
Chip status register: Status Register Write Disable (SRWD, SRP, …) is not set
Chip status register: Bit 6 is not set
Chip status register: Block Protect 3 (BP3) is not set
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

Reading old flash chip contents… read_flash: region (00000000…0xffffff) is readable, reading range (00000000…0xffffff).
done.
Updating flash chip contents… erase_write: region (00000000…0xffffff) is writable, erasing range (00000000…0xffffff).
Erase/write done from 0 to ffffff
Raw bitbang mode version 1
Bus Pirate shutdown completed.

Thanks so much for pointing me in the right direction. I appreciate your help!

4 Likes

Thanks for reporting back! So glad you got it :tada:

4 Likes

What a relief that everything works fine despite my messy code :joy:!

4 Likes