mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 03:04:25 +01:00
- ESP32_Flasher: Return new status "2" when connected, but nRF is locked (#327)
- OEPL-Flasher: Print "locked" message when flasher returns status 2 - ESP32_Flasher: Initialize idCode to zero as failed read attempts will not set it - ESP32_Flasher: Print returned idCode when showDebug is enabled
This commit is contained in:
@@ -18,7 +18,7 @@ class swd {
|
||||
bool DP_Write(unsigned addr, uint32_t data);
|
||||
bool DP_Read(unsigned addr, uint32_t &data);
|
||||
|
||||
uint32_t idCode;
|
||||
uint32_t idCode = 0;
|
||||
|
||||
protected:
|
||||
void swd_Begin();
|
||||
|
||||
@@ -182,6 +182,7 @@ bool nrfswd::init() {
|
||||
isLocked = true;
|
||||
}
|
||||
} else {
|
||||
if (showDebug) Serial0.printf("No nRF core ID found, got 0x%lx\n", temp);
|
||||
isConnected = false;
|
||||
isLocked = true;
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ void processFlasherCommand(struct flasherCommand* cmd) {
|
||||
nrfflasherp = new nrfswd(FLASHER_EXT_MISO, FLASHER_EXT_CLK);
|
||||
nrfflasherp->showDebug = false;
|
||||
nrfflasherp->init();
|
||||
temp_buff[0] = (nrfflasherp->isConnected && !nrfflasherp->isLocked);
|
||||
temp_buff[0] = nrfflasherp->isConnected ? (nrfflasherp->isLocked ? 2 : 1) : 0;
|
||||
sendFlasherAnswer(CMD_SELECT_NRF82511, temp_buff, 1);
|
||||
currentFlasherOffset = 0;
|
||||
selectedController = CONTROLLER_NRF82511;
|
||||
|
||||
@@ -380,6 +380,10 @@ def main():
|
||||
|
||||
if (answer[0] == 1):
|
||||
print("Connection established to microcontroller")
|
||||
elif (answer[0] == 2):
|
||||
print("Established connection to the microcontroller, but it is locked. Exiting.")
|
||||
send_cmd(CMD_SET_POWER, bytearray([0]))
|
||||
exit(0)
|
||||
else:
|
||||
print("Failed to establish a connection to the microcontroller")
|
||||
send_cmd(CMD_SET_POWER, bytearray([0]))
|
||||
|
||||
Reference in New Issue
Block a user