diff --git a/components/driver/test_apps/analog_comparator/CMakeLists.txt b/components/driver/test_apps/analog_comparator/CMakeLists.txt index 4da21a865e..ef4e64222d 100644 --- a/components/driver/test_apps/analog_comparator/CMakeLists.txt +++ b/components/driver/test_apps/analog_comparator/CMakeLists.txt @@ -10,7 +10,7 @@ project(test_ana_cmpr) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/test_ana_cmpr.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/dac_test_apps/dac/CMakeLists.txt b/components/driver/test_apps/dac_test_apps/dac/CMakeLists.txt index 82cd7773cf..71dad1881a 100644 --- a/components/driver/test_apps/dac_test_apps/dac/CMakeLists.txt +++ b/components/driver/test_apps/dac_test_apps/dac/CMakeLists.txt @@ -10,7 +10,7 @@ project(dac_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/dac_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/dac_test_apps/legacy_dac_driver/CMakeLists.txt b/components/driver/test_apps/dac_test_apps/legacy_dac_driver/CMakeLists.txt index e1d9d13991..2854a36c4d 100644 --- a/components/driver/test_apps/dac_test_apps/legacy_dac_driver/CMakeLists.txt +++ b/components/driver/test_apps/dac_test_apps/legacy_dac_driver/CMakeLists.txt @@ -10,7 +10,7 @@ project(dac_legacy_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/dac_legacy_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/gpio/CMakeLists.txt b/components/driver/test_apps/gpio/CMakeLists.txt index 22d3b5b082..7ba8cc2d2c 100644 --- a/components/driver/test_apps/gpio/CMakeLists.txt +++ b/components/driver/test_apps/gpio/CMakeLists.txt @@ -10,7 +10,7 @@ project(gpio_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/gpio_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/gpio_extensions/CMakeLists.txt b/components/driver/test_apps/gpio_extensions/CMakeLists.txt index 68baccb97d..42d10a8553 100644 --- a/components/driver/test_apps/gpio_extensions/CMakeLists.txt +++ b/components/driver/test_apps/gpio_extensions/CMakeLists.txt @@ -10,7 +10,7 @@ project(gpio_extension_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/gpio_extension_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/gptimer/CMakeLists.txt b/components/driver/test_apps/gptimer/CMakeLists.txt index 798b4e119d..50a85ed1dd 100644 --- a/components/driver/test_apps/gptimer/CMakeLists.txt +++ b/components/driver/test_apps/gptimer/CMakeLists.txt @@ -10,7 +10,7 @@ project(gptimer_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/gptimer_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/i2c/CMakeLists.txt b/components/driver/test_apps/i2c/CMakeLists.txt index 8c22385fec..ff8c38b0c5 100644 --- a/components/driver/test_apps/i2c/CMakeLists.txt +++ b/components/driver/test_apps/i2c/CMakeLists.txt @@ -14,7 +14,7 @@ project(i2c_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/i2c_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/i2s_test_apps/i2s/CMakeLists.txt b/components/driver/test_apps/i2s_test_apps/i2s/CMakeLists.txt index 80a6df372b..b65a90e79a 100644 --- a/components/driver/test_apps/i2s_test_apps/i2s/CMakeLists.txt +++ b/components/driver/test_apps/i2s_test_apps/i2s/CMakeLists.txt @@ -10,7 +10,7 @@ project(i2s_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/i2s_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/ledc/CMakeLists.txt b/components/driver/test_apps/ledc/CMakeLists.txt index a7906e6886..5d032f7d92 100644 --- a/components/driver/test_apps/ledc/CMakeLists.txt +++ b/components/driver/test_apps/ledc/CMakeLists.txt @@ -10,7 +10,7 @@ project(ledc_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/ledc_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/mcpwm/CMakeLists.txt b/components/driver/test_apps/mcpwm/CMakeLists.txt index 48dbb3dd5d..9e9a606d46 100644 --- a/components/driver/test_apps/mcpwm/CMakeLists.txt +++ b/components/driver/test_apps/mcpwm/CMakeLists.txt @@ -10,7 +10,7 @@ project(mcpwm_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/mcpwm_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/parlio/CMakeLists.txt b/components/driver/test_apps/parlio/CMakeLists.txt index 0fc1057a2b..66fa38dd6a 100644 --- a/components/driver/test_apps/parlio/CMakeLists.txt +++ b/components/driver/test_apps/parlio/CMakeLists.txt @@ -10,7 +10,7 @@ project(parlio_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/parlio_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/pulse_cnt/CMakeLists.txt b/components/driver/test_apps/pulse_cnt/CMakeLists.txt index bffa04830b..46dee2c382 100644 --- a/components/driver/test_apps/pulse_cnt/CMakeLists.txt +++ b/components/driver/test_apps/pulse_cnt/CMakeLists.txt @@ -10,7 +10,7 @@ project(pcnt_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/pcnt_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/rmt/CMakeLists.txt b/components/driver/test_apps/rmt/CMakeLists.txt index 2e90ca7052..4ad5bb6626 100644 --- a/components/driver/test_apps/rmt/CMakeLists.txt +++ b/components/driver/test_apps/rmt/CMakeLists.txt @@ -10,7 +10,7 @@ project(rmt_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/rmt_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/rmt/main/test_app_main.c b/components/driver/test_apps/rmt/main/test_app_main.c index 4ccc872d4c..308ead92b1 100644 --- a/components/driver/test_apps/rmt/main/test_app_main.c +++ b/components/driver/test_apps/rmt/main/test_app_main.c @@ -1,39 +1,27 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #include "unity.h" #include "unity_test_runner.h" +#include "unity_test_utils.h" #include "esp_heap_caps.h" // Some resources are lazy allocated in RMT driver, so we reserved this threadhold when checking memory leak // A better way to check a potential memory leak is running a same case by twice, for the second time, the memory usage delta should be zero -#define TEST_MEMORY_LEAK_THRESHOLD (-300) - -static size_t before_free_8bit; -static size_t before_free_32bit; - -static void check_leak(size_t before_free, size_t after_free, const char *type) -{ - ssize_t delta = after_free - before_free; - printf("MALLOC_CAP_%s: Before %u bytes free, After %u bytes free (delta %d)\n", type, before_free, after_free, delta); - TEST_ASSERT_MESSAGE(delta >= TEST_MEMORY_LEAK_THRESHOLD, "memory leak"); -} +#define TEST_MEMORY_LEAK_THRESHOLD (400) void setUp(void) { - before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); - before_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); + unity_utils_record_free_mem(); } void tearDown(void) { - size_t after_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); - size_t after_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); - check_leak(before_free_8bit, after_free_8bit, "8BIT"); - check_leak(before_free_32bit, after_free_32bit, "32BIT"); + esp_reent_cleanup(); //clean up some of the newlib's lazy allocations + unity_utils_evaluate_leaks_direct(TEST_MEMORY_LEAK_THRESHOLD); } void app_main(void) diff --git a/components/driver/test_apps/spi/master/CMakeLists.txt b/components/driver/test_apps/spi/master/CMakeLists.txt index dae1f3be41..0ba9178964 100644 --- a/components/driver/test_apps/spi/master/CMakeLists.txt +++ b/components/driver/test_apps/spi/master/CMakeLists.txt @@ -15,7 +15,7 @@ project(spi_master_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/spi_master_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/spi/slave/CMakeLists.txt b/components/driver/test_apps/spi/slave/CMakeLists.txt index 3fd4c7f9fd..a7531fe7f2 100644 --- a/components/driver/test_apps/spi/slave/CMakeLists.txt +++ b/components/driver/test_apps/spi/slave/CMakeLists.txt @@ -15,7 +15,7 @@ project(spi_slave_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/spi_slave_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/twai/CMakeLists.txt b/components/driver/test_apps/twai/CMakeLists.txt index 5c4e48ce79..205aa32c24 100644 --- a/components/driver/test_apps/twai/CMakeLists.txt +++ b/components/driver/test_apps/twai/CMakeLists.txt @@ -10,7 +10,7 @@ project(twai_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/twai_test.elf find-refs --from-sections=.iram0.text diff --git a/components/esp_adc/test_apps/adc/CMakeLists.txt b/components/esp_adc/test_apps/adc/CMakeLists.txt index f5f69d47cb..d941bb8ebd 100644 --- a/components/esp_adc/test_apps/adc/CMakeLists.txt +++ b/components/esp_adc/test_apps/adc/CMakeLists.txt @@ -12,7 +12,7 @@ project(adc_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/esp_adc/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_adc/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/adc_test.elf find-refs --from-sections=.iram0.text diff --git a/components/esp_lcd/test_apps/rgb_lcd/CMakeLists.txt b/components/esp_lcd/test_apps/rgb_lcd/CMakeLists.txt index 29566cc117..272f66f14f 100644 --- a/components/esp_lcd/test_apps/rgb_lcd/CMakeLists.txt +++ b/components/esp_lcd/test_apps/rgb_lcd/CMakeLists.txt @@ -13,7 +13,7 @@ target_add_binary_data(rgb_lcd_panel_test.elf "resources/pictures/world.yuv" BIN if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/esp_lcd/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_lcd/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/rgb_lcd_panel_test.elf find-refs --from-sections=.iram0.text diff --git a/components/esp_mm/test_apps/mm/CMakeLists.txt b/components/esp_mm/test_apps/mm/CMakeLists.txt index 1b3c447e12..c2bb42a79b 100644 --- a/components/esp_mm/test_apps/mm/CMakeLists.txt +++ b/components/esp_mm/test_apps/mm/CMakeLists.txt @@ -9,7 +9,7 @@ project(mm_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/esp_mm/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_mm/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/mm_test.elf find-refs --from-sections=.iram0.text diff --git a/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt b/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt index 39179513bb..d1e1dbc25f 100644 --- a/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt +++ b/components/esp_mm/test_apps/mmap_hw/CMakeLists.txt @@ -9,7 +9,7 @@ project(mmap_hw_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/esp_mm/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_mm/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/mmap_hw_test.elf find-refs --from-sections=.iram0.text diff --git a/components/hal/esp32/efuse_hal.c b/components/hal/esp32/efuse_hal.c index e25cbd8135..dd3ef43afb 100644 --- a/components/hal/esp32/efuse_hal.c +++ b/components/hal/esp32/efuse_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/components/hal/esp32c2/efuse_hal.c b/components/hal/esp32c2/efuse_hal.c index 59c6a90735..608f294040 100644 --- a/components/hal/esp32c2/efuse_hal.c +++ b/components/hal/esp32c2/efuse_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/components/hal/esp32c3/efuse_hal.c b/components/hal/esp32c3/efuse_hal.c index b32e387d87..d1a44974ad 100644 --- a/components/hal/esp32c3/efuse_hal.c +++ b/components/hal/esp32c3/efuse_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/components/hal/esp32c6/efuse_hal.c b/components/hal/esp32c6/efuse_hal.c index 697f581e5f..94a1051713 100644 --- a/components/hal/esp32c6/efuse_hal.c +++ b/components/hal/esp32c6/efuse_hal.c @@ -4,17 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "sdkconfig.h" #include +#include "sdkconfig.h" #include "soc/soc_caps.h" #include "hal/assert.h" #include "hal/efuse_hal.h" #include "hal/efuse_ll.h" +#include "esp_attr.h" #define ESP_EFUSE_BLOCK_ERROR_BITS(error_reg, block) ((error_reg) & (0x08 << (4 * (block)))) #define ESP_EFUSE_BLOCK_ERROR_NUM_BITS(error_reg, block) ((error_reg) & (0x07 << (4 * (block)))) -uint32_t efuse_hal_get_major_chip_version(void) +IRAM_ATTR uint32_t efuse_hal_get_major_chip_version(void) { #ifdef CONFIG_ESP_REV_NEW_CHIP_TEST return CONFIG_ESP_REV_MIN_FULL / 100; @@ -23,7 +24,7 @@ uint32_t efuse_hal_get_major_chip_version(void) #endif } -uint32_t efuse_hal_get_minor_chip_version(void) +IRAM_ATTR uint32_t efuse_hal_get_minor_chip_version(void) { #ifdef CONFIG_ESP_REV_NEW_CHIP_TEST return CONFIG_ESP_REV_MIN_FULL % 100; diff --git a/components/hal/esp32h2/efuse_hal.c b/components/hal/esp32h2/efuse_hal.c index 697f581e5f..94a1051713 100644 --- a/components/hal/esp32h2/efuse_hal.c +++ b/components/hal/esp32h2/efuse_hal.c @@ -4,17 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "sdkconfig.h" #include +#include "sdkconfig.h" #include "soc/soc_caps.h" #include "hal/assert.h" #include "hal/efuse_hal.h" #include "hal/efuse_ll.h" +#include "esp_attr.h" #define ESP_EFUSE_BLOCK_ERROR_BITS(error_reg, block) ((error_reg) & (0x08 << (4 * (block)))) #define ESP_EFUSE_BLOCK_ERROR_NUM_BITS(error_reg, block) ((error_reg) & (0x07 << (4 * (block)))) -uint32_t efuse_hal_get_major_chip_version(void) +IRAM_ATTR uint32_t efuse_hal_get_major_chip_version(void) { #ifdef CONFIG_ESP_REV_NEW_CHIP_TEST return CONFIG_ESP_REV_MIN_FULL / 100; @@ -23,7 +24,7 @@ uint32_t efuse_hal_get_major_chip_version(void) #endif } -uint32_t efuse_hal_get_minor_chip_version(void) +IRAM_ATTR uint32_t efuse_hal_get_minor_chip_version(void) { #ifdef CONFIG_ESP_REV_NEW_CHIP_TEST return CONFIG_ESP_REV_MIN_FULL % 100; diff --git a/components/hal/esp32s2/efuse_hal.c b/components/hal/esp32s2/efuse_hal.c index cea228db2f..7dee20eec4 100644 --- a/components/hal/esp32s2/efuse_hal.c +++ b/components/hal/esp32s2/efuse_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/components/hal/esp32s3/efuse_hal.c b/components/hal/esp32s3/efuse_hal.c index 6cf3737acc..4668de24fa 100644 --- a/components/hal/esp32s3/efuse_hal.c +++ b/components/hal/esp32s3/efuse_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ //The wafer_major and MSB of wafer_minor fields was allocated to other purposes when block version is v1.1. //Luckily only chip v0.0 have this kind of block version and efuse usage. //This workaround fixes the issue. +__attribute__((always_inline)) static inline bool is_eco0(uint32_t minor_raw) { return ((minor_raw & 0x7) == 0 && diff --git a/components/hal/esp32s3/include/hal/lcd_ll.h b/components/hal/esp32s3/include/hal/lcd_ll.h index f2cc1487be..2287df966d 100644 --- a/components/hal/esp32s3/include/hal/lcd_ll.h +++ b/components/hal/esp32s3/include/hal/lcd_ll.h @@ -77,6 +77,7 @@ static inline void lcd_ll_select_clk_src(lcd_cam_dev_t *dev, lcd_clock_source_t * @param div_a denominator of the divider * @param div_b numerator of the divider */ +__attribute__((always_inline)) static inline void lcd_ll_set_group_clock_coeff(lcd_cam_dev_t *dev, int div_num, int div_a, int div_b) { // lcd_clk = module_clock_src / (div_num + div_b / div_a) diff --git a/components/heap/test_apps/heap_tests/CMakeLists.txt b/components/heap/test_apps/heap_tests/CMakeLists.txt index 6decbb7ca2..b88d576973 100644 --- a/components/heap/test_apps/heap_tests/CMakeLists.txt +++ b/components/heap/test_apps/heap_tests/CMakeLists.txt @@ -12,7 +12,7 @@ project(test_heap) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/heap/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/heap/ --elf-file ${CMAKE_BINARY_DIR}/test_heap.elf find-refs --from-sections=.iram0.text diff --git a/components/spi_flash/test_apps/mspi_test/CMakeLists.txt b/components/spi_flash/test_apps/mspi_test/CMakeLists.txt index f191718e76..be1acb2a34 100644 --- a/components/spi_flash/test_apps/mspi_test/CMakeLists.txt +++ b/components/spi_flash/test_apps/mspi_test/CMakeLists.txt @@ -7,7 +7,7 @@ project(mspi_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/esp-idf/driver/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/mspi_test.elf find-refs --from-sections=.iram0.text diff --git a/tools/ci/check_callgraph.py b/tools/ci/check_callgraph.py index 44b478c37f..2d99edbe64 100755 --- a/tools/ci/check_callgraph.py +++ b/tools/ci/check_callgraph.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # # Based on cally.py (https://github.com/chaudron/cally/), Copyright 2018, Eelco Chaudron -# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import argparse @@ -357,7 +357,7 @@ def main() -> None: type=argparse.FileType('r'), ) parser.add_argument( - '--rtl-dir', help='Directory where to look for RTL files, recursively' + '--rtl-dirs', help='comma-separated list of directories where to look for RTL files, recursively' ) parser.add_argument( '--elf-file', @@ -397,9 +397,12 @@ def main() -> None: with open(args.rtl_list, 'r') as rtl_list_file: rtl_list = [line.strip() for line in rtl_list_file] else: - if not args.rtl_dir: - raise RuntimeError('Either --rtl-list or --rtl-dir must be specified') - rtl_list = list(find_files_recursive(args.rtl_dir, '.expand')) + if not args.rtl_dirs: + raise RuntimeError('Either --rtl-list or --rtl-dirs must be specified') + rtl_dirs = args.rtl_dirs.split(',') + rtl_list = [] + for dir in rtl_dirs: + rtl_list.extend(list(find_files_recursive(dir, '.expand'))) if not rtl_list: raise RuntimeError('No RTL files specified') diff --git a/tools/test_apps/system/bootloader_sections/CMakeLists.txt b/tools/test_apps/system/bootloader_sections/CMakeLists.txt index afc29574dc..79360d2fec 100644 --- a/tools/test_apps/system/bootloader_sections/CMakeLists.txt +++ b/tools/test_apps/system/bootloader_sections/CMakeLists.txt @@ -8,7 +8,7 @@ project(test_build) add_custom_target(check_bootloader_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dir ${CMAKE_BINARY_DIR}/bootloader + --rtl-dirs ${CMAKE_BINARY_DIR}/bootloader --elf-file ${CMAKE_BINARY_DIR}/bootloader/bootloader.elf find-refs --from-sections=.iram_loader.text