diff --git a/Kconfig b/Kconfig index 90d71012..6199e5af 100644 --- a/Kconfig +++ b/Kconfig @@ -6,21 +6,21 @@ mainmenu "Espressif IoT Development Framework Configuration" choice TARGET_PLATFORM bool "Espressif target platform choose" - default TARGET_PLATFORM_ESP8266 + default IDF_TARGET_ESP8266 help Choose the specific target platform which you will use. -config TARGET_PLATFORM_ESP32 +config IDF_TARGET_ESP32 bool "esp32" -config TARGET_PLATFORM_ESP8266 +config IDF_TARGET_ESP8266 bool "esp8266" endchoice menu "SDK tool configuration" config TOOLPREFIX string - default "xtensa-esp32-elf-" if TARGET_PLATFORM_ESP32 - default "xtensa-lx106-elf-" if TARGET_PLATFORM_ESP8266 + default "xtensa-esp32-elf-" if IDF_TARGET_ESP32 + default "xtensa-lx106-elf-" if IDF_TARGET_ESP8266 help The prefix/path that is used to call the toolchain. The default setting assumes a crosstool-ng gcc setup that is in your PATH. diff --git a/components/app_update/esp_ota_ops.c b/components/app_update/esp_ota_ops.c index b9072340..f0902c53 100644 --- a/components/app_update/esp_ota_ops.c +++ b/components/app_update/esp_ota_ops.c @@ -34,7 +34,7 @@ #include "crc.h" #include "esp_log.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include "spi_flash.h" esp_err_t bootloader_flash_read(size_t src_addr, void *dest, size_t size, bool allow_decrypt); #endif @@ -174,7 +174,7 @@ esp_err_t esp_ota_write(esp_ota_handle_t handle, const void *data, size_t size) return ESP_ERR_OTA_VALIDATE_FAILED; } -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 if (esp_flash_encryption_enabled()) { /* Can only write 16 byte blocks to flash, so need to cache anything else */ size_t copy_len; @@ -354,7 +354,7 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype) if (SUB_TYPE_ID(subtype) >= ota_app_count) { return ESP_ERR_INVALID_ARG; } -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 const void *result = NULL; static spi_flash_mmap_memory_t ota_data_map; ret = esp_partition_mmap(find_partition, 0, find_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map); @@ -368,7 +368,7 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype) } #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 ret = spi_flash_read(find_partition->address, &s_ota_select[0], sizeof(ota_select)); if (ret != ESP_OK) { ESP_LOGE(TAG, "read failed"); @@ -502,7 +502,7 @@ const esp_partition_t *esp_ota_get_boot_partition(void) return NULL; } -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 const void *result = NULL; static spi_flash_mmap_memory_t ota_data_map; ret = esp_partition_mmap(find_partition, 0, find_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map); @@ -517,7 +517,7 @@ const esp_partition_t *esp_ota_get_boot_partition(void) #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 ret = spi_flash_read(find_partition->address, &s_ota_select[0], sizeof(ota_select)); if (ret != ESP_OK) { ESP_LOGE(TAG, "read failed"); diff --git a/components/bootloader/Kconfig.projbuild b/components/bootloader/Kconfig.projbuild index b85b2887..d16d3c6b 100644 --- a/components/bootloader/Kconfig.projbuild +++ b/components/bootloader/Kconfig.projbuild @@ -55,7 +55,7 @@ config BOOTLOADER_SPI_WP_PIN int "SPI Flash WP Pin when customising pins via efuse (read help)" range 0 33 default 7 - depends on (FLASHMODE_QIO || FLASHMODE_QOUT) && TARGET_PLATFORM_ESP32 + depends on (FLASHMODE_QIO || FLASHMODE_QOUT) && IDF_TARGET_ESP32 help This value is ignored unless flash mode is set to QIO or QOUT *and* the SPI flash pins have been overriden by setting the efuses SPI_PAD_CONFIG_xxx. @@ -69,7 +69,7 @@ config BOOTLOADER_SPI_WP_PIN choice BOOTLOADER_VDDSDIO_BOOST bool "VDDSDIO LDO voltage" default BOOTLOADER_VDDSDIO_BOOST_1_9V - depends on TARGET_PLATFORM_ESP32 + depends on IDF_TARGET_ESP32 help If this option is enabled, and VDDSDIO LDO is set to 1.8V (using EFUSE or MTDI bootstrapping pin), bootloader will change LDO settings to @@ -81,7 +81,7 @@ choice BOOTLOADER_VDDSDIO_BOOST config BOOTLOADER_VDDSDIO_BOOST_1_8V bool "1.8V" - depends on !ESPTOOLPY_FLASHFREQ_80M && TARGET_PLATFORM_ESP32 + depends on !ESPTOOLPY_FLASHFREQ_80M && IDF_TARGET_ESP32 config BOOTLOADER_VDDSDIO_BOOST_1_9V bool "1.9V" endchoice @@ -89,7 +89,7 @@ endchoice config BOOTLOADER_FACTORY_RESET bool "GPIO triggers factory reset" default N - depends on TARGET_PLATFORM_ESP32 + depends on IDF_TARGET_ESP32 help Allows to reset the device to factory settings: - clear one or more data partitions; @@ -99,7 +99,7 @@ config BOOTLOADER_FACTORY_RESET config BOOTLOADER_NUM_PIN_FACTORY_RESET int "Number of the GPIO input for factory reset" - depends on BOOTLOADER_FACTORY_RESET && TARGET_PLATFORM_ESP32 + depends on BOOTLOADER_FACTORY_RESET && IDF_TARGET_ESP32 range 0 39 default 4 help @@ -133,7 +133,7 @@ config BOOTLOADER_APP_TEST See settings below. config BOOTLOADER_APP_TEST_IN_OTA_1 - depends on BOOTLOADER_APP_TEST && TARGET_PLATFORM_ESP8266 + depends on BOOTLOADER_APP_TEST && IDF_TARGET_ESP8266 bool "Put test app in the ota_1 partition" default y help @@ -166,7 +166,7 @@ endmenu # Bootloader menu "Security features" - depends on TARGET_PLATFORM_ESP32 + depends on IDF_TARGET_ESP32 config SECURE_BOOT_ENABLED bool "Enable secure boot in bootloader (READ DOCS FIRST)" diff --git a/components/bootloader_support/include/esp_flash_partitions.h b/components/bootloader_support/include/esp_flash_partitions.h index ee413101..79c35b05 100644 --- a/components/bootloader_support/include/esp_flash_partitions.h +++ b/components/bootloader_support/include/esp_flash_partitions.h @@ -23,11 +23,11 @@ /* Pre-partition table fixed flash offsets */ #define ESP_BOOTLOADER_DIGEST_OFFSET 0x0 -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #define ESP_BOOTLOADER_OFFSET 0x1000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */ #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #define ESP_BOOTLOADER_OFFSET 0x0000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */ #endif diff --git a/components/bootloader_support/include/esp_image_format.h b/components/bootloader_support/include/esp_image_format.h index c8be9f66..c427cffa 100644 --- a/components/bootloader_support/include/esp_image_format.h +++ b/components/bootloader_support/include/esp_image_format.h @@ -44,7 +44,7 @@ enum { ESP_IMAGE_SPI_SPEED_80M = 0xF } esp_image_spi_freq_t; -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 /* Supported SPI flash sizes */ typedef enum { ESP_IMAGE_FLASH_SIZE_1MB = 0, @@ -56,7 +56,7 @@ typedef enum { } esp_image_flash_size_t; #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 /* Supported SPI flash sizes */ typedef enum { ESP_IMAGE_FLASH_SIZE_512KB = 0, @@ -87,7 +87,7 @@ typedef struct { uint8_t spi_size: 4; uint32_t entry_addr; -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 /* WP pin when SPI pins set via efuse (read by ROM bootloader, the IDF bootloader uses software to configure the WP * pin and sets this field to 0xEE=disabled) */ uint8_t wp_pin; @@ -102,11 +102,11 @@ typedef struct { #endif } __attribute__((packed)) esp_image_header_t; -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 _Static_assert(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes"); #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 _Static_assert(sizeof(esp_image_header_t) == 8, "binary image header should be 8 bytes"); #endif diff --git a/components/bootloader_support/src/bootloader_clock.c b/components/bootloader_support/src/bootloader_clock.c index ecc77b40..d46d1aea 100644 --- a/components/bootloader_support/src/bootloader_clock.c +++ b/components/bootloader_support/src/bootloader_clock.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include "rom/uart.h" #include "rom/rtc.h" diff --git a/components/bootloader_support/src/bootloader_common.c b/components/bootloader_support/src/bootloader_common.c index c82eeda8..9794f617 100644 --- a/components/bootloader_support/src/bootloader_common.c +++ b/components/bootloader_support/src/bootloader_common.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include #include @@ -160,7 +160,7 @@ bool bootloader_common_erase_part_type_data(const char *list_erase, bool ota_dat #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include #include diff --git a/components/bootloader_support/src/bootloader_flash.c b/components/bootloader_support/src/bootloader_flash.c index 4a6a134d..23c531f0 100644 --- a/components/bootloader_support/src/bootloader_flash.c +++ b/components/bootloader_support/src/bootloader_flash.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include @@ -256,7 +256,7 @@ esp_err_t bootloader_flash_erase_sector(size_t sector) #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include #include diff --git a/components/bootloader_support/src/bootloader_init.c b/components/bootloader_support/src/bootloader_init.c index 2ecf0a58..1c7fef45 100644 --- a/components/bootloader_support/src/bootloader_init.c +++ b/components/bootloader_support/src/bootloader_init.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include #include @@ -536,7 +536,7 @@ void __assert_func(const char *file, int line, const char *func, const char *exp #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include diff --git a/components/bootloader_support/src/bootloader_random.c b/components/bootloader_support/src/bootloader_random.c index bf75c8d7..6c1ab83b 100644 --- a/components/bootloader_support/src/bootloader_random.c +++ b/components/bootloader_support/src/bootloader_random.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include "bootloader_random.h" #include "soc/cpu.h" diff --git a/components/bootloader_support/src/bootloader_sha.c b/components/bootloader_support/src/bootloader_sha.c index 6e4b06a9..299d4261 100644 --- a/components/bootloader_support/src/bootloader_sha.c +++ b/components/bootloader_support/src/bootloader_sha.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include "bootloader_sha.h" #include @@ -170,7 +170,7 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest #endif -#elif defined(CONFIG_TARGET_PLATFORM_ESP8266) +#elif defined(CONFIG_IDF_TARGET_ESP8266) #ifndef BOOTLOADER_BUILD diff --git a/components/bootloader_support/src/bootloader_utility.c b/components/bootloader_support/src/bootloader_utility.c index d2de030f..89eef476 100644 --- a/components/bootloader_support/src/bootloader_utility.c +++ b/components/bootloader_support/src/bootloader_utility.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include #include @@ -478,7 +478,7 @@ static void set_cache_and_start_app( #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include #include diff --git a/components/bootloader_support/src/efuse.c b/components/bootloader_support/src/efuse.c index c3e23b1b..9d40b359 100644 --- a/components/bootloader_support/src/efuse.c +++ b/components/bootloader_support/src/efuse.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include "esp_efuse.h" #include "esp_log.h" diff --git a/components/bootloader_support/src/esp_image_format.c b/components/bootloader_support/src/esp_image_format.c index b7a4642d..8f2faf5e 100644 --- a/components/bootloader_support/src/esp_image_format.c +++ b/components/bootloader_support/src/esp_image_format.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include #include @@ -583,7 +583,7 @@ static void debug_log_hash(const uint8_t *image_hash, const char *label) #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include #include @@ -692,7 +692,7 @@ esp_err_t esp_image_load(esp_image_load_mode_t mode, const esp_partition_pos_t * if (1) { #else #ifdef CONFIG_ENABLE_BOOT_CHECK_SHA256 -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 if (data->image.hash_appended) #endif { @@ -1074,7 +1074,7 @@ static esp_err_t verify_checksum(bootloader_sha256_handle_t sha_handle, uint32_t bootloader_sha256_data(sha_handle, buf, length - unpadded_length); } -#if CONFIG_TARGET_PLATFORM_ESP32 +#if CONFIG_IDF_TARGET_ESP32 if (data->image.hash_appended) #endif { @@ -1100,7 +1100,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han // For secure boot, we calculate the signature hash over the whole file, which includes any "simple" hash // appended to the image for corruption detection -#if CONFIG_TARGET_PLATFORM_ESP32 +#if CONFIG_IDF_TARGET_ESP32 if (data->image.hash_appended) #endif { diff --git a/components/bootloader_support/src/flash_encrypt.c b/components/bootloader_support/src/flash_encrypt.c index 8d21c37d..f6b51f6d 100644 --- a/components/bootloader_support/src/flash_encrypt.c +++ b/components/bootloader_support/src/flash_encrypt.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include diff --git a/components/bootloader_support/src/flash_partitions.c b/components/bootloader_support/src/flash_partitions.c index 002320ff..51359ea6 100644 --- a/components/bootloader_support/src/flash_partitions.c +++ b/components/bootloader_support/src/flash_partitions.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include #include "esp_flash_partitions.h" @@ -91,7 +91,7 @@ esp_err_t esp_partition_table_basic_verify(const esp_partition_info_t *partition #endif -#ifdef CONFIG_TARGET_PLATFORM_ESP8266 +#ifdef CONFIG_IDF_TARGET_ESP8266 #include #include diff --git a/components/bootloader_support/src/flash_qio_mode.c b/components/bootloader_support/src/flash_qio_mode.c index 571515b5..ee4f609c 100644 --- a/components/bootloader_support/src/flash_qio_mode.c +++ b/components/bootloader_support/src/flash_qio_mode.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include #include diff --git a/components/bootloader_support/src/secure_boot.c b/components/bootloader_support/src/secure_boot.c index 8eb26ec5..79f4f8aa 100644 --- a/components/bootloader_support/src/secure_boot.c +++ b/components/bootloader_support/src/secure_boot.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include diff --git a/components/bootloader_support/src/secure_boot_signatures.c b/components/bootloader_support/src/secure_boot_signatures.c index 4a216a36..d0ccd13d 100644 --- a/components/bootloader_support/src/secure_boot_signatures.c +++ b/components/bootloader_support/src/secure_boot_signatures.c @@ -13,7 +13,7 @@ // limitations under the License. #include "sdkconfig.h" -#ifdef CONFIG_TARGET_PLATFORM_ESP32 +#ifdef CONFIG_IDF_TARGET_ESP32 #include "bootloader_flash.h" #include "bootloader_sha.h" diff --git a/components/esp8266/Kconfig b/components/esp8266/Kconfig index 1427e193..dd0a50a4 100644 --- a/components/esp8266/Kconfig +++ b/components/esp8266/Kconfig @@ -216,7 +216,7 @@ endchoice config ESP8266_OTA_FROM_OLD bool "(**Expected**)ESP8266 update from old SDK by OTA" default n - depends on TARGET_PLATFORM_ESP8266 + depends on IDF_TARGET_ESP8266 select ESP8266_BOOT_COPY_APP help The function is not released.