Compare commits

...

4 Commits

4 changed files with 10 additions and 11 deletions

View File

@ -1,6 +1,6 @@
nvs, data, nvs, , 16k,
otadata, data, ota, , 8k,
phy_init, data, phy, , 4k,
ota_0, app, ota_0, , 6M,
ota_1, app, ota_1, , 6M,
storage, data, spiffs, , 3800k,
ota_0, app, ota_0, , 5632k,
ota_1, app, ota_1, , 5632k,
storage, data, spiffs, , 5000k,
1 nvs data nvs 16k
2 otadata data ota 8k
3 phy_init data phy 4k
4 ota_0 app ota_0 6M 5632k
5 ota_1 app ota_1 6M 5632k
6 storage data spiffs 3800k 5000k

View File

@ -1081,15 +1081,15 @@ fn get_version() -> VersionInfo {
let running_partition = unsafe { esp_ota_get_running_partition() };
let address = unsafe { (*running_partition).address };
let partition = if address > 20000 {
"ota_1"
let partition = if address > 100000 {
"ota_1 @ "
} else {
"ota_0"
"ota_0 @ "
};
return VersionInfo {
git_hash: (branch + "@" + hash),
build_time: env!("VERGEN_BUILD_TIMESTAMP").to_owned(),
partition: partition.to_owned()
partition: partition.to_owned() + &address.to_string()
};
}

View File

@ -272,7 +272,6 @@ fn ota(
loop {
let read = request.read(&mut buffer)?;
total_read += read;
println!("received {read} bytes ota {total_read}");
let to_write = &buffer[0..read];
let iter = (total_read/1024)%8;
@ -285,11 +284,11 @@ fn ota(
}
ota.write(to_write)?;
println!("wrote {read} bytes ota {total_read}");
if read == 0 {
break;
}
}
println!("wrote bytes ota {total_read}");
println!("finish ota");
let partition = ota.raw_partition();
println!("finalizing and changing boot partition to {partition:?}");
@ -299,7 +298,7 @@ fn ota(
board.set_restart_to_conf(true);
drop(board);
finalizer.set_as_boot_partition()?;
finalizer.restart();
return anyhow::Ok(None);
}
fn flash_bq(filename: &str, dryrun: bool) -> anyhow::Result<()> {

View File

@ -125,8 +125,8 @@ export class Controller {
controller.progressview.addProgress("ota_upload", (current / max) * 100, "Uploading firmeware (" + current + "/" + max + ")")
}, false);
ajax.addEventListener("load", () => {
//TODO wait for reboot here!
controller.progressview.removeProgress("ota_upload")
controller.reboot();
}, false);
ajax.addEventListener("error", () => {
alert("Error ota")