mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -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
|
@ -433,6 +433,7 @@ typedef struct {
|
|||
#define CMD_FLASHMEM_DOWNLOADED 0x0124
|
||||
#define CMD_FLASHMEM_INFO 0x0125
|
||||
#define CMD_FLASHMEM_SET_SPIBAUDRATE 0x0126
|
||||
#define CMD_FLASHMEM_PAGES64K 0x0127
|
||||
|
||||
// RDV40, High level flashmem SPIFFS Manipulation
|
||||
// ALL function will have a lazy or Safe version
|
||||
|
|
|
@ -37,10 +37,16 @@
|
|||
#ifndef FLASH_MEM_MAX_SIZE
|
||||
# define FLASH_MEM_MAX_SIZE 0x40000 // (262144)
|
||||
#endif
|
||||
#ifndef FLASH_MEM_MAX_SIZE_P
|
||||
# define FLASH_MEM_MAX_SIZE_P(p64k) (1024 * 64 * p64k)
|
||||
#endif
|
||||
|
||||
#ifndef FLASH_MEM_MAX_4K_SECTOR
|
||||
# define FLASH_MEM_MAX_4K_SECTOR 0x3F000
|
||||
#endif
|
||||
#ifndef FLASH_MEM_MAX_4K_SECTOR_P
|
||||
# define FLASH_MEM_MAX_4K_SECTOR_P(p64k) (FLASH_MEM_MAX_SIZE_P(p64k) - 4096)
|
||||
#endif
|
||||
|
||||
#ifndef FLASH_MEM_ID_LEN
|
||||
# define FLASH_MEM_ID_LEN 8
|
||||
|
@ -54,6 +60,9 @@
|
|||
// -1 for historical compatibility with already released Proxmark3 RDV4.0 devices
|
||||
# define FLASH_MEM_SIGNATURE_OFFSET (FLASH_MEM_MAX_SIZE - FLASH_MEM_SIGNATURE_LEN - 1)
|
||||
#endif
|
||||
#ifndef FLASH_MEM_SIGNATURE_OFFSET_P
|
||||
# define FLASH_MEM_SIGNATURE_OFFSET_P(p64k) (FLASH_MEM_MAX_SIZE_P(p64k) - FLASH_MEM_SIGNATURE_LEN - 1)
|
||||
#endif
|
||||
|
||||
#ifndef T55XX_CONFIG_LEN
|
||||
# define T55XX_CONFIG_LEN sizeof( t55xx_configurations_t )
|
||||
|
@ -62,6 +71,9 @@
|
|||
#ifndef T55XX_CONFIG_OFFSET
|
||||
# define T55XX_CONFIG_OFFSET (FLASH_MEM_MAX_4K_SECTOR - 0x2000)
|
||||
#endif
|
||||
#ifndef T55XX_CONFIG_OFFSET_P
|
||||
# define T55XX_CONFIG_OFFSET_P(p64k) (FLASH_MEM_MAX_4K_SECTOR_P(p64k) - 0x2000)
|
||||
#endif
|
||||
|
||||
// Reserved space for T55XX PWD = 4 kb
|
||||
#ifndef DEFAULT_T55XX_KEYS_OFFSET
|
||||
|
@ -69,6 +81,9 @@
|
|||
# define DEFAULT_T55XX_KEYS_OFFSET (T55XX_CONFIG_OFFSET - DEFAULT_T55XX_KEYS_LEN)
|
||||
# define DEFAULT_T55XX_KEYS_MAX ((DEFAULT_T55XX_KEYS_LEN - 2) / 4)
|
||||
#endif
|
||||
#ifndef DEFAULT_T55XX_KEYS_OFFSET_P
|
||||
# define DEFAULT_T55XX_KEYS_OFFSET_P(p64k) (T55XX_CONFIG_OFFSET_P(p64k) - DEFAULT_T55XX_KEYS_LEN)
|
||||
#endif
|
||||
|
||||
// Reserved space for iClass keys = 4 kb
|
||||
#ifndef DEFAULT_ICLASS_KEYS_OFFSET
|
||||
|
@ -76,6 +91,9 @@
|
|||
# define DEFAULT_ICLASS_KEYS_OFFSET (DEFAULT_T55XX_KEYS_OFFSET - DEFAULT_ICLASS_KEYS_LEN)
|
||||
# define DEFAULT_ICLASS_KEYS_MAX ((DEFAULT_ICLASS_KEYS_LEN - 2) / 8)
|
||||
#endif
|
||||
#ifndef DEFAULT_ICLASS_KEYS_OFFSET_P
|
||||
# define DEFAULT_ICLASS_KEYS_OFFSET_P(p64k) (DEFAULT_T55XX_KEYS_OFFSET_P(p64k) - DEFAULT_ICLASS_KEYS_LEN)
|
||||
#endif
|
||||
|
||||
// Reserved space for MIFARE Keys = 12 kb
|
||||
#ifndef DEFAULT_MF_KEYS_OFFSET
|
||||
|
@ -83,6 +101,9 @@
|
|||
# define DEFAULT_MF_KEYS_OFFSET (DEFAULT_ICLASS_KEYS_OFFSET - DEFAULT_MF_KEYS_LEN)
|
||||
# define DEFAULT_MF_KEYS_MAX ((DEFAULT_MF_KEYS_LEN - 2) / 6)
|
||||
#endif
|
||||
#ifndef DEFAULT_MF_KEYS_OFFSET_P
|
||||
# define DEFAULT_MF_KEYS_OFFSET_P(p64k) (DEFAULT_ICLASS_KEYS_OFFSET_P(p64k) - DEFAULT_MF_KEYS_LEN)
|
||||
#endif
|
||||
|
||||
// RDV40, validation structure to help identifying that client/firmware is talking with RDV40
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue