فهرست منبع

Merge branch 'feature/toolchain_2021r1' into 'master'

Bring 2021r1 toolchains

Closes IDFGH-5009

See merge request espressif/esp-idf!13554
Angus Gratton 4 سال پیش
والد
کامیت
bc4eb2071c

+ 5 - 0
.gitlab/ci/host-test.yml

@@ -180,6 +180,11 @@ test_idf_py:
 
 test_idf_tools:
   extends: .host_test_template
+  artifacts:
+    when: on_failure
+    paths:
+      - tools/tools.new.json
+    expire_in: 1 week
   script:
     # Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
     - export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})

+ 2 - 1
components/bootloader/subproject/Makefile

@@ -14,9 +14,10 @@ COMPONENTS := esp_hw_support esptool_py bootloader_support log spi_flash micro-e
 CFLAGS =
 CXXFLAGS =
 
-#We cannot include the idf_target, esp_common component directly but we need their includes.
+#We cannot include the some components like idf_target, esp_common directly but we need their includes.
 CFLAGS += -I $(IDF_PATH)/components/$(IDF_TARGET)/include
 CFLAGS += -I $(IDF_PATH)/components/esp_common/include
+CFLAGS += -I $(IDF_PATH)/components/newlib/platform_include
 CFLAGS += -I $(IDF_PATH)/components/xtensa/include -I $(IDF_PATH)/components/xtensa/$(IDF_TARGET)/include
 
 # The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.

+ 1 - 0
components/esp_hw_support/esp_clk.c

@@ -14,6 +14,7 @@
 
 #include <stdint.h>
 #include <sys/param.h>
+#include <sys/lock.h>
 
 #include "esp_attr.h"
 #include "soc/rtc.h"

+ 1 - 1
components/esp_rom/CMakeLists.txt

@@ -9,7 +9,7 @@ if(CONFIG_IDF_TARGET_ARCH_XTENSA)
 endif()
 
 idf_component_register(SRCS ${sources}
-                       INCLUDE_DIRS include "${target}"
+                       INCLUDE_DIRS include "${target}" "include/${target}"
                        PRIV_REQUIRES soc hal)
 
 # Append a target linker script at the target-specific path,

+ 1 - 1
components/esp_rom/component.mk

@@ -1,4 +1,4 @@
-COMPONENT_ADD_INCLUDEDIRS := include esp32
+COMPONENT_ADD_INCLUDEDIRS := include esp32 include/esp32
 COMPONENT_SRCDIRS := patches .
 
 #Linker scripts used to link the final application.

+ 6 - 5
components/esp_rom/esp32c3/esp_rom_caps.h

@@ -14,8 +14,9 @@
 
 #pragma once
 
-#define ESP_ROM_HAS_CRC_LE       (1) // ROM CRC library supports Little Endian
-#define ESP_ROM_HAS_CRC_BE       (1) // ROM CRC library supports Big Endian
-#define ESP_ROM_HAS_JPEG_DECODE  (1) // ROM has JPEG decode library
-#define ESP_ROM_UART_CLK_IS_XTAL (1) // UART clock source is selected to XTAL in ROM
-#define ESP_ROM_USB_SERIAL_DEVICE_NUM (3) // UART uses USB_SERIAL_JTAG port in ROM.
+#define ESP_ROM_HAS_CRC_LE                  (1) // ROM CRC library supports Little Endian
+#define ESP_ROM_HAS_CRC_BE                  (1) // ROM CRC library supports Big Endian
+#define ESP_ROM_HAS_JPEG_DECODE             (1) // ROM has JPEG decode library
+#define ESP_ROM_UART_CLK_IS_XTAL            (1) // UART clock source is selected to XTAL in ROM
+#define ESP_ROM_USB_SERIAL_DEVICE_NUM       (3) // UART uses USB_SERIAL_JTAG port in ROM.
+#define ESP_ROM_HAS_RETARGETABLE_LOCKING    (1) // ROM was built with retargetable locking

+ 6 - 5
components/esp_rom/esp32s3/esp_rom_caps.h

@@ -14,8 +14,9 @@
 
 #pragma once
 
-#define ESP_ROM_HAS_CRC_LE            (1) // ROM CRC library supports Little Endian
-#define ESP_ROM_HAS_CRC_BE            (1) // ROM CRC library supports Big Endian
-#define ESP_ROM_HAS_JPEG_DECODE       (1) // ROM has JPEG decode library
-#define ESP_ROM_SUPPORT_MULTIPLE_UART (1) // ROM has multiple UARTs available for logging
-#define ESP_ROM_UART_CLK_IS_XTAL      (1) // UART clock source is selected to XTAL in ROM
+#define ESP_ROM_HAS_CRC_LE                  (1) // ROM CRC library supports Little Endian
+#define ESP_ROM_HAS_CRC_BE                  (1) // ROM CRC library supports Big Endian
+#define ESP_ROM_HAS_JPEG_DECODE             (1) // ROM has JPEG decode library
+#define ESP_ROM_SUPPORT_MULTIPLE_UART       (1) // ROM has multiple UARTs available for logging
+#define ESP_ROM_UART_CLK_IS_XTAL            (1) // UART clock source is selected to XTAL in ROM
+#define ESP_ROM_HAS_RETARGETABLE_LOCKING    (1) // ROM was built with retargetable locking

+ 1 - 14
components/esp_rom/include/esp32c3/rom/libc_stubs.h

@@ -27,7 +27,7 @@ extern "C" {
 #endif
 
 /*
-ESP32 ROM code contains implementations of some of C library functions.
+ESP32-C3 ROM code contains implementations of some of C library functions.
 Whenever a function in ROM needs to use a syscall, it calls a pointer to the corresponding syscall
 implementation defined in the following struct.
 
@@ -65,7 +65,6 @@ struct syscall_stub_table
     int (*_write_r)(struct _reent *r, int, const void *, int);
     int (*_lseek_r)(struct _reent *r, int, int, int);
     int (*_read_r)(struct _reent *r, int, void *, int);
-#ifdef _RETARGETABLE_LOCKING
     void (*_retarget_lock_init)(_LOCK_T *lock);
     void (*_retarget_lock_init_recursive)(_LOCK_T *lock);
     void (*_retarget_lock_close)(_LOCK_T lock);
@@ -76,18 +75,6 @@ struct syscall_stub_table
     int (*_retarget_lock_try_acquire_recursive)(_LOCK_T lock);
     void (*_retarget_lock_release)(_LOCK_T lock);
     void (*_retarget_lock_release_recursive)(_LOCK_T lock);
-#else
-    void (*_lock_init)(_lock_t *lock);
-    void (*_lock_init_recursive)(_lock_t *lock);
-    void (*_lock_close)(_lock_t *lock);
-    void (*_lock_close_recursive)(_lock_t *lock);
-    void (*_lock_acquire)(_lock_t *lock);
-    void (*_lock_acquire_recursive)(_lock_t *lock);
-    int (*_lock_try_acquire)(_lock_t *lock);
-    int (*_lock_try_acquire_recursive)(_lock_t *lock);
-    void (*_lock_release)(_lock_t *lock);
-    void (*_lock_release_recursive)(_lock_t *lock);
-#endif
     int (*_printf_float)(struct _reent *data, void *pdata, FILE * fp, int (*pfunc) (struct _reent *, FILE *, const char *, size_t len), va_list * ap);
     int (*_scanf_float) (struct _reent *rptr, void *pdata, FILE *fp, va_list *ap);
     void (*__assert_func) (const char *file, int line, const char * func, const char *failedexpr) __attribute__((noreturn));

+ 1 - 13
components/esp_rom/include/esp32s3/rom/libc_stubs.h

@@ -14,6 +14,7 @@
 
 #pragma once
 
+#include <sys/lock.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -65,7 +66,6 @@ struct syscall_stub_table
     int (*_write_r)(struct _reent *r, int, const void *, int);
     int (*_lseek_r)(struct _reent *r, int, int, int);
     int (*_read_r)(struct _reent *r, int, void *, int);
-#ifdef _RETARGETABLE_LOCKING
     void (*_retarget_lock_init)(_LOCK_T *lock);
     void (*_retarget_lock_init_recursive)(_LOCK_T *lock);
     void (*_retarget_lock_close)(_LOCK_T lock);
@@ -76,18 +76,6 @@ struct syscall_stub_table
     int (*_retarget_lock_try_acquire_recursive)(_LOCK_T lock);
     void (*_retarget_lock_release)(_LOCK_T lock);
     void (*_retarget_lock_release_recursive)(_LOCK_T lock);
-#else
-    void (*_lock_init)(_lock_t *lock);
-    void (*_lock_init_recursive)(_lock_t *lock);
-    void (*_lock_close)(_lock_t *lock);
-    void (*_lock_close_recursive)(_lock_t *lock);
-    void (*_lock_acquire)(_lock_t *lock);
-    void (*_lock_acquire_recursive)(_lock_t *lock);
-    int (*_lock_try_acquire)(_lock_t *lock);
-    int (*_lock_try_acquire_recursive)(_lock_t *lock);
-    void (*_lock_release)(_lock_t *lock);
-    void (*_lock_release_recursive)(_lock_t *lock);
-#endif
     int (*_printf_float)(struct _reent *data, void *pdata, FILE * fp, int (*pfunc) (struct _reent *, FILE *, const char *, size_t len), va_list * ap);
     int (*_scanf_float) (struct _reent *rptr, void *pdata, FILE *fp, va_list *ap);
     void (*__assert_func) (const char *file, int line, const char * func, const char *failedexpr) __attribute__((noreturn));

+ 1 - 1
components/hal/esp32s3/include/hal/cpu_ll.h

@@ -185,7 +185,7 @@ static inline void cpu_ll_waiti(void)
 static inline uint32_t cpu_ll_read_dedic_gpio_in(void)
 {
     uint32_t value = 0;
-    asm volatile("get_gpio_in %0" : "=r"(value) : :);
+    asm volatile("ee.get_gpio_in %0" : "=r"(value) : :);
     return value;
 }
 

+ 4 - 12
components/newlib/locks.c

@@ -21,6 +21,7 @@
 #include "freertos/semphr.h"
 #include "freertos/task.h"
 #include "freertos/portable.h"
+#include "esp_rom_caps.h"
 
 /* Notes on our newlib lock implementation:
  *
@@ -210,7 +211,6 @@ void IRAM_ATTR _lock_release_recursive(_lock_t *lock) {
     lock_release_generic(lock, queueQUEUE_TYPE_RECURSIVE_MUTEX);
 }
 
-#ifdef _RETARGETABLE_LOCKING
 /* To ease the transition to newlib 3.3.0, this part is kept under an ifdef.
  * After the toolchain with newlib 3.3.0 is released and merged, the ifdefs
  * can be removed.
@@ -252,8 +252,8 @@ static StaticSemaphore_t s_common_mutex;
 static StaticSemaphore_t s_common_recursive_mutex;
 
 
-#ifdef CONFIG_IDF_TARGET_ESP32C3
-/* C3 ROM is built without Newlib static lock symbols exported, and
+#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
+/* C3 and S3 ROMs are built without Newlib static lock symbols exported, and
  * with an extra level of _LOCK_T indirection in mind.
  * The following is a workaround for this:
  * - on startup, we call esp_rom_newlib_init_common_mutexes to set
@@ -267,7 +267,7 @@ static StaticSemaphore_t s_common_recursive_mutex;
  */
 
 #define ROM_NEEDS_MUTEX_OVERRIDE
-#endif // CONFIG_IDF_TARGET_ESP32C3
+#endif // defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
 
 #ifdef ROM_NEEDS_MUTEX_OVERRIDE
 #define ROM_MUTEX_MAGIC  0xbb10c433
@@ -407,11 +407,3 @@ void esp_newlib_locks_init(void)
 #error Unsupported target
 #endif
 }
-
-#else  // _RETARGETABLE_LOCKING
-
-void esp_newlib_locks_init(void)
-{
-}
-
-#endif // _RETARGETABLE_LOCKING

+ 3 - 2
components/newlib/newlib_init.c

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "sdkconfig.h"
 #include <string.h>
 #include <stdbool.h>
 #include <unistd.h>
@@ -25,8 +26,8 @@
 #include <assert.h>
 #include "esp_newlib.h"
 #include "esp_attr.h"
-#include "sdkconfig.h"
 #include "soc/soc_caps.h"
+#include "esp_rom_caps.h"
 
 #if CONFIG_IDF_TARGET_ESP32
 #include "esp32/rom/libc_stubs.h"
@@ -82,7 +83,7 @@ static struct syscall_stub_table s_stub_table = {
     ._write_r = (int (*)(struct _reent *r, int, const void *, int)) &_write_r,
     ._lseek_r = (int (*)(struct _reent *r, int, int, int)) &_lseek_r,
     ._read_r = (int (*)(struct _reent *r, int, void *, int)) &_read_r,
-#if _RETARGETABLE_LOCKING /* TODO: only if RETARGETABLE LOCKING IS IN ROM */
+#if ESP_ROM_HAS_RETARGETABLE_LOCKING
     ._retarget_lock_init = &__retarget_lock_init,
     ._retarget_lock_init_recursive = &__retarget_lock_init_recursive,
     ._retarget_lock_close = &__retarget_lock_close,

+ 1 - 1
components/newlib/test/test_newlib.c

@@ -141,7 +141,7 @@ TEST_CASE("check if ROM or Flash is used for functions", "[newlib]")
 #if defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_SPIRAM)
     TEST_ASSERT(fn_in_rom(atoi));
     TEST_ASSERT(fn_in_rom(strtol));
-#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C3)
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
     /* S3 and C3 always use these from ROM */
     TEST_ASSERT(fn_in_rom(atoi));
     TEST_ASSERT(fn_in_rom(strtol));

+ 1 - 1
components/nvs_flash/src/nvs_api.cpp

@@ -11,6 +11,7 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
+#include "sdkconfig.h"
 #include "nvs.hpp"
 #include "nvs_flash.h"
 #include "nvs_storage.hpp"
@@ -18,7 +19,6 @@
 #include "nvs_platform.hpp"
 #include "nvs_partition_manager.hpp"
 #include "esp_partition.h"
-#include "sdkconfig.h"
 #include <functional>
 #include "nvs_handle_simple.hpp"
 #include "esp_err.h"

+ 1 - 1
make/project.mk

@@ -519,7 +519,7 @@ CXXFLAGS += -fno-rtti
 LDFLAGS += -fno-rtti
 endif
 
-ARFLAGS := cru
+ARFLAGS := cr
 
 export CFLAGS CPPFLAGS CXXFLAGS ARFLAGS
 

+ 0 - 1
tools/ci/mypy_ignore_list.txt

@@ -224,7 +224,6 @@ tools/find_build_apps/make.py
 tools/gdb_panic_server.py
 tools/gen_esp_err_to_name.py
 tools/idf.py
-tools/idf_py_actions/constants.py
 tools/idf_py_actions/core_ext.py
 tools/idf_py_actions/create_ext.py
 tools/idf_py_actions/debug_ext.py

+ 2 - 2
tools/idf_py_actions/constants.py

@@ -36,6 +36,6 @@ GENERATORS = collections.OrderedDict([
     })
 ])
 
-SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3']
+SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3']
 
-PREVIEW_TARGETS = ['esp32s3', 'linux']
+PREVIEW_TARGETS = ['linux']

+ 3 - 3
tools/test_idf_tools/test_idf_tools.py

@@ -25,7 +25,7 @@ try:
 except ImportError:
     import contextlib
 
-    @contextlib.contextmanager
+    @contextlib.contextmanager  # type: ignore
     def redirect_stdout(target):
         original = sys.stdout
         sys.stdout = target
@@ -72,7 +72,7 @@ class TestUsage(unittest.TestCase):
             idf_tools.main(['list'])
         output = output_stream.getvalue()
 
-        xtensa_esp32_elf_version = 'esp-2020r3-8.4.0'
+        xtensa_esp32_elf_version = 'esp-2021r1-8.4.0'
         esp32ulp_version = '2.28.51-esp-20191205'
 
         self.assertIn('* xtensa-esp32-elf:', output)
@@ -124,7 +124,7 @@ class TestMaintainer(unittest.TestCase):
             json_old = f.read()
         with open(os.path.join(idf_path, 'tools/tools.new.json'), 'r') as f:
             json_new = f.read()
-        self.assertEqual(json_old, json_new)
+        self.assertEqual(json_old, json_new, "Please check 'tools/tools.new.json' to find a cause!")
 
 
 if __name__ == '__main__':

+ 3 - 3
tools/toolchain_versions.mk

@@ -1,6 +1,6 @@
-SUPPORTED_TOOLCHAIN_COMMIT_DESC = esp-2020r3
+SUPPORTED_TOOLCHAIN_COMMIT_DESC = esp-2021r1
 SUPPORTED_TOOLCHAIN_GCC_VERSIONS = 8.4.0
 
-CURRENT_TOOLCHAIN_COMMIT_DESC = esp-2020r3
-CURRENT_TOOLCHAIN_COMMIT_DESC_SHORT = esp-2020r3
+CURRENT_TOOLCHAIN_COMMIT_DESC = esp-2021r1
+CURRENT_TOOLCHAIN_COMMIT_DESC_SHORT = esp-2021r1
 CURRENT_TOOLCHAIN_GCC_VERSION = 8.4.0

+ 81 - 76
tools/tools.json

@@ -17,41 +17,41 @@
         "xtensa-esp32-elf-gcc",
         "--version"
       ],
-      "version_regex": "\\(crosstool-NG\\s+(?:crosstool-ng-)?([0-9a-zA-Z\\.\\-]+)\\)\\s*([0-9\\.]+)",
+      "version_regex": "\\(crosstool-NG\\s+(?:crosstool-ng-)?([0-9a-zA-Z\\.\\-_]+)\\)\\s*([0-9\\.]+)",
       "version_regex_replace": "\\1-\\2",
       "versions": [
         {
           "linux-amd64": {
-            "sha256": "674080a12f9c5ebe5a3a5ce51c6deaeffe6dfb06d6416233df86f25b574e9279",
-            "size": 85731226,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz"
+            "sha256": "44a0b467b9d2b759ab48b2f27aed684581f33c96e2842992781c4e045992c5b0",
+            "size": 86361217,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz"
           },
           "linux-armel": {
-            "sha256": "6771e011dffa2438ef84ff3474538b4a69df8f9d4cfae3b3707ca31c782ed7db",
-            "size": 83888892,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-armel.tar.gz"
+            "sha256": "fdacdb2a7bbf6293bcafda9b52463a4da8a2f3b7e1df9f83d35ff9d1efa22012",
+            "size": 84520407,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz"
           },
           "linux-i686": {
-            "sha256": "076b7e05304e26aa6ec105c9e0dc74addca079bc2cae6e42ee7575c5ded29877",
-            "size": 87715092,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz"
+            "sha256": "e2024096492dfaa50fc6ac336cd8faa2e395e8cebb617753eab0b5f16d3dd0dc",
+            "size": 88375391,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz"
           },
           "macos": {
-            "sha256": "6845f786303b26c4a55ede57487ba65bd25737232fe6104be03f25bb62f4631c",
-            "size": 92424226,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-macos.tar.gz"
+            "sha256": "7bbc6a2b94f009cd8a3351b9c7acf7a5caa1c4d3700500ead60f84965386a61b",
+            "size": 93357296,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz"
           },
-          "name": "esp-2020r3-8.4.0",
+          "name": "esp-2021r1-8.4.0",
           "status": "recommended",
           "win32": {
-            "sha256": "81cecd5493a3fcf2118977f3fd60bd0a13a4aeac8fe6760d912f96d2c34fab66",
-            "size": 104226379,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-win32.zip"
+            "sha256": "e4f9fdda192abfc9807e3e7fcd6e9fea30c1a0cf3f3c5a5c961b5114fc8c9b7e",
+            "size": 105603626,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip"
           },
           "win64": {
-            "sha256": "58419852fefb7111fdec056ac2fd7c4bd09c1f4c17610a761a97b788413527cf",
-            "size": 106855139,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32-elf-gcc8_4_0-esp-2020r3-win64.zip"
+            "sha256": "f28f525f6554d72fcd60bdc67b6f095d6c022df6036c3c3166dace37d6ea10b3",
+            "size": 108318363,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win64.zip"
           }
         }
       ]
@@ -73,41 +73,41 @@
         "xtensa-esp32s2-elf-gcc",
         "--version"
       ],
-      "version_regex": "\\(crosstool-NG\\s+(?:crosstool-ng-)?([0-9a-zA-Z\\.\\-]+)\\)\\s*([0-9\\.]+)",
+      "version_regex": "\\(crosstool-NG\\s+(?:crosstool-ng-)?([0-9a-zA-Z\\.\\-_]+)\\)\\s*([0-9\\.]+)",
       "version_regex_replace": "\\1-\\2",
       "versions": [
         {
           "linux-amd64": {
-            "sha256": "40fafa47045167feda0cd07827db5207ebfeb4a3b6b24475957a921bc92805ed",
-            "size": 86069526,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz"
+            "sha256": "b127baccfe6949ee7eaf3d0782ea772750a9b8e2732b16ce6bcc9dcd91f7209a",
+            "size": 86687290,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz"
           },
           "linux-armel": {
-            "sha256": "6c1efec4c7829202279388ccb388e8a17a34464bc351d677c4f04d95ea4b4ce0",
-            "size": 84254468,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-linux-armel.tar.gz"
+            "sha256": "7ca0d240f11e1c53c01a56257b0c968f876ab405142d1068d8c9b456d939554c",
+            "size": 84916701,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz"
           },
           "linux-i686": {
-            "sha256": "bd3a91166206a1a7ff7c572e15389e1938c3cdce588032a5e915be677a945638",
-            "size": 88053499,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz"
+            "sha256": "9941f993ff84d1c606b45ffbeeb7bcdc5a72cf24e787bb9230390510fe3511c6",
+            "size": 88699953,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz"
           },
           "macos": {
-            "sha256": "fe19b0c873879d8d89ec040f4db04a3ab27d769d3fd5f55fe59a28b6b111d09c",
-            "size": 92817351,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-macos.tar.gz"
+            "sha256": "4b55b1a9ca7fc945be6fc3513802b6cece9264bee4cbca76013569cec2695973",
+            "size": 93757895,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz"
           },
-          "name": "esp-2020r3-8.4.0",
+          "name": "esp-2021r1-8.4.0",
           "status": "recommended",
           "win32": {
-            "sha256": "d078d614ae864ae4a37fcb5b83323af0a5cfdbd8243607664becdd0f977a1e33",
-            "size": 104659541,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-win32.zip"
+            "sha256": "c94ec1e45c81b7e4944d216bab4aa41d46849768d7761fd691661dab1a3df828",
+            "size": 106013515,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip"
           },
           "win64": {
-            "sha256": "6ea78b72ec52330b69af91dbe6c77c22bdc827817f044aa30306270453032bb4",
-            "size": 107228353,
-            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2020r3/xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-win64.zip"
+            "sha256": "2a2a04e45a7dfe93356a2329162f7d013f06e3125fd7fc08a50e3bd5f4110300",
+            "size": 108698715,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win64.zip"
           }
         }
       ]
@@ -129,41 +129,41 @@
         "xtensa-esp32s3-elf-gcc",
         "--version"
       ],
-      "version_regex": "\\(crosstool-NG\\s+(?:crosstool-ng-)?([0-9a-zA-Z\\.\\-]+)\\)\\s*([0-9\\.]+)",
+      "version_regex": "\\(crosstool-NG\\s+(?:crosstool-ng-)?([0-9a-zA-Z\\.\\-_]+)\\)\\s*([0-9\\.]+)",
       "version_regex_replace": "\\1-\\2",
       "versions": [
         {
           "linux-amd64": {
-            "sha256": "22bf5e63baf3f3f5103ae21bcc35d80cd888d8032095e7b9e8f9631074ac462a",
-            "size": 86029457,
-            "url": "https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz"
+            "sha256": "36e3a1bc48d9866d1ad9a7fc7d12381604b85fb311b7780a847d63ac8444dd04",
+            "size": 86699731,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz"
           },
           "linux-armel": {
-            "sha256": "27f423af3cfb9d8ed7a02173ccd8dc3b0fd3b3e76a92e9ba507121e73bfa5df3",
-            "size": 84120606,
-            "url": "https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-linux-armel.tar.gz"
+            "sha256": "5108571286f8403cc06d951efdfa20e36ace9ee37bc19892cc1c04b52cc2fe83",
+            "size": 84778877,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz"
           },
           "linux-i686": {
-            "sha256": "479a71cfb4b0c0b36371a1aaed2e6095dfc3241937a54f60a1ba115da73ddec5",
-            "size": 88015798,
-            "url": "https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-linux-i686.tar.gz"
+            "sha256": "dc126b60f4492689d675f66a60a74c63e80ac5fbb345cf541c323a0a2592541d",
+            "size": 88720642,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz"
           },
           "macos": {
-            "sha256": "c09b8fcbb840540a3f59429b1bbfbe5abfcacccf7a8a955e4e01e3f50b53a079",
-            "size": 93013216,
-            "url": "https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-macos.tar.gz"
+            "sha256": "0887e2ff3ac20d36f6754e4f27a5e888b48db603e1026859f257f466e2569824",
+            "size": 94156313,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-macos.tar.gz"
           },
-          "name": "esp-2020r3-8.4.0",
+          "name": "esp-2021r1-8.4.0",
           "status": "recommended",
           "win32": {
-            "sha256": "9591fc32896b13d7fe77310afbbff197cbbc20437d316e0e2460c5c50a10d7b5",
-            "size": 104536285,
-            "url": "https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-win32.zip"
+            "sha256": "6fb1e5b6f9606052af545176616441e00fdff64314a97b29ce349f28e5bfbab3",
+            "size": 106006033,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-win32.zip"
           },
           "win64": {
-            "sha256": "1caf56e9588214d8f1bc17734680ebab2906da3b5f31095e60407dad170f1221",
-            "size": 107245907,
-            "url": "https://dl.espressif.com/dl/xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-win64.zip"
+            "sha256": "652305fc18ad653a32b00ac2de4af26c27a6c94ed39deaf09df21975a5957694",
+            "size": 108872018,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s3-elf-gcc8_4_0-esp-2021r1-win64.zip"
           }
         }
       ]
@@ -190,31 +190,36 @@
       "versions": [
         {
           "linux-amd64": {
-            "sha256": "425454c5c4e2cde5dd2dd3a1d398befc70addf71547840fb6d0ec4b307b08894",
-            "size": 152042971,
-            "url": "https://dl.espressif.com/dl/toolchains/preview/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-linux-amd64.tar.gz"
+            "sha256": "3459618f33bbd5f54d7d7783e807cb6eef6472a220f2f1eb3faced735b9d13bb",
+            "size": 152812483,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz"
           },
           "linux-armel": {
-            "sha256": "8ae098751b5196ca8a80d832cc9930bc4d639762a6cb22be3cfe0a8d71b2f230",
-            "size": 150801079,
-            "url": "https://dl.espressif.com/dl/toolchains/preview/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-linux-armel.tar.gz"
+            "sha256": "24b9e54b348bbd5fb816fc4c52abb47337c702beecdbba840750b7cfb9d38069",
+            "size": 151726623,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz"
+          },
+          "linux-i686": {
+            "sha256": "954d340ebffef12a2ce9be1ea004e6f45a8863f1e6f41f46fd3f04f58499627c",
+            "size": 155430963,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz"
           },
           "macos": {
-            "sha256": "35b1aef85b7e6b4268774f627e8e835d087bcf8b9972cfb6436614aa2e40d4a9",
-            "size": 158594401,
-            "url": "https://dl.espressif.com/dl/toolchains/preview/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-macos.tar.gz"
+            "sha256": "612fb3a3f84f703222327bd16581df8f80fda8cdf137637fe5d611587d1b664e",
+            "size": 159836199,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz"
           },
-          "name": "1.24.0.123_64eb9ff-8.4.0",
+          "name": "esp-2021r1-8.4.0",
           "status": "recommended",
           "win32": {
-            "sha256": "4f576b08620f57c270ac677cc94dce2767fff72d27a539e348d448f63b480d1f",
-            "size": 190014086,
-            "url": "https://dl.espressif.com/dl/toolchains/preview/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-win32.zip"
+            "sha256": "5711eb407ffe44adddbd1281b6b575a5645e7193ca78faefa27dc5bc5b662bec",
+            "size": 191266312,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip"
           },
           "win64": {
-            "sha256": "51e392ed88498f3fc4ad07e9ff4b5225f6533b1c363ecd7dd67c10d8d31b6b23",
-            "size": 191565525,
-            "url": "https://dl.espressif.com/dl/toolchains/preview/riscv32-esp-elf-gcc8_4_0-crosstool-ng-1.24.0-123-g64eb9ff-win64.zip"
+            "sha256": "be3c9ec364bd8e92924f922a4aec73136824f16e912e6a0b5cf5b30512f0ab96",
+            "size": 192799980,
+            "url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-win64.zip"
           }
         }
       ]

+ 1 - 1
tools/windows/windows_install_prerequisites.sh

@@ -42,7 +42,7 @@ if [ -n "$IDF_PATH" ]; then
 fi
 
 # Automatically download precompiled toolchain, unpack at /opt/xtensa-esp32-elf/
-TOOLCHAIN_ZIP=xtensa-esp32-elf-gcc8_4_0-esp-2020r3-win32.zip
+TOOLCHAIN_ZIP=xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip
 echo "Downloading precompiled toolchain ${TOOLCHAIN_ZIP}..."
 cd ~
 curl -LO --retry 10 https://dl.espressif.com/dl/${TOOLCHAIN_ZIP}