From ea3661829554b47f70d6904d326f1bb5a3e560cf Mon Sep 17 00:00:00 2001 From: Jelmer Date: Mon, 27 Mar 2023 14:54:31 +0200 Subject: [PATCH] fixed flashing the internal AP-tag --- ESP32_AP-Flasher/src/powermgt.cpp | 4 ---- ESP32_AP-Flasher/src/usbflasher.cpp | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ESP32_AP-Flasher/src/powermgt.cpp b/ESP32_AP-Flasher/src/powermgt.cpp index eff48309..20885149 100644 --- a/ESP32_AP-Flasher/src/powermgt.cpp +++ b/ESP32_AP-Flasher/src/powermgt.cpp @@ -19,10 +19,6 @@ void simpleAPPower(bool state) { // when drained, will cause the 3v3 rail to sag enough to reset the ESP32. This is obviously not great. To prevent this from happening, we ramp up/down the // voltage with PWM. Ramping down really is unnecessary, as the board has a resistor to dump the charge into. void rampTagPower(uint8_t pin, bool up) { - pinMode(FLASHER_AP_SS, INPUT); - pinMode(FLASHER_AP_CLK, INPUT); - pinMode(FLASHER_AP_MOSI, INPUT); - pinMode(FLASHER_AP_MISO, INPUT); pinMode(FLASHER_AP_RESET, OUTPUT); digitalWrite(FLASHER_AP_RESET, HIGH); #ifdef OPENEPAPERLINK_PCB diff --git a/ESP32_AP-Flasher/src/usbflasher.cpp b/ESP32_AP-Flasher/src/usbflasher.cpp index 77829325..f2e6640b 100644 --- a/ESP32_AP-Flasher/src/usbflasher.cpp +++ b/ESP32_AP-Flasher/src/usbflasher.cpp @@ -259,7 +259,7 @@ void processFlasherCommand(struct flasherCommand* cmd) { tempbuffer = (uint8_t*)calloc(cmd->data[0], 1); // cmd_buff[0] = len // cmd_buff[1] << 8 | cmd_buff[2] = position - Serial.printf("Loading %d bytes from %04X \n", cmd->data[0], (cmd->data[1] << 8 | cmd->data[2])); + //Serial.printf("Loading %d bytes from %04X \n", cmd->data[0], (cmd->data[1] << 8 | cmd->data[2])); for (int i = 0; i < cmd->data[0]; i++) { tempbuffer[i] = zbs->read_flash((cmd->data[1] << 8 | cmd->data[2]) + i); } @@ -275,7 +275,7 @@ void processFlasherCommand(struct flasherCommand* cmd) { sendFlasherAnswer(cmd->command, temp_buff, 1); break; } - Serial.printf("Writing %d bytes to %04X \n", cmd->data[0], (cmd->data[1] << 8 | cmd->data[2])); + //Serial.printf("Writing %d bytes to %04X \n", cmd->data[0], (cmd->data[1] << 8 | cmd->data[2])); for (int i = 0; i < cmd->data[0]; i++) { if (cmd->data[3 + i] != 0xff) { for (uint8_t attempts = 0; attempts < 10; attempts++) { @@ -288,7 +288,6 @@ void processFlasherCommand(struct flasherCommand* cmd) { } flash_fail: temp_buff[0] = 0; - Serial.print("!"); sendFlasherAnswer(cmd->command, temp_buff, 1); break; flash_pass: @@ -297,7 +296,6 @@ void processFlasherCommand(struct flasherCommand* cmd) { } temp_buff[0] = 1; sendFlasherAnswer(cmd->command, temp_buff, 1); - Serial.print("#"); break; case CMD_READ_SFR: temp_buff[0] = zbs->read_sfr(cmd->data[0]);