From 39bf05467ae1c1c86bf0b1a98164c6be11e4f4a2 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Mon, 17 May 2021 14:43:40 +0700 Subject: [PATCH 1/9] tools: fix parsing regex --- tools/tools.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tools.json b/tools/tools.json index b969b6cbe2..8d72452e4c 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -17,7 +17,7 @@ "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": [ { @@ -73,7 +73,7 @@ "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": [ { @@ -129,7 +129,7 @@ "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": [ { From e7b70a2f44c94c1a7036b68df69c3bc2050e9d0c Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Tue, 18 May 2021 11:37:21 +0700 Subject: [PATCH 2/9] hal: fix ee.get_gpio_in command for esp32-s3 --- components/hal/esp32s3/include/hal/cpu_ll.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hal/esp32s3/include/hal/cpu_ll.h b/components/hal/esp32s3/include/hal/cpu_ll.h index ea50870f93..8445fdf44c 100644 --- a/components/hal/esp32s3/include/hal/cpu_ll.h +++ b/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; } From 29b8f3b7193c9003d278e65110985583cafa8450 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Tue, 18 May 2021 11:54:38 +0700 Subject: [PATCH 3/9] newlib: Add ESP_ROM_HAS_RETARGETABLE_LOCKING capability for C3 and S3 chips --- components/esp_rom/CMakeLists.txt | 2 +- components/esp_rom/component.mk | 2 +- components/esp_rom/esp32c3/esp_rom_caps.h | 9 ++-- components/esp_rom/esp32s3/esp_rom_caps.h | 11 ++-- .../esp_rom/include/esp32c3/rom/libc_stubs.h | 15 +----- .../esp_rom/include/esp32s3/rom/libc_stubs.h | 51 ++++++++++--------- components/newlib/locks.c | 16 ++---- components/newlib/newlib_init.c | 3 +- components/newlib/test/test_newlib.c | 2 +- 9 files changed, 49 insertions(+), 62 deletions(-) diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index 38e502a204..667ab7f557 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/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, diff --git a/components/esp_rom/component.mk b/components/esp_rom/component.mk index 529abafdd2..4f53003366 100644 --- a/components/esp_rom/component.mk +++ b/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. diff --git a/components/esp_rom/esp32c3/esp_rom_caps.h b/components/esp_rom/esp32c3/esp_rom_caps.h index bae770da81..7c4226abe7 100644 --- a/components/esp_rom/esp32c3/esp_rom_caps.h +++ b/components/esp_rom/esp32c3/esp_rom_caps.h @@ -14,7 +14,8 @@ #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_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_HAS_RETARGETABLE_LOCKING (1) // ROM was built with retargetable locking diff --git a/components/esp_rom/esp32s3/esp_rom_caps.h b/components/esp_rom/esp32s3/esp_rom_caps.h index aee488a025..7a235e4e98 100644 --- a/components/esp_rom/esp32s3/esp_rom_caps.h +++ b/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 diff --git a/components/esp_rom/include/esp32c3/rom/libc_stubs.h b/components/esp_rom/include/esp32c3/rom/libc_stubs.h index df78851c1b..233355e9c2 100644 --- a/components/esp_rom/include/esp32c3/rom/libc_stubs.h +++ b/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)); diff --git a/components/esp_rom/include/esp32s3/rom/libc_stubs.h b/components/esp_rom/include/esp32s3/rom/libc_stubs.h index 9c9b0a21cd..1298eeda55 100644 --- a/components/esp_rom/include/esp32s3/rom/libc_stubs.h +++ b/components/esp_rom/include/esp32s3/rom/libc_stubs.h @@ -14,6 +14,7 @@ #pragma once +#include #include #include #include @@ -39,23 +40,24 @@ extern "C" { * to actual implementations of corresponding syscalls. * */ -struct syscall_stub_table { - struct _reent *(*__getreent)(void); - void *(*_malloc_r)(struct _reent *r, size_t); - void (*_free_r)(struct _reent *r, void *); - void *(*_realloc_r)(struct _reent *r, void *, size_t); - void *(*_calloc_r)(struct _reent *r, size_t, size_t); +struct syscall_stub_table +{ + struct _reent* (*__getreent)(void); + void* (*_malloc_r)(struct _reent *r, size_t); + void (*_free_r)(struct _reent *r, void*); + void* (*_realloc_r)(struct _reent *r, void*, size_t); + void* (*_calloc_r)(struct _reent *r, size_t, size_t); void (*_abort)(void); - int (*_system_r)(struct _reent *r, const char *); - int (*_rename_r)(struct _reent *r, const char *, const char *); + int (*_system_r)(struct _reent *r, const char*); + int (*_rename_r)(struct _reent *r, const char*, const char*); clock_t (*_times_r)(struct _reent *r, struct tms *); int (*_gettimeofday_r) (struct _reent *r, struct timeval *, void *); void (*_raise_r)(struct _reent *r); - int (*_unlink_r)(struct _reent *r, const char *); - int (*_link_r)(struct _reent *r, const char *, const char *); - int (*_stat_r)(struct _reent *r, const char *, struct stat *); + int (*_unlink_r)(struct _reent *r, const char*); + int (*_link_r)(struct _reent *r, const char*, const char*); + int (*_stat_r)(struct _reent *r, const char*, struct stat *); int (*_fstat_r)(struct _reent *r, int, struct stat *); - void *(*_sbrk_r)(struct _reent *r, ptrdiff_t); + void* (*_sbrk_r)(struct _reent *r, ptrdiff_t); int (*_getpid_r)(struct _reent *r); int (*_kill_r)(struct _reent *r, int, int); void (*_exit_r)(struct _reent *r, int); @@ -64,18 +66,21 @@ 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); - 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); - int (*_printf_float)(struct _reent *data, void *pdata, FILE *fp, int (*pfunc) (struct _reent *, FILE *, const char *, size_t len), va_list *ap); + void (*_retarget_lock_init)(_LOCK_T *lock); + void (*_retarget_lock_init_recursive)(_LOCK_T *lock); + void (*_retarget_lock_close)(_LOCK_T lock); + void (*_retarget_lock_close_recursive)(_LOCK_T lock); + void (*_retarget_lock_acquire)(_LOCK_T lock); + void (*_retarget_lock_acquire_recursive)(_LOCK_T lock); + int (*_retarget_lock_try_acquire)(_LOCK_T lock); + int (*_retarget_lock_try_acquire_recursive)(_LOCK_T lock); + void (*_retarget_lock_release)(_LOCK_T lock); + void (*_retarget_lock_release_recursive)(_LOCK_T lock); + 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)); + void (*__sinit) (struct _reent *r); + void (*_cleanup_r) (struct _reent* r); }; extern struct syscall_stub_table *syscall_table_ptr; diff --git a/components/newlib/locks.c b/components/newlib/locks.c index 86c8433767..882ea8dd0c 100644 --- a/components/newlib/locks.c +++ b/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 diff --git a/components/newlib/newlib_init.c b/components/newlib/newlib_init.c index 24ef68e737..7f95b49885 100644 --- a/components/newlib/newlib_init.c +++ b/components/newlib/newlib_init.c @@ -26,6 +26,7 @@ #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" @@ -81,7 +82,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, diff --git a/components/newlib/test/test_newlib.c b/components/newlib/test/test_newlib.c index 552c0939ef..6851ce1eb5 100644 --- a/components/newlib/test/test_newlib.c +++ b/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)); From 166281238f70bf2b299241f2d4401e6f6f180ef2 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Fri, 21 May 2021 14:44:41 +0800 Subject: [PATCH 4/9] make build system: fix ar warning --- make/project.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/project.mk b/make/project.mk index e7fc7257aa..b64012db68 100644 --- a/make/project.mk +++ b/make/project.mk @@ -512,7 +512,7 @@ CXXFLAGS += -fno-rtti LDFLAGS += -fno-rtti endif -ARFLAGS := cru +ARFLAGS := cr export CFLAGS CPPFLAGS CXXFLAGS ARFLAGS From 12e882632b72a3bad071712d3b04c873819599a3 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Fri, 21 May 2021 14:45:50 +0800 Subject: [PATCH 5/9] make build system: fix build for undefined _lock_* funcs --- components/bootloader/subproject/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/bootloader/subproject/Makefile b/components/bootloader/subproject/Makefile index 6acc7bd29b..5db762b78f 100644 --- a/components/bootloader/subproject/Makefile +++ b/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. From b6c91daa683876b89610d3e77a936af57f69d694 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 3 Jun 2021 12:09:52 +0700 Subject: [PATCH 6/9] Update toolchains to esp-2021r1 Adds ESP32-C3 support Updates ESP32-S3 overlay GDB 9.2 for ESP32-C3 with core dump support Linker supports eh-frame-hdr for ESP32-C3 Newlib 3.3.0 includes fixes for funcs, for overflow when TZ calculating, for malloc checks Binutils 2.35.1 Closes https://github.com/espressif/esp-idf/issues/6795 --- tools/test_idf_tools/test_idf_tools.py | 4 +- tools/toolchain_versions.mk | 6 +- tools/tools.json | 151 +++++++++--------- .../windows/windows_install_prerequisites.sh | 2 +- 4 files changed, 84 insertions(+), 79 deletions(-) diff --git a/tools/test_idf_tools/test_idf_tools.py b/tools/test_idf_tools/test_idf_tools.py index edff2b7de6..c054aec384 100755 --- a/tools/test_idf_tools/test_idf_tools.py +++ b/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) diff --git a/tools/toolchain_versions.mk b/tools/toolchain_versions.mk index 3490405018..1f2f64ec15 100644 --- a/tools/toolchain_versions.mk +++ b/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 diff --git a/tools/tools.json b/tools/tools.json index 8d72452e4c..783861f19b 100644 --- a/tools/tools.json +++ b/tools/tools.json @@ -22,36 +22,36 @@ "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" } } ] @@ -78,36 +78,36 @@ "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" } } ] @@ -134,36 +134,36 @@ "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" } } ] diff --git a/tools/windows/windows_install_prerequisites.sh b/tools/windows/windows_install_prerequisites.sh index 5876227ac5..5a5faebe1f 100644 --- a/tools/windows/windows_install_prerequisites.sh +++ b/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} From 99115d7e52d5667567c90d31c07e5c74a0923cc7 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 3 Jun 2021 12:09:52 +0700 Subject: [PATCH 7/9] ci: fix test_build_system* fails --- components/newlib/newlib_init.c | 2 +- components/nvs_flash/src/nvs_api.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/newlib/newlib_init.c b/components/newlib/newlib_init.c index 7f95b49885..4fdc06dfcf 100644 --- a/components/newlib/newlib_init.c +++ b/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 #include #include @@ -24,7 +25,6 @@ #include #include "esp_newlib.h" #include "esp_attr.h" -#include "sdkconfig.h" #include "soc/soc_caps.h" #include "esp_rom_caps.h" diff --git a/components/nvs_flash/src/nvs_api.cpp b/components/nvs_flash/src/nvs_api.cpp index 3a2a3495b6..fe58ccd2c1 100644 --- a/components/nvs_flash/src/nvs_api.cpp +++ b/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 #include "nvs_handle_simple.hpp" #include "esp_err.h" From 18e7da028502b43ef58830dcb7555a317816c874 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Sat, 5 Jun 2021 15:59:42 +0700 Subject: [PATCH 8/9] ci: add debug artifacts for test_idf_tools --- tools/ci/config/host-test.yml | 5 +++++ tools/test_idf_tools/test_idf_tools.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/ci/config/host-test.yml b/tools/ci/config/host-test.yml index 6a443462ec..538f3d3611 100644 --- a/tools/ci/config/host-test.yml +++ b/tools/ci/config/host-test.yml @@ -186,6 +186,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%:}) diff --git a/tools/test_idf_tools/test_idf_tools.py b/tools/test_idf_tools/test_idf_tools.py index c054aec384..c6b3e56ff1 100755 --- a/tools/test_idf_tools/test_idf_tools.py +++ b/tools/test_idf_tools/test_idf_tools.py @@ -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__': From 236524239168f939fafd74054f8d336f03745f9e Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 10 Jun 2021 14:46:40 +0700 Subject: [PATCH 9/9] tools: stop building if compiler is unsupported --- tools/cmake/crosstool_version_check.cmake | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/cmake/crosstool_version_check.cmake b/tools/cmake/crosstool_version_check.cmake index 93b77d55eb..5f8aeaa116 100644 --- a/tools/cmake/crosstool_version_check.cmake +++ b/tools/cmake/crosstool_version_check.cmake @@ -1,11 +1,11 @@ # Function to check the toolchain used the expected version # of crosstool, and warn otherwise -set(ctng_version_warning "Check Getting Started documentation or proceed at own risk.") +set(ctng_version_warning "Check Getting Started documentation or proceed at own risk.\n") function(gcc_version_check expected_gcc_version) if(NOT "${CMAKE_C_COMPILER_VERSION}" STREQUAL "${expected_gcc_version}") - message(WARNING "Xtensa toolchain ${CMAKE_C_COMPILER} version ${CMAKE_C_COMPILER_VERSION} " + message(WARNING "Toolchain ${CMAKE_C_COMPILER} version ${CMAKE_C_COMPILER_VERSION} " "is not the supported version ${expected_gcc_version}. ${ctng_version_warning}") endif() endfunction() @@ -22,11 +22,20 @@ function(crosstool_version_check expected_ctng_version) # the expected version string. string(FIND "${ctng_version}" "${expected_ctng_version}" found_expected_version) if(NOT ctng_version) - message(WARNING "Xtensa toolchain ${CMAKE_C_COMPILER} does not appear to be built with crosstool-ng. " + message(WARNING "Toolchain ${CMAKE_C_COMPILER} does not appear to be built with crosstool-ng. " "${ctng_version_warning}") elseif(found_expected_version EQUAL -1) - message(WARNING "Xtensa toolchain ${CMAKE_C_COMPILER} crosstool-ng version ${ctng_version} " - "doesn't match supported version ${expected_ctng_version}. ${ctng_version_warning}") + set(wrong_compiler_msg "\nToolchain: ${CMAKE_C_COMPILER}, " + "crosstool-ng version ${ctng_version} doesn't match supported version ${expected_ctng_version}" + "\nPlease try to run 'idf.py fullclean' to solve it quickly.\n") + set(IDF_MAINTAINER $ENV{IDF_MAINTAINER}) + if(IDF_MAINTAINER) + message(WARNING ${wrong_compiler_msg} ${ctng_version_warning}) + else() + set(ctng_version_error "Check Getting Started documentation if the error continues." + "\nYou can override this error and proceed with build by defining the IDF_MAINTAINER environment variable.\n") + message(FATAL_ERROR ${wrong_compiler_msg} ${ctng_version_error}) + endif() endif() endfunction()