diff --git a/src/spiFlash.cpp b/src/spiFlash.cpp index 2c43fac..07fadcb 100644 --- a/src/spiFlash.cpp +++ b/src/spiFlash.cpp @@ -334,6 +334,9 @@ int SPIFlash::erase_and_prog(int base_addr, uint8_t *data, int len) int size = 0; for (int addr = 0; addr < len; addr += size, ptr+=size) { size = (addr + 256 > len)?(len-addr) : 256; + if ((_jedec_id >> 8) == 0xbf258d) { + size = 1; + } if (write_page(base_addr + addr, ptr, size) == -1) return -1; progress.display(addr); diff --git a/src/spiFlashdb.hpp b/src/spiFlashdb.hpp index 077a6d9..e4b2c21 100644 --- a/src/spiFlashdb.hpp +++ b/src/spiFlashdb.hpp @@ -15,7 +15,7 @@ typedef enum { STATR = 0, /* status register */ FUNCR = 1, /* function register */ CONFR = 2, /* configuration register */ - NONER = 99, /* configuration register */ + NONER = 99, /* "none" register */ } tb_loc_t; typedef struct { @@ -125,6 +125,19 @@ static std::map flash_list = { .bp_len = 4, .bp_offset = {(1 << 2), (1 << 3), (1 << 4), (1 << 6)}} }, + {0xbf258d, { + .manufacturer = "microchip", + .model = "SST25VF040B", + .nr_sector = 8, + .sector_erase = true, + .subsector_erase = true, + .has_extended = false, + .tb_otp = false, + .tb_offset = 0, + .tb_register = NONER, + .bp_len = 4, + .bp_offset = {(1 << 2), (1 << 3), (1 << 4), (1 << 5)}} + }, {0xBF2642, { .manufacturer = "microchip", .model = "SST26VF032B",