mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
flash still need old cmds
This commit is contained in:
parent
290f2b625b
commit
061321c353
2 changed files with 12 additions and 12 deletions
|
@ -260,7 +260,7 @@ fail:
|
||||||
|
|
||||||
// Get the state of the proxmark, backwards compatible
|
// Get the state of the proxmark, backwards compatible
|
||||||
static int get_proxmark_state(uint32_t *state) {
|
static int get_proxmark_state(uint32_t *state) {
|
||||||
SendCommandNG(CMD_DEVICE_INFO, NULL, 0);
|
SendCommandOLD(CMD_DEVICE_INFO, 0, 0, 0, NULL, 0);
|
||||||
PacketResponseOLD resp;
|
PacketResponseOLD resp;
|
||||||
ReceiveCommand(&resp);
|
ReceiveCommand(&resp);
|
||||||
|
|
||||||
|
@ -307,11 +307,11 @@ static int enter_bootloader(void) {
|
||||||
&& (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) {
|
&& (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) {
|
||||||
// New style handover: Send CMD_START_FLASH, which will reset the board
|
// New style handover: Send CMD_START_FLASH, which will reset the board
|
||||||
// and enter the bootrom on the next boot.
|
// and enter the bootrom on the next boot.
|
||||||
SendCommandNG(CMD_START_FLASH, NULL, 0);
|
SendCommandOLD(CMD_START_FLASH, 0, 0, 0, NULL, 0);
|
||||||
fprintf(stderr, "(Press and release the button only to abort)\n");
|
fprintf(stderr, "(Press and release the button only to abort)\n");
|
||||||
} else {
|
} else {
|
||||||
// Old style handover: Ask the user to press the button, then reset the board
|
// Old style handover: Ask the user to press the button, then reset the board
|
||||||
SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
|
SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0);
|
||||||
fprintf(stderr, "Press and hold down button NOW if your bootloader requires it.\n");
|
fprintf(stderr, "Press and hold down button NOW if your bootloader requires it.\n");
|
||||||
}
|
}
|
||||||
fprintf(stderr, "Waiting for Proxmark3 to reappear on USB...");
|
fprintf(stderr, "Waiting for Proxmark3 to reappear on USB...");
|
||||||
|
@ -356,9 +356,9 @@ int flash_start_flashing(int enable_bl_writes) {
|
||||||
// This command is stupid. Why the heck does it care which area we're
|
// This command is stupid. Why the heck does it care which area we're
|
||||||
// flashing, as long as it's not the bootloader area? The mind boggles.
|
// flashing, as long as it's not the bootloader area? The mind boggles.
|
||||||
if (enable_bl_writes) {
|
if (enable_bl_writes) {
|
||||||
SendCommandMIX(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0);
|
SendCommandOLD(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
SendCommandMIX(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0);
|
SendCommandOLD(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0);
|
||||||
}
|
}
|
||||||
return wait_for_ack();
|
return wait_for_ack();
|
||||||
} else {
|
} else {
|
||||||
|
@ -440,7 +440,7 @@ void flash_free(flash_file_t *ctx) {
|
||||||
|
|
||||||
// just reset the unit
|
// just reset the unit
|
||||||
int flash_stop_flashing(void) {
|
int flash_stop_flashing(void) {
|
||||||
SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
|
SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0);
|
||||||
msleep(100);
|
msleep(100);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ fail:
|
||||||
|
|
||||||
// Get the state of the proxmark, backwards compatible
|
// Get the state of the proxmark, backwards compatible
|
||||||
static int get_proxmark_state(uint32_t *state) {
|
static int get_proxmark_state(uint32_t *state) {
|
||||||
SendCommandNG(CMD_DEVICE_INFO, NULL, 0);
|
SendCommandOLD(CMD_DEVICE_INFO, 0, 0, 0, NULL, 0);
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
WaitForResponse(CMD_UNKNOWN, &resp); // wait for any response. No timeout.
|
WaitForResponse(CMD_UNKNOWN, &resp); // wait for any response. No timeout.
|
||||||
|
|
||||||
|
@ -304,11 +304,11 @@ static int enter_bootloader(char *serial_port_name) {
|
||||||
&& (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) {
|
&& (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) {
|
||||||
// New style handover: Send CMD_START_FLASH, which will reset the board
|
// New style handover: Send CMD_START_FLASH, which will reset the board
|
||||||
// and enter the bootrom on the next boot.
|
// and enter the bootrom on the next boot.
|
||||||
SendCommandNG(CMD_START_FLASH, NULL, 0);
|
SendCommandOLD(CMD_START_FLASH, 0, 0, 0, NULL, 0);
|
||||||
PrintAndLogEx(SUCCESS, "(Press and release the button only to " _YELLOW_("abort") ")");
|
PrintAndLogEx(SUCCESS, "(Press and release the button only to " _YELLOW_("abort") ")");
|
||||||
} else {
|
} else {
|
||||||
// Old style handover: Ask the user to press the button, then reset the board
|
// Old style handover: Ask the user to press the button, then reset the board
|
||||||
SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
|
SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0);
|
||||||
PrintAndLogEx(SUCCESS, "Press and hold down button NOW if your bootloader requires it.");
|
PrintAndLogEx(SUCCESS, "Press and hold down button NOW if your bootloader requires it.");
|
||||||
}
|
}
|
||||||
msleep(100);
|
msleep(100);
|
||||||
|
@ -359,9 +359,9 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name) {
|
||||||
PacketResponseNG resp;
|
PacketResponseNG resp;
|
||||||
|
|
||||||
if (enable_bl_writes) {
|
if (enable_bl_writes) {
|
||||||
SendCommandMIX(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0);
|
SendCommandOLD(CMD_START_FLASH, FLASH_START, FLASH_END, START_FLASH_MAGIC, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
SendCommandMIX(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0);
|
SendCommandOLD(CMD_START_FLASH, BOOTLOADER_END, FLASH_END, 0, NULL, 0);
|
||||||
}
|
}
|
||||||
return wait_for_ack(&resp);
|
return wait_for_ack(&resp);
|
||||||
} else {
|
} else {
|
||||||
|
@ -445,7 +445,7 @@ void flash_free(flash_file_t *ctx) {
|
||||||
|
|
||||||
// just reset the unit
|
// just reset the unit
|
||||||
int flash_stop_flashing(void) {
|
int flash_stop_flashing(void) {
|
||||||
SendCommandNG(CMD_HARDWARE_RESET, NULL, 0);
|
SendCommandOLD(CMD_HARDWARE_RESET, 0, 0, 0, NULL, 0);
|
||||||
msleep(100);
|
msleep(100);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue