From 67a1858bb1ad9c563f7b33e4ee7f6bdb5b5adae5 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 23 Feb 2021 17:40:38 +1100 Subject: [PATCH] esp32c3: Add support for building image with a minimum target revision --- components/esp32c3/Kconfig | 22 +++++++++++++++++++++ components/esptool_py/project_include.cmake | 10 +++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/components/esp32c3/Kconfig b/components/esp32c3/Kconfig index 49e2b75656..cd2885cf8d 100644 --- a/components/esp32c3/Kconfig +++ b/components/esp32c3/Kconfig @@ -23,6 +23,28 @@ menu "ESP32C3-Specific" default 80 if ESP32C3_DEFAULT_CPU_FREQ_80 default 160 if ESP32C3_DEFAULT_CPU_FREQ_160 + choice ESP32C3_REV_MIN + prompt "Minimum Supported ESP32-C3 Revision" + default ESP32C3_REV_MIN_0 + help + Minimum revision that ESP-IDF would support. + + Only supporting higher chip revisions can reduce binary size. + + config ESP32C3_REV_MIN_0 + bool "Rev 0" + config ESP32C3_REV_MIN_1 + bool "Rev 1" + config ESP32C3_REV_MIN_2 + bool "Rev 2" + endchoice + + config ESP32C3_REV_MIN + int + default 0 if ESP32C3_REV_MIN_0 + default 1 if ESP32C3_REV_MIN_1 + default 2 if ESP32C3_REV_MIN_2 + choice ESP32C3_UNIVERSAL_MAC_ADDRESSES bool "Number of universally administered (by IEEE) MAC address" default ESP32C3_UNIVERSAL_MAC_ADDRESSES_TWO diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index 0297a3a8cd..d3196900f7 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -39,7 +39,15 @@ if(NOT CONFIG_SECURE_BOOT_ALLOW_SHORT_APP_PARTITION AND endif() if(CONFIG_ESP32_REV_MIN) - list(APPEND esptool_elf2image_args --min-rev ${CONFIG_ESP32_REV_MIN}) + set(min_rev ${CONFIG_ESP32_REV_MIN}) +endif() +if(CONFIG_ESP32C3_REV_MIN) + set(min_rev ${CONFIG_ESP32C3_REV_MIN}) +endif() + +if(min_rev) + list(APPEND esptool_elf2image_args --min-rev ${min_rev}) + unset(min_rev) endif() if(CONFIG_ESPTOOLPY_FLASHSIZE_DETECT)