In summary, I see two options: 1. If the built-in erase is not really necessary, instead of command 0x82 we can use commands 0x84 (Buffer 1 Write) followed by 0x88 (Buffer 1 to Main Memory Page Program without Built-In Erase), that seem to be common to all devices. 2. If there is any use case where the built-in erase needs to be kept, we can add a Kconfig to configure whether or not to use it. When disabled, we can use 0x84 and 0x88 in all cases or read the chip ID and use command 0x02 instead if the device supports it.
I would choose option 1, but we need confirmation that it is ok to remove the built-in erase completely. Thoughts? Thanks Javier Casas Marín Geotab Senior Embedded Systems Developer Direct Toll-free Visit +34 900 535 371 www.geotab.com/es Twitter <https://twitter.com/geotab> | Facebook <https://www.facebook.com/Geotab> | YouTube <https://www.youtube.com/user/MyGeotab> | LinkedIn <https://www.linkedin.com/company/geotab/> On Mon, Mar 24, 2025 at 9:49 AM Javier Casas Marin <javierca...@geotab.com> wrote: > > In AT45DB161D chip, the Opcode 82H = Main Memory Page Program Through > Buffer *also performs a built-in erase.* > > From the datasheet, section 7.8: > "This operation is a combination of the Buffer Write and Buffer to Main > Memory Page Program with Built-in Erase operations." > > So the double erases are also an issue with that chip when the FTL driver > is used, so my questions remain the same. > > Thanks, > > Javier Casas Marín > Geotab > > Senior Embedded Systems Developer > > Direct > Toll-free > > Visit > > > +34 900 535 371 > www.geotab.com/es > > Twitter <https://twitter.com/geotab> | Facebook > <https://www.facebook.com/Geotab> | YouTube > <https://www.youtube.com/user/MyGeotab> | LinkedIn > <https://www.linkedin.com/company/geotab/> > > > On Sat, Mar 22, 2025 at 2:43 PM Dmitri Shilov <dshi...@cthru.xyz> wrote: > >> Hmm, I wonder if AT45DB161D does an undocumented erase, and the vendor >> added additional opcode for at45db641e but did not change the behavour of >> the old opcode (82H), just documented what actually happens? >> >> Regards, >> Dmitri Shilov. >> >> >> -------- Original Message -------- >> On 2025-03-21 1:25 p.m., Lwazi Dube <lwa...@gmail.com> wrote: >> >> > The problem is your chip and not the driver :) >> > >> > The at45db driver was written for the AT45DB161D. >> > Opcode 82H = Main Memory Page Program Through Buffer 1 >> > >> > For your chip (at45db641e) >> > Opcode 82H = Main Memory Page Program through Buffer 1 with Built-In >> Erase >> > Opcode 02H = Main Memory Byte/Page Program through Buffer 1 without >> > Built-In Erase >> > >> >