From 8c7c081b720c0f5c98a69898798c412b9ff00e0f Mon Sep 17 00:00:00 2001 From: decentclock Date: Mon, 26 Sep 2022 14:14:23 -0400 Subject: [PATCH] Optimize factory binary size --- factory/Cargo.toml | 7 +++++++ factory/table.csv | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/factory/Cargo.toml b/factory/Cargo.toml index 1da361e..417c9d3 100644 --- a/factory/Cargo.toml +++ b/factory/Cargo.toml @@ -24,3 +24,10 @@ anyhow = "1" [package.metadata.espflash] partition_table = "table.csv" + +[profile.release] +strip = true # Automatically strip symbols from the binary. +opt-level = "z" # Optimize for size. +lto = true +codegen-units = 1 +panic = "abort" diff --git a/factory/table.csv b/factory/table.csv index 8133218..ef11890 100644 --- a/factory/table.csv +++ b/factory/table.csv @@ -3,5 +3,5 @@ nvs, data, nvs, 0x9000, 0x4000, otadata, data, ota, 0xd000, 0x2000, phy_init, data, phy, 0xf000, 0x1000, -factory, app, factory, 0x10000, 1200K, -ota_0, app, ota_0, 0x140000, 2800K, +factory, app, factory, 0x10000, 377K, +ota_0, app, ota_0, 0x70000, 3648K,