mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
use all spi flash v0.1
* introduced a new communication command CMD_FLASHMEM_PAGES64K to get the number of 64k pages * "the last page" is a special, holding the dicts and some other stuff, relocated to there * raised timeout when wiping a mem page (W25Q16 looks a bit slower than W25X20BV) * loop all pages in Flash_WipeMemory()
This commit is contained in:
parent
c9e751d27d
commit
48ec109a1e
10 changed files with 193 additions and 36 deletions
|
@ -2789,7 +2789,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
LED_B_OFF();
|
||||
break;
|
||||
}
|
||||
if (page < 3) {
|
||||
if (page < spi_flash_p64k-1) {
|
||||
isok = Flash_WipeMemoryPage(page);
|
||||
// let spiffs check and update its info post flash erase
|
||||
rdv40_spiffs_check();
|
||||
|
@ -2836,7 +2836,7 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
LED_B_ON();
|
||||
rdv40_validation_t *info = (rdv40_validation_t *)BigBuf_malloc(sizeof(rdv40_validation_t));
|
||||
|
||||
bool isok = Flash_ReadData(FLASH_MEM_SIGNATURE_OFFSET, info->signature, FLASH_MEM_SIGNATURE_LEN);
|
||||
bool isok = Flash_ReadData(FLASH_MEM_SIGNATURE_OFFSET_P(spi_flash_p64k), info->signature, FLASH_MEM_SIGNATURE_LEN);
|
||||
|
||||
if (FlashInit()) {
|
||||
Flash_UniqueID(info->flashid);
|
||||
|
@ -2845,6 +2845,23 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
reply_mix(CMD_ACK, isok, 0, 0, info, sizeof(rdv40_validation_t));
|
||||
BigBuf_free();
|
||||
|
||||
LED_B_OFF();
|
||||
break;
|
||||
}
|
||||
case CMD_FLASHMEM_PAGES64K: {
|
||||
|
||||
LED_B_ON();
|
||||
|
||||
bool isok = false;
|
||||
if (FlashInit()) {
|
||||
isok = true;
|
||||
if (g_dbglevel >= DBG_DEBUG) {
|
||||
Dbprintf(" CMD_FLASHMEM_PAGE64K 0x%02x (%d 64k pages)", spi_flash_p64k, spi_flash_p64k);
|
||||
}
|
||||
FlashStop();
|
||||
}
|
||||
reply_mix(CMD_ACK, isok, 0, 0, &spi_flash_p64k, sizeof(uint8_t));
|
||||
|
||||
LED_B_OFF();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue