summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2022-06-24 17:42:27 -0700
committerH. Peter Anvin <hpa@zytor.com>2022-06-24 17:42:27 -0700
commit0adde6e16707ee02db55105406719bb17c2fb241 (patch)
treebc825440d61e838ca571e42234659f8790475eff
parentab483f5e20b5366a8b7d6de7855567ee54fcc4f4 (diff)
downloadblinktest-0adde6e16707ee02db55105406719bb17c2fb241.tar.gz
blinktest-0adde6e16707ee02db55105406719bb17c2fb241.tar.xz
blinktest-0adde6e16707ee02db55105406719bb17c2fb241.zip
esp32: fix firmware upload over TCP
Fix invalid pointer during firmware upload over TCP
-rw-r--r--esp32/Makefile2
-rw-r--r--esp32/max80/fwupdate.c15
-rw-r--r--esp32/output/max80.ino.binbin788928 -> 795616 bytes
-rw-r--r--fpga/output/v1.fwbin754345 -> 759150 bytes
-rw-r--r--fpga/output/v2.fwbin754973 -> 760039 bytes
5 files changed, 10 insertions, 7 deletions
diff --git a/esp32/Makefile b/esp32/Makefile
index 2f12197..8b2445c 100644
--- a/esp32/Makefile
+++ b/esp32/Makefile
@@ -7,7 +7,7 @@ SKETCH = max80
TARGET = output/$(SKETCH).ino.bin
GENFILES = www.zip
WWW = www
-PORT ?= /dev/ttyACM2
+PORT ?= /dev/ttyACM0
build_defines = -DBOARD_HAS_PSRAM -I$(realpath ../common)
diff --git a/esp32/max80/fwupdate.c b/esp32/max80/fwupdate.c
index 246d620..afbc1a8 100644
--- a/esp32/max80/fwupdate.c
+++ b/esp32/max80/fwupdate.c
@@ -349,8 +349,10 @@ static void firmware_update_task(void *pvt)
spz->err = err;
err = fwupdate_data_cleanup(spz);
- if (err)
+ if (err) {
MSG("failed (err %d)\n", err);
+ spz->err = err;
+ }
fail:
xSemaphoreGive(fwupdate_done);
@@ -389,16 +391,17 @@ int firmware_update_start(read_func_t read_data, token_t token)
fwupdate_spz = calloc(1, sizeof *fwupdate_spz);
if (!fwupdate_spz)
goto err;
- fwupdate_spz->err = Z_MEM_ERROR;
+
+ fwupdate_spz->err = Z_MEM_ERROR;
+ fwupdate_spz->read_data = read_data;
+ fwupdate_spz->token = token;
fwupdate_done = xSemaphoreCreateBinary();
if (!fwupdate_done)
goto err;
- fwupdate_spz->read_data = read_data;
- fwupdate_spz->token = token;
- if (xTaskCreate(fwupdate_task, "fwupdate",
- FWUPDATE_STACK, &fwupdate_spz,
+ if (xTaskCreate(firmware_update_task, "fwupdate",
+ FWUPDATE_STACK, fwupdate_spz,
FWUPDATE_PRIORITY, &fwupdate_task) != pdPASS) {
xSemaphoreGive(fwupdate_done);
}
diff --git a/esp32/output/max80.ino.bin b/esp32/output/max80.ino.bin
index 2789b0c..d944677 100644
--- a/esp32/output/max80.ino.bin
+++ b/esp32/output/max80.ino.bin
Binary files differ
diff --git a/fpga/output/v1.fw b/fpga/output/v1.fw
index 13a83ae..464d956 100644
--- a/fpga/output/v1.fw
+++ b/fpga/output/v1.fw
Binary files differ
diff --git a/fpga/output/v2.fw b/fpga/output/v2.fw
index b22e2ac..dd1bbb6 100644
--- a/fpga/output/v2.fw
+++ b/fpga/output/v2.fw
Binary files differ