mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
show SPI flash JEDEC data
Signed-off-by: ANTodorov <ANTodorov@users.noreply.github.com>
This commit is contained in:
parent
57ae16756d
commit
7ffab48e77
3 changed files with 31 additions and 12 deletions
|
@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
|
|||
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
||||
|
||||
## [unreleased][unreleased]
|
||||
- show SPI flash JEDEC Manufacturer ID and Device ID in `hw status` output (@ANTodorov)
|
||||
- Improved `hf iclass configcards` to support generating config cards using a different key than the default k0 as the card's key (@antiklesys)
|
||||
- Added maur keys (@iceman1001)
|
||||
- Fixed `hf mfu pwdgen` for the 7 byte UID (@ANTodorov)
|
||||
|
|
|
@ -49,18 +49,28 @@ void FlashmemSetSpiBaudrate(uint32_t baudrate) {
|
|||
}
|
||||
|
||||
// read ID out
|
||||
bool Flash_ReadID_90(flash_device_type_90_t *result) {
|
||||
bool Flash_ReadID(flash_device_type_t *result, bool read_jedec ) {
|
||||
|
||||
if (Flash_CheckBusy(BUSY_TIMEOUT)) return false;
|
||||
|
||||
// Manufacture ID / device ID
|
||||
FlashSendByte(ID);
|
||||
FlashSendByte(0x00);
|
||||
FlashSendByte(0x00);
|
||||
FlashSendByte(0x00);
|
||||
|
||||
result->manufacturer_id = FlashSendByte(0xFF);
|
||||
result->device_id = FlashSendLastByte(0xFF);
|
||||
if ( read_jedec) {
|
||||
// 0x9F JEDEC
|
||||
FlashSendByte(JEDECID);
|
||||
|
||||
result->manufacturer_id = FlashSendByte(0xFF);
|
||||
result->device_id = FlashSendByte(0xFF);
|
||||
result->device_id2 = FlashSendLastByte(0xFF);
|
||||
} else {
|
||||
// 0x90 Manufacture ID / device ID
|
||||
FlashSendByte(ID);
|
||||
FlashSendByte(0x00);
|
||||
FlashSendByte(0x00);
|
||||
FlashSendByte(0x00);
|
||||
|
||||
result->manufacturer_id = FlashSendByte(0xFF);
|
||||
result->device_id = FlashSendLastByte(0xFF);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -346,8 +356,8 @@ void Flashmem_print_status(void) {
|
|||
|
||||
// NOTE: It would likely be more useful to use JDEC ID command 9F,
|
||||
// as it provides a third byte indicative of capacity.
|
||||
flash_device_type_90_t device_type = {0};
|
||||
if (!Flash_ReadID_90(&device_type)) {
|
||||
flash_device_type_t device_type = {0};
|
||||
if (!Flash_ReadID(&device_type, false)) {
|
||||
DbpString(" Device ID............... " _RED_(" --> Not Found <--"));
|
||||
} else {
|
||||
if (device_type.manufacturer_id == WINBOND_MANID) {
|
||||
|
@ -370,6 +380,13 @@ void Flashmem_print_status(void) {
|
|||
device_type.device_id
|
||||
);
|
||||
}
|
||||
if (Flash_ReadID(&device_type, true)) {
|
||||
Dbprintf(" JEDEC Mfr ID / Dev ID... " _YELLOW_("%02X / %02X%02X"),
|
||||
device_type.manufacturer_id,
|
||||
device_type.device_id,
|
||||
device_type.device_id2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t uid[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
|
|
@ -129,8 +129,9 @@ bool Flash_Erase64k(uint8_t block);
|
|||
typedef struct {
|
||||
uint8_t manufacturer_id;
|
||||
uint8_t device_id;
|
||||
} flash_device_type_90_t; // to differentiate from JDEC ID via cmd 9F
|
||||
bool Flash_ReadID_90(flash_device_type_90_t *result);
|
||||
uint8_t device_id2;
|
||||
} flash_device_type_t; // extra device_id used for the JEDEC ID read via cmd 9F
|
||||
bool Flash_ReadID(flash_device_type_t *result, bool read_jedec);
|
||||
|
||||
uint16_t Flash_ReadData(uint32_t address, uint8_t *out, uint16_t len);
|
||||
uint16_t Flash_ReadDataCont(uint32_t address, uint8_t *out, uint16_t len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue