From d33e6a1fbd9e2a5454fabb5b16bf1145c06fbca4 Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Wed, 3 May 2023 23:42:33 +0100 Subject: [PATCH] Add a diagnostic to tell the user about the partition table format when the image doesn't fit --- espflash/src/error.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/espflash/src/error.rs b/espflash/src/error.rs index e1966c92..171cdc3a 100644 --- a/espflash/src/error.rs +++ b/espflash/src/error.rs @@ -44,6 +44,11 @@ pub enum Error { #[error( "Supplied ELF image of {0}B is too big, and doesn't fit configured app partition of {1}B" )] + #[diagnostic( + code(espflash::image_too_big), + help("Reduce the size of the binary or increase the size of the partition."), + url("https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html#built-in-partition-tables") + )] ElfTooBig(u32, u32), #[error("Failed to connect to on-device flash")]