mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-23 10:53:06 +00:00
Implement OTA abort handling in cmdhw.c
Added logic to restore fast link and log OTA abort action on firmware update failure. Signed-off-by: Niel Nielsen <nieldk@gmail.com>
This commit is contained in:
1 parent
339f528bba
commit
cac9e2d4cc
1 file changed
+6
@@ -2401,6 +2401,12 @@ static int CmdBWMUpgrade(const char *Cmd) {
|
||||
free(fw);
|
||||
|
||||
if (res != PM3_SUCCESS) {
|
||||
// Restore the fast link + logs that the OTA lowered at BEGIN.
|
||||
PacketResponseNG resp;
|
||||
uint8_t ab[1] = { BWM_OTA_ACTION_ABORT };
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_PM5_BWM_ESP_OTA, ab, sizeof(ab));
|
||||
(void)WaitForResponseTimeout(CMD_PM5_BWM_ESP_OTA, &resp, 8000);
|
||||
PrintAndLogEx(FAILED, "BWM firmware update failed after %d attempts", max_attempts);
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user