fixed flashing the internal AP-tag

This commit is contained in:
Jelmer
2023-03-27 14:54:31 +02:00
parent d5399ba309
commit ea36618295
2 changed files with 2 additions and 8 deletions

View File

@@ -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

View File

@@ -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]);