Shreeyash,
Thank you for such a prompt reply. I can see what you have done in the code you supplied.
The rest of the code is very aware of page size on read/write/erase, so needs to read the status register to work correctly
The programmer I am using is the CH341A modified to work at 3.3v
As I see it I would have to have 3 builds of Flashrom
1. Set 256 page size
2. Set 264 page size
3. as before modification to perform write and reads
What I was looking for was either a CLI flag that allowed me to issue a one time command. Dangerous I know !
Or maybe a flag that defined the page size required and altered it if necessary.
I am not a contributor to Flashrom but any mod I make I would like to share with others.
I believe it would be better if a maintainer came up with a scheme that fitted all spi flash that you support with different page sizes.
Regards
Rob
-----Original Message-----
From: tunabomber <shreeyash335@gmail.com>
To: rh100605@aol.com
Sent: Mon, 8 Aug 2022 15:31
Subject: Re: [flashrom] Setting page size in AT45db081d spi flash
Hey Rob,
I don't see that flashrom has an option to re-configure the chip's page size,
nor did I find a way to send a command directly to the chip.
However, I am thinking of a hack you could use here.
File at45db.c implements the operations of your chip. We could modify one of the
functions here that we shall use to send our four bytes of data. The very first function
`at45db_read_status_register` is simple enough and should get the job done.
Replacing 'AT45DB_STATUS' with '0x3d, 0x2a, 0x80, 0xa7' will send these bytes to
the chip when we ask flashrom to read the status register for us.
I've attached the modified file with this email. Diff it, if you may to see the
difference. Re-compile flashrom by following build instructions in the
README. Now read the status registers, this should send our string to the chip,
re-configuring it.
Reading status registers, I believe depends on the programmer? (Which one are
you using?). There's very little on this in the man page except for the section
on SPI Status Register for the dummy programmer. See if that is of any help.
Alternatively, you could modify some other function in a similar manner.
If you are not so sure about this, maybe wait for the more experienced folks
around here to see your message. I am only getting started with hardware
hacking.
Regards
Shreeyash
I have used Flashrom to backup a memory image in a radio using the AT45DB081E spi flash memory. The read operation worked well using the Flashrom device set as AT45DB081D
I bought some more used AT45DB081E chips to write the saved image and Flashrom objected by stating that the image was too big by 32767 bytes
I edited image by removing the last 32767 bytes and Flashrom wrote the used chips and verified successfully using the device setting AT45DB081D
While reading the datasheet I noticed that the AT45DB081D/E has two page sizes 256 and 264 bytes which explains the 32767 bytes difference in image sizes
It seems FlashROM is aware of the page size setting!
However I cannot see how read the status register to see the page size set or how to change it using the 0x3D 0x2A 0x80 0xA6 / A7 command as described in Chapter 11 of the AT45DB081E datasheet
To summarise I want to change the page size of an AT45DB081E back to 264 to repair the radio and cannot see how to use Flashrom to do it
Regards
Rob
_______________________________________________
flashrom mailing list -- flashrom@flashrom.org
To unsubscribe send an email to flashrom-leave@flashrom.org