Sfoglia il codice sorgente

esp32c3: Add support for building image with a minimum target revision

Angus Gratton 5 anni fa
parent
commit
10d1e4ab1b
2 ha cambiato i file con 31 aggiunte e 1 eliminazioni
  1. 22 0
      components/esp32c3/Kconfig
  2. 9 1
      components/esptool_py/project_include.cmake

+ 22 - 0
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_FOUR

+ 9 - 1
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)