mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Update USB Serial Number from SPI flash's uniqueID
Also allow flash to be separately enabled via PLATFORM_EXTRAS. NOTE: this does *NOT* enable the serial number in the bootrom. Still investigating options there.
This commit is contained in:
parent
944d6ee596
commit
5784c8de77
6 changed files with 71 additions and 5 deletions
|
@ -2471,8 +2471,11 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||
LED_B_OFF();
|
||||
break;
|
||||
}
|
||||
if (page < 3)
|
||||
if (page < 3) {
|
||||
isok = Flash_WipeMemoryPage(page);
|
||||
// let spiffs check and update its info post flash erase
|
||||
rdv40_spiffs_check();
|
||||
}
|
||||
|
||||
reply_mix(CMD_ACK, isok, 0, 0, 0, 0);
|
||||
LED_B_OFF();
|
||||
|
@ -2677,6 +2680,17 @@ void __attribute__((noreturn)) AppMain(void) {
|
|||
I2C_init(false);
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FLASH
|
||||
if (FlashInit()) {
|
||||
uint64_t flash_uniqueID = 0;
|
||||
if (!Flash_CheckBusy(BUSY_TIMEOUT)) { // OK because firmware was built for devices with flash
|
||||
Flash_UniqueID((uint8_t*)&(flash_uniqueID));
|
||||
}
|
||||
FlashStop();
|
||||
usb_update_serial(flash_uniqueID);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FPC_USART
|
||||
usart_init(USART_BAUD_RATE, USART_PARITY);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue