diff --git a/components/app_update/test_apps/test_app_update/main/test_ota_partitions.c b/components/app_update/test_apps/test_app_update/main/test_ota_partitions.c index 6a7fbf9252..c6f9f09ef0 100644 --- a/components/app_update/test_apps/test_app_update/main/test_ota_partitions.c +++ b/components/app_update/test_apps/test_app_update/main/test_ota_partitions.c @@ -15,7 +15,7 @@ #include "nvs_flash.h" #include "sdkconfig.h" -static const char *TAG = "test"; +ESP_LOG_ATTR_TAG(TAG, "test"); static uint8_t buffer[SPI_FLASH_SEC_SIZE]; diff --git a/components/app_update/test_apps/test_app_update/main/test_switch_ota.c b/components/app_update/test_apps/test_app_update/main/test_switch_ota.c index e7f44e5392..0bb3c03595 100644 --- a/components/app_update/test_apps/test_app_update/main/test_switch_ota.c +++ b/components/app_update/test_apps/test_app_update/main/test_switch_ota.c @@ -15,7 +15,7 @@ #include "utils_update.h" #include "sdkconfig.h" -static const char *TAG = "ota_test"; +ESP_LOG_ATTR_TAG(TAG, "ota_test"); /* @brief Checks and prepares the partition so that the factory app is launched after that. diff --git a/components/bootloader/subproject/main/bootloader_start.c b/components/bootloader/subproject/main/bootloader_start.c index 64d80c77c9..fa8709353c 100644 --- a/components/bootloader/subproject/main/bootloader_start.c +++ b/components/bootloader/subproject/main/bootloader_start.c @@ -11,7 +11,7 @@ #include "bootloader_common.h" #include "bootloader_hooks.h" -static const char *TAG = "boot"; +ESP_LOG_ATTR_TAG(TAG, "boot"); static int select_partition_number(bootloader_state_t *bs); static int selected_boot_partition(const bootloader_state_t *bs); diff --git a/components/bootloader/subproject/main/ld/esp32/bootloader.ld b/components/bootloader/subproject/main/ld/esp32/bootloader.ld index d2f9441f5d..facbf63f55 100644 --- a/components/bootloader/subproject/main/ld/esp32/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32/bootloader.ld @@ -268,6 +268,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32c2/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c2/bootloader.ld index dcf0d0e3eb..01be5ff6a1 100644 --- a/components/bootloader/subproject/main/ld/esp32c2/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32c2/bootloader.ld @@ -279,6 +279,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld index c59612a3a7..b7c8685ef1 100644 --- a/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld @@ -279,6 +279,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32c5/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c5/bootloader.ld index ff8cb2b93e..9738e41bda 100644 --- a/components/bootloader/subproject/main/ld/esp32c5/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32c5/bootloader.ld @@ -277,6 +277,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld index 1c32b2e72c..2b4daa233f 100644 --- a/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32c6/bootloader.ld @@ -278,6 +278,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32c61/bootloader.ld b/components/bootloader/subproject/main/ld/esp32c61/bootloader.ld index 0116028328..cadd0fad16 100644 --- a/components/bootloader/subproject/main/ld/esp32c61/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32c61/bootloader.ld @@ -277,6 +277,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32h2/bootloader.ld b/components/bootloader/subproject/main/ld/esp32h2/bootloader.ld index 8f97b5b40e..c2acf37df6 100644 --- a/components/bootloader/subproject/main/ld/esp32h2/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32h2/bootloader.ld @@ -277,6 +277,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32h21/bootloader.ld b/components/bootloader/subproject/main/ld/esp32h21/bootloader.ld index ed787d756b..9774dbfac4 100644 --- a/components/bootloader/subproject/main/ld/esp32h21/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32h21/bootloader.ld @@ -277,6 +277,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32h4/bootloader.ld b/components/bootloader/subproject/main/ld/esp32h4/bootloader.ld index 416756114a..093a7a8b78 100644 --- a/components/bootloader/subproject/main/ld/esp32h4/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32h4/bootloader.ld @@ -269,6 +269,20 @@ SECTIONS * And so forth... */ /DISCARD/ : { *(.rela.*) } + + /** + * This section is not included in the binary image; it is only present in the ELF file. + * It is used to keep certain symbols in the ELF file. + */ + .noload 0 (INFO) : + { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); + _noload_keep_in_elf_start = ABSOLUTE(.); + KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) + _noload_keep_in_elf_end = ABSOLUTE(.); + } } /** diff --git a/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld b/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld index edb3378972..d3941b7e44 100644 --- a/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld @@ -277,6 +277,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld b/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld index 076472974b..9bde08ceed 100644 --- a/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld @@ -257,6 +257,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld b/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld index dad1ba40af..90514a6a7a 100644 --- a/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32s3/bootloader.ld @@ -291,6 +291,9 @@ SECTIONS */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) _noload_keep_in_elf_end = ABSOLUTE(.); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash.c index 9904fbbc3f..09f848b4b6 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash.c @@ -48,7 +48,7 @@ #if !NON_OS_BUILD /* Normal app version maps to spi_flash_mmap.h operations... */ -static const char *TAG = "bootloader_mmap"; +ESP_LOG_ATTR_TAG(TAG, "bootloader_mmap"); static spi_flash_mmap_handle_t map; @@ -141,7 +141,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size) extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr); #endif -static const char *TAG = "bootloader_flash"; +ESP_LOG_ATTR_TAG(TAG, "bootloader_flash"); /* * NOTE: Memory mapping strategy diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c index f1f6b6c48c..5dcb9fe46b 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c @@ -195,7 +195,7 @@ int bootloader_flash_get_wp_pin(void) #endif } -static const char *TAG = "boot.esp32"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32"); void bootloader_configure_spi_pins(int drv) { @@ -296,19 +296,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -318,53 +318,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c index f7479ec797..923ffea743 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c2.c @@ -81,7 +81,7 @@ void IRAM_ATTR bootloader_flash_dummy_config(const esp_image_header_t *pfhdr) bootloader_flash_set_dummy_out(); } -static const char *TAG = "boot.esp32c2"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c2"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) @@ -155,19 +155,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "30MHz"; + str = ESP_LOG_ATTR_STR("30MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "15MHz"; + str = ESP_LOG_ATTR_STR("15MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "60MHz"; + str = ESP_LOG_ATTR_STR("60MHz"); break; default: - str = "15MHz"; + str = ESP_LOG_ATTR_STR("15MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -177,53 +177,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c index 10b6496f46..0362cf08c3 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c3.c @@ -85,7 +85,7 @@ void IRAM_ATTR bootloader_flash_dummy_config(const esp_image_header_t *pfhdr) bootloader_flash_set_dummy_out(); } -static const char *TAG = "boot.esp32c3"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c3"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) @@ -166,19 +166,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -188,53 +188,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c index 1be2362fd1..51d8eb83d6 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c5.c @@ -82,7 +82,7 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr) esp_rom_spiflash_config_clk(spi_clk_div, 0); } -static const char *TAG = "boot.esp32c5"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c5"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) { @@ -146,19 +146,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -168,53 +168,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c index 2b71ea0d07..a4e7cb0f84 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.c @@ -65,7 +65,7 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr) esp_rom_spiflash_config_clk(spi_clk_div, 0); } -static const char *TAG = "boot.esp32c6"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c6"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) { @@ -129,19 +129,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -151,53 +151,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c index 496a0c779a..a13cd32a37 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c61.c @@ -142,17 +142,17 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -162,53 +162,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c index 4c79bb05cf..2aec20744a 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h2.c @@ -67,7 +67,7 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr) esp_rom_spiflash_config_clk(spi_clk_div, 0); } -static const char *TAG = "boot.esp32h2"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32h2"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) { @@ -137,19 +137,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "32MHz"; + str = ESP_LOG_ATTR_STR("32MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "21.3MHz"; + str = ESP_LOG_ATTR_STR("21.3MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "16MHz"; + str = ESP_LOG_ATTR_STR("16MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "64MHz"; + str = ESP_LOG_ATTR_STR("64MHz"); break; default: - str = "16MHz"; + str = ESP_LOG_ATTR_STR("16MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -159,53 +159,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c index 2d8417aa3e..f25803abaa 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h21.c @@ -21,7 +21,7 @@ #include "hal/clk_tree_ll.h" #include "soc/pcr_reg.h" -static const char *TAG = "boot.esp32h21"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32h21"); void bootloader_flash_update_id() { @@ -134,13 +134,13 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "24MHz"; + str = ESP_LOG_ATTR_STR("24MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "48MHz"; + str = ESP_LOG_ATTR_STR("48MHz"); break; default: - str = "16MHz"; + str = ESP_LOG_ATTR_STR("16MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -150,53 +150,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c index 7241d14eaf..88464d63f5 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32h4.c @@ -27,7 +27,7 @@ #include "hal/cache_ll.h" #include "hal/mspi_ll.h" -static const char *TAG = "boot.esp32h4"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32h4"); void bootloader_flash_update_id() { @@ -141,16 +141,16 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "24MHz"; + str = ESP_LOG_ATTR_STR("24MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "12MHz"; + str = ESP_LOG_ATTR_STR("12MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "48MHz"; + str = ESP_LOG_ATTR_STR("48MHz"); break; default: - str = "12MHz"; + str = ESP_LOG_ATTR_STR("12MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -160,53 +160,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c index d9ed551c3f..bf69698019 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32p4.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -72,7 +72,7 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr) esp_rom_spiflash_config_clk(spi_clk_div, 0); } -static const char *TAG = "boot.esp32p4"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32p4"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) { @@ -136,19 +136,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -158,53 +158,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c index 9539e902eb..bc34456848 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s2.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -88,7 +88,7 @@ void IRAM_ATTR bootloader_flash_dummy_config(const esp_image_header_t* pfhdr) bootloader_flash_set_dummy_out(); } -static const char *TAG = "boot.esp32s2"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32s2"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) { @@ -170,19 +170,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str); @@ -192,53 +192,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c index 489f2e7690..866ef30075 100644 --- a/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c +++ b/components/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32s3.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -99,7 +99,7 @@ void IRAM_ATTR bootloader_flash_dummy_config(const esp_image_header_t *pfhdr) bootloader_flash_set_dummy_out(); } -static const char *TAG = "boot.esp32s3"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32s3"); void IRAM_ATTR bootloader_configure_spi_pins(int drv) { @@ -182,19 +182,19 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) const char *str; switch (bootloader_hdr->spi_speed) { case ESP_IMAGE_SPI_SPEED_DIV_2: - str = "40MHz"; + str = ESP_LOG_ATTR_STR("40MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_3: - str = "26.7MHz"; + str = ESP_LOG_ATTR_STR("26.7MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_4: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; case ESP_IMAGE_SPI_SPEED_DIV_1: - str = "80MHz"; + str = ESP_LOG_ATTR_STR("80MHz"); break; default: - str = "20MHz"; + str = ESP_LOG_ATTR_STR("20MHz"); break; } ESP_EARLY_LOGI(TAG, "Boot SPI Speed : %s", str); @@ -204,53 +204,53 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr) esp_rom_spiflash_read_mode_t spi_mode = bootloader_flash_get_spi_mode(); switch (spi_mode) { case ESP_ROM_SPIFLASH_QIO_MODE: - str = "QIO"; + str = ESP_LOG_ATTR_STR("QIO"); break; case ESP_ROM_SPIFLASH_QOUT_MODE: - str = "QOUT"; + str = ESP_LOG_ATTR_STR("QOUT"); break; case ESP_ROM_SPIFLASH_DIO_MODE: - str = "DIO"; + str = ESP_LOG_ATTR_STR("DIO"); break; case ESP_ROM_SPIFLASH_DOUT_MODE: - str = "DOUT"; + str = ESP_LOG_ATTR_STR("DOUT"); break; case ESP_ROM_SPIFLASH_FASTRD_MODE: - str = "FAST READ"; + str = ESP_LOG_ATTR_STR("FAST READ"); break; default: - str = "SLOW READ"; + str = ESP_LOG_ATTR_STR("SLOW READ"); break; } ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str); switch (bootloader_hdr->spi_size) { case ESP_IMAGE_FLASH_SIZE_1MB: - str = "1MB"; + str = ESP_LOG_ATTR_STR("1MB"); break; case ESP_IMAGE_FLASH_SIZE_2MB: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; case ESP_IMAGE_FLASH_SIZE_4MB: - str = "4MB"; + str = ESP_LOG_ATTR_STR("4MB"); break; case ESP_IMAGE_FLASH_SIZE_8MB: - str = "8MB"; + str = ESP_LOG_ATTR_STR("8MB"); break; case ESP_IMAGE_FLASH_SIZE_16MB: - str = "16MB"; + str = ESP_LOG_ATTR_STR("16MB"); break; case ESP_IMAGE_FLASH_SIZE_32MB: - str = "32MB"; + str = ESP_LOG_ATTR_STR("32MB"); break; case ESP_IMAGE_FLASH_SIZE_64MB: - str = "64MB"; + str = ESP_LOG_ATTR_STR("64MB"); break; case ESP_IMAGE_FLASH_SIZE_128MB: - str = "128MB"; + str = ESP_LOG_ATTR_STR("128MB"); break; default: - str = "2MB"; + str = ESP_LOG_ATTR_STR("2MB"); break; } ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str); diff --git a/components/bootloader_support/bootloader_flash/src/flash_qio_mode.c b/components/bootloader_support/bootloader_flash/src/flash_qio_mode.c index 039b3fbf10..664d3f03a5 100644 --- a/components/bootloader_support/bootloader_flash/src/flash_qio_mode.c +++ b/components/bootloader_support/bootloader_flash/src/flash_qio_mode.c @@ -21,7 +21,7 @@ #include "bootloader_flash_override.h" -static const char *TAG = "qio_mode"; +ESP_LOG_ATTR_TAG(TAG, "qio_mode"); /* Array of known flash chips and data to enable Quad I/O mode diff --git a/components/bootloader_support/src/bootloader_common.c b/components/bootloader_support/src/bootloader_common.c index 759263e122..d2101287a9 100644 --- a/components/bootloader_support/src/bootloader_common.c +++ b/components/bootloader_support/src/bootloader_common.c @@ -27,7 +27,7 @@ #define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */ -static const char* TAG = "boot_comm"; +ESP_LOG_ATTR_TAG(TAG, "boot_comm"); esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio(uint32_t num_pin, uint32_t delay_sec) { diff --git a/components/bootloader_support/src/bootloader_common_loader.c b/components/bootloader_support/src/bootloader_common_loader.c index cef2e7e996..ecc96cafca 100644 --- a/components/bootloader_support/src/bootloader_common_loader.c +++ b/components/bootloader_support/src/bootloader_common_loader.c @@ -30,7 +30,7 @@ #define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0)) #define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) -static const char* TAG = "boot_comm"; +ESP_LOG_ATTR_TAG(TAG, "boot_comm"); bool bootloader_common_check_chip_revision_validity(const esp_image_header_t *img_hdr, bool check_max_revision) { diff --git a/components/bootloader_support/src/bootloader_init.c b/components/bootloader_support/src/bootloader_init.c index 9488bb60e1..a4c93428c4 100644 --- a/components/bootloader_support/src/bootloader_init.c +++ b/components/bootloader_support/src/bootloader_init.c @@ -21,7 +21,7 @@ #include "esp_bootloader_desc.h" #include "esp_rom_sys.h" -static const char *TAG = "boot"; +ESP_LOG_ATTR_TAG(TAG, "boot"); #if !CONFIG_APP_BUILD_TYPE_RAM esp_image_header_t WORD_ALIGNED_ATTR bootloader_image_hdr; diff --git a/components/bootloader_support/src/bootloader_utility.c b/components/bootloader_support/src/bootloader_utility.c index d4e12a62eb..7d2badf83a 100644 --- a/components/bootloader_support/src/bootloader_utility.c +++ b/components/bootloader_support/src/bootloader_utility.c @@ -57,7 +57,7 @@ #include "bootloader_utility_tee.h" #endif -static const char *TAG = "boot"; +ESP_LOG_ATTR_TAG(TAG, "boot"); /* Reduce literal size for some generic string literals */ #define MAP_ERR_MSG "Image contains multiple %s segments. Only the last one will be mapped." @@ -168,7 +168,7 @@ bool bootloader_utility_load_partition_table(bootloader_state_t *bs) const esp_partition_info_t *partition = &partitions[i]; ESP_LOGD(TAG, "load partition table entry 0x%x", (intptr_t)partition); ESP_LOGD(TAG, "type=%x subtype=%x", partition->type, partition->subtype); - partition_usage = "unknown"; + partition_usage = ESP_LOG_ATTR_STR("unknown"); /* valid partition table */ switch (partition->type) { @@ -176,17 +176,17 @@ bool bootloader_utility_load_partition_table(bootloader_state_t *bs) switch (partition->subtype) { case PART_SUBTYPE_FACTORY: /* factory binary */ bs->factory = partition->pos; - partition_usage = "factory app"; + partition_usage = ESP_LOG_ATTR_STR("factory app"); break; case PART_SUBTYPE_TEST: /* test binary */ bs->test = partition->pos; - partition_usage = "test app"; + partition_usage = ESP_LOG_ATTR_STR("test app"); break; #if CONFIG_SECURE_ENABLE_TEE case PART_SUBTYPE_TEE_0: /* TEE binary */ case PART_SUBTYPE_TEE_1: bs->tee[partition->subtype & 0x01] = partition->pos; - partition_usage = "TEE app"; + partition_usage = ESP_LOG_ATTR_STR("TEE app"); break; #endif default: @@ -194,9 +194,9 @@ bool bootloader_utility_load_partition_table(bootloader_state_t *bs) if ((partition->subtype & ~PART_SUBTYPE_OTA_MASK) == PART_SUBTYPE_OTA_FLAG) { bs->ota[partition->subtype & PART_SUBTYPE_OTA_MASK] = partition->pos; ++bs->app_count; - partition_usage = "OTA app"; + partition_usage = ESP_LOG_ATTR_STR("OTA app"); } else { - partition_usage = "Unknown app"; + partition_usage = ESP_LOG_ATTR_STR("Unknown app"); } break; } @@ -205,19 +205,19 @@ bool bootloader_utility_load_partition_table(bootloader_state_t *bs) switch (partition->subtype) { case PART_SUBTYPE_DATA_OTA: /* ota data */ bs->ota_info = partition->pos; - partition_usage = "OTA data"; + partition_usage = ESP_LOG_ATTR_STR("OTA data"); break; case PART_SUBTYPE_DATA_RF: - partition_usage = "RF data"; + partition_usage = ESP_LOG_ATTR_STR("RF data"); break; case PART_SUBTYPE_DATA_WIFI: - partition_usage = "WiFi data"; + partition_usage = ESP_LOG_ATTR_STR("WiFi data"); break; case PART_SUBTYPE_DATA_NVS_KEYS: - partition_usage = "NVS keys"; + partition_usage = ESP_LOG_ATTR_STR("NVS keys"); break; case PART_SUBTYPE_DATA_EFUSE_EM: - partition_usage = "efuse"; + partition_usage = ESP_LOG_ATTR_STR("efuse"); #ifdef CONFIG_EFUSE_VIRTUAL_KEEP_IN_FLASH esp_efuse_init_virtual_mode_in_flash(partition->pos.offset, partition->pos.size); #endif @@ -225,34 +225,34 @@ bool bootloader_utility_load_partition_table(bootloader_state_t *bs) #if CONFIG_SECURE_ENABLE_TEE case PART_SUBTYPE_DATA_TEE_OTA: /* TEE ota data */ bs->tee_ota_info = partition->pos; - partition_usage = "TEE OTA data"; + partition_usage = ESP_LOG_ATTR_STR("TEE OTA data"); break; #endif default: - partition_usage = "Unknown data"; + partition_usage = ESP_LOG_ATTR_STR("Unknown data"); break; } break; /* PARTITION_USAGE_DATA */ case PART_TYPE_BOOTLOADER: /* Bootloader partition */ switch (partition->subtype) { case PART_SUBTYPE_BOOTLOADER_PRIMARY: - partition_usage = "primary bootloader"; + partition_usage = ESP_LOG_ATTR_STR("primary bootloader"); break; case PART_SUBTYPE_BOOTLOADER_OTA: - partition_usage = "ota bootloader"; + partition_usage = ESP_LOG_ATTR_STR("ota bootloader"); break; case PART_SUBTYPE_BOOTLOADER_RECOVERY: - partition_usage = "recovery bootloader"; + partition_usage = ESP_LOG_ATTR_STR("recovery bootloader"); break; } break; /* PART_TYPE_BOOTLOADER */ case PART_TYPE_PARTITION_TABLE: /* Partition table partition */ switch (partition->subtype) { case PART_SUBTYPE_PARTITION_TABLE_PRIMARY: - partition_usage = "primary partition_table"; + partition_usage = ESP_LOG_ATTR_STR("primary partition_table"); break; case PART_SUBTYPE_PARTITION_TABLE_OTA: - partition_usage = "ota partition_table"; + partition_usage = ESP_LOG_ATTR_STR("ota partition_table"); break; } break; /* PART_TYPE_PARTITION_TABLE */ @@ -293,7 +293,7 @@ static esp_partition_pos_t index_to_partition(const bootloader_state_t *bs, int static void log_invalid_app_partition(int index) { - const char *not_bootable = " is not bootable"; /* save a few string literal bytes */ + const char *not_bootable = ESP_LOG_ATTR_STR(" is not bootable"); /* save a few string literal bytes */ switch (index) { case FACTORY_INDEX: ESP_LOGE(TAG, "Factory app partition%s", not_bootable); @@ -867,9 +867,9 @@ static void unpack_load_app(const esp_image_metadata_t *data) const esp_image_segment_header_t *header = &data->segments[i]; if (header->load_addr >= SOC_DROM_LOW && header->load_addr < SOC_DROM_HIGH) { if (drom_addr != 0) { - ESP_EARLY_LOGE(TAG, MAP_ERR_MSG, "DROM"); + ESP_EARLY_LOGE(TAG, MAP_ERR_MSG, ESP_LOG_ATTR_STR("DROM")); } else { - ESP_EARLY_LOGD(TAG, "Mapping segment %d as %s", i, "DROM"); + ESP_EARLY_LOGD(TAG, "Mapping segment %d as %s", i, ESP_LOG_ATTR_STR("DROM")); } drom_addr = data->segment_data[i]; drom_load_addr = header->load_addr; @@ -877,9 +877,9 @@ static void unpack_load_app(const esp_image_metadata_t *data) } if (header->load_addr >= SOC_IROM_LOW && header->load_addr < SOC_IROM_HIGH) { if (irom_addr != 0) { - ESP_EARLY_LOGE(TAG, MAP_ERR_MSG, "IROM"); + ESP_EARLY_LOGE(TAG, MAP_ERR_MSG, ESP_LOG_ATTR_STR("IROM")); } else { - ESP_EARLY_LOGD(TAG, "Mapping segment %d as %s", i, "IROM"); + ESP_EARLY_LOGD(TAG, "Mapping segment %d as %s", i, ESP_LOG_ATTR_STR("IROM")); } irom_addr = data->segment_data[i]; irom_load_addr = header->load_addr; diff --git a/components/bootloader_support/src/bootloader_utility_tee.c b/components/bootloader_support/src/bootloader_utility_tee.c index c6efd2eeb0..8a22f01978 100644 --- a/components/bootloader_support/src/bootloader_utility_tee.c +++ b/components/bootloader_support/src/bootloader_utility_tee.c @@ -24,7 +24,7 @@ #include "sdkconfig.h" -static const char *TAG = "boot_tee"; +ESP_LOG_ATTR_TAG(TAG, "boot_tee"); static esp_err_t write_tee_otadata_sector(esp_tee_ota_select_entry_t *tee_otadata, uint32_t offset) { diff --git a/components/bootloader_support/src/esp32/bootloader_esp32.c b/components/bootloader_support/src/esp32/bootloader_esp32.c index 26468105ce..72627ab9bb 100644 --- a/components/bootloader_support/src/esp32/bootloader_esp32.c +++ b/components/bootloader_support/src/esp32/bootloader_esp32.c @@ -37,7 +37,7 @@ #include "esp_rom_spiflash.h" #include "esp_efuse.h" -static const char *TAG = "boot.esp32"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32"); #if !CONFIG_APP_BUILD_TYPE_RAM static void bootloader_reset_mmu(void) @@ -91,7 +91,7 @@ static void wdt_reset_info_dump(int cpu) { uint32_t inst = 0, pid = 0, stat = 0, data = 0, pc = 0, lsstat = 0, lsaddr = 0, lsdata = 0, dstat = 0; - const char *cpu_name = cpu ? "APP" : "PRO"; + const char *cpu_name = cpu ? ESP_LOG_ATTR_STR("APP") : ESP_LOG_ATTR_STR("PRO"); if (cpu == 0) { stat = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_STATUS_REG); diff --git a/components/bootloader_support/src/esp32/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32/flash_encryption_secure_features.c index 69363b935f..def2888ac7 100644 --- a/components/bootloader_support/src/esp32/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32/secure_boot_secure_features.c b/components/bootloader_support/src/esp32/secure_boot_secure_features.c index 977a691bf8..6eaa426181 100644 --- a/components/bootloader_support/src/esp32/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c b/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c index 381c4ea1fb..303f602a50 100644 --- a/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c +++ b/components/bootloader_support/src/esp32c2/bootloader_esp32c2.c @@ -39,7 +39,7 @@ #include "hal/rwdt_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32c2"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c2"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32c2/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32c2/flash_encryption_secure_features.c index aa4cd483ce..560b7c1759 100644 --- a/components/bootloader_support/src/esp32c2/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32c2/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c2/secure_boot_secure_features.c b/components/bootloader_support/src/esp32c2/secure_boot_secure_features.c index ec6d6e7ef9..eebb5eb354 100644 --- a/components/bootloader_support/src/esp32c2/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32c2/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c b/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c index dff1999165..7521c53269 100644 --- a/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c +++ b/components/bootloader_support/src/esp32c3/bootloader_esp32c3.c @@ -44,7 +44,7 @@ #include "hal/rwdt_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32c3"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c3"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32c3/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32c3/flash_encryption_secure_features.c index 16d81feabd..9182d8a504 100644 --- a/components/bootloader_support/src/esp32c3/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32c3/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c3/secure_boot_secure_features.c b/components/bootloader_support/src/esp32c3/secure_boot_secure_features.c index a460dbce5e..1e662ad8e8 100644 --- a/components/bootloader_support/src/esp32c3/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32c3/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c b/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c index 0b1f5924c0..42c9c57df4 100644 --- a/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c +++ b/components/bootloader_support/src/esp32c5/bootloader_esp32c5.c @@ -44,7 +44,7 @@ #include "hal/regi2c_ctrl_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32c5"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c5"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c index 7ccb0ef4e7..e32ec055b0 100644 --- a/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32c5/flash_encryption_secure_features.c @@ -16,7 +16,7 @@ #include "soc/soc_caps.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c5/secure_boot_secure_features.c b/components/bootloader_support/src/esp32c5/secure_boot_secure_features.c index 1e836d101b..5da95e3528 100644 --- a/components/bootloader_support/src/esp32c5/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32c5/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c b/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c index c7564a17b3..698e61553d 100644 --- a/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c +++ b/components/bootloader_support/src/esp32c6/bootloader_esp32c6.c @@ -46,7 +46,7 @@ #include "hal/regi2c_ctrl_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32c6"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c6"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32c6/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32c6/flash_encryption_secure_features.c index cde773a967..6b4ec8594e 100644 --- a/components/bootloader_support/src/esp32c6/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32c6/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c6/secure_boot_secure_features.c b/components/bootloader_support/src/esp32c6/secure_boot_secure_features.c index 9ea0f69e4b..dd2b72cc70 100644 --- a/components/bootloader_support/src/esp32c6/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32c6/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c b/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c index 8d8ede2462..968483f05a 100644 --- a/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c +++ b/components/bootloader_support/src/esp32c61/bootloader_esp32c61.c @@ -45,7 +45,7 @@ #include "hal/regi2c_ctrl_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32c61"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32c61"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32c61/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32c61/flash_encryption_secure_features.c index d88857fe47..6ddd0c30f5 100644 --- a/components/bootloader_support/src/esp32c61/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32c61/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32c61/secure_boot_secure_features.c b/components/bootloader_support/src/esp32c61/secure_boot_secure_features.c index 7cb01c89b1..4d2a49c790 100644 --- a/components/bootloader_support/src/esp32c61/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32c61/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c b/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c index 1ab9ad9f72..032dca506a 100644 --- a/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c +++ b/components/bootloader_support/src/esp32h2/bootloader_esp32h2.c @@ -45,7 +45,7 @@ #include "hal/regi2c_ctrl_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32h2"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32h2"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32h2/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32h2/flash_encryption_secure_features.c index d4926d9464..1deee096fa 100644 --- a/components/bootloader_support/src/esp32h2/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32h2/flash_encryption_secure_features.c @@ -15,7 +15,7 @@ #include "soc/soc_caps.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32h2/secure_boot_secure_features.c b/components/bootloader_support/src/esp32h2/secure_boot_secure_features.c index da7f84df5c..cb1f69f8cf 100644 --- a/components/bootloader_support/src/esp32h2/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32h2/secure_boot_secure_features.c @@ -13,7 +13,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c b/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c index 743fed7d0e..77e906c9c5 100644 --- a/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c +++ b/components/bootloader_support/src/esp32h21/bootloader_esp32h21.c @@ -44,7 +44,7 @@ #include "hal/efuse_hal.h" #include "hal/regi2c_ctrl_ll.h" -static const char *TAG = "boot.esp32h21"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32h21"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32h21/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32h21/flash_encryption_secure_features.c index e09c24979c..e504ab0762 100644 --- a/components/bootloader_support/src/esp32h21/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32h21/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32h21/secure_boot_secure_features.c b/components/bootloader_support/src/esp32h21/secure_boot_secure_features.c index 0ea0e26e18..86b501cc20 100644 --- a/components/bootloader_support/src/esp32h21/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32h21/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32h4/bootloader_esp32h4.c b/components/bootloader_support/src/esp32h4/bootloader_esp32h4.c index 55dff805dc..e1cae656b8 100644 --- a/components/bootloader_support/src/esp32h4/bootloader_esp32h4.c +++ b/components/bootloader_support/src/esp32h4/bootloader_esp32h4.c @@ -39,7 +39,7 @@ #include "hal/efuse_hal.h" #include "hal/lpwdt_ll.h" -static const char *TAG = "boot.esp32h4"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32h4"); // TODO: [ESP32H4] support core1 bus monitor IDF-12592 static void wdt_reset_cpu0_info_enable(void) diff --git a/components/bootloader_support/src/esp32h4/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32h4/flash_encryption_secure_features.c index 151e036d6e..3dd205d2f2 100644 --- a/components/bootloader_support/src/esp32h4/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32h4/flash_encryption_secure_features.c @@ -14,7 +14,7 @@ //TODO: [ESP32H4] IDF-12261 -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32h4/secure_boot_secure_features.c b/components/bootloader_support/src/esp32h4/secure_boot_secure_features.c index 94517980b3..c6a210997c 100644 --- a/components/bootloader_support/src/esp32h4/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32h4/secure_boot_secure_features.c @@ -14,7 +14,7 @@ //TODO: [ESP32H4] IDF-12262 -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c b/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c index 2f12299a0a..6e34b1114f 100644 --- a/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c +++ b/components/bootloader_support/src/esp32p4/bootloader_esp32p4.c @@ -52,7 +52,7 @@ #include "hal/regi2c_ctrl_ll.h" #include "hal/brownout_ll.h" -static const char *TAG = "boot.esp32p4"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32p4"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c index 264188e0c2..cf7a4a8c2d 100644 --- a/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32p4/flash_encryption_secure_features.c @@ -14,7 +14,7 @@ #include "hal/key_mgr_ll.h" #include "hal/mspi_ll.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32p4/secure_boot_secure_features.c b/components/bootloader_support/src/esp32p4/secure_boot_secure_features.c index 34fe744809..a3232f4a5d 100644 --- a/components/bootloader_support/src/esp32p4/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32p4/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c b/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c index 74a9c593f1..72b6468b57 100644 --- a/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c +++ b/components/bootloader_support/src/esp32s2/bootloader_esp32s2.c @@ -39,7 +39,7 @@ #include "hal/mmu_hal.h" #include "hal/cache_hal.h" -static const char *TAG = "boot.esp32s2"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32s2"); static void wdt_reset_cpu0_info_enable(void) { diff --git a/components/bootloader_support/src/esp32s2/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32s2/flash_encryption_secure_features.c index e01f9211a0..7586047072 100644 --- a/components/bootloader_support/src/esp32s2/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32s2/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32s2/secure_boot_secure_features.c b/components/bootloader_support/src/esp32s2/secure_boot_secure_features.c index fd034aa452..830843b00c 100644 --- a/components/bootloader_support/src/esp32s2/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32s2/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c b/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c index 777ead0e1a..019203c0c9 100644 --- a/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c +++ b/components/bootloader_support/src/esp32s3/bootloader_esp32s3.c @@ -44,7 +44,7 @@ #include "xt_instr_macros.h" -static const char *TAG = "boot.esp32s3"; +ESP_LOG_ATTR_TAG(TAG, "boot.esp32s3"); static void wdt_reset_cpu0_info_enable(void) { @@ -58,7 +58,7 @@ static void wdt_reset_info_dump(int cpu) { uint32_t inst = 0, pid = 0, stat = 0, data = 0, pc = 0, lsstat = 0, lsaddr = 0, lsdata = 0, dstat = 0; - const char *cpu_name = cpu ? "APP" : "PRO"; + const char *cpu_name = cpu ? ESP_LOG_ATTR_STR("APP") : ESP_LOG_ATTR_STR("PRO"); stat = 0xdeadbeef; pid = 0; diff --git a/components/bootloader_support/src/esp32s3/flash_encryption_secure_features.c b/components/bootloader_support/src/esp32s3/flash_encryption_secure_features.c index 92b58c300f..913c4930da 100644 --- a/components/bootloader_support/src/esp32s3/flash_encryption_secure_features.c +++ b/components/bootloader_support/src/esp32s3/flash_encryption_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); esp_err_t esp_flash_encryption_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp32s3/secure_boot_secure_features.c b/components/bootloader_support/src/esp32s3/secure_boot_secure_features.c index fcccf66266..ad72623248 100644 --- a/components/bootloader_support/src/esp32s3/secure_boot_secure_features.c +++ b/components/bootloader_support/src/esp32s3/secure_boot_secure_features.c @@ -12,7 +12,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); esp_err_t esp_secure_boot_enable_secure_features(void) { diff --git a/components/bootloader_support/src/esp_image_format.c b/components/bootloader_support/src/esp_image_format.c index 90aa13b491..c947afb983 100644 --- a/components/bootloader_support/src/esp_image_format.c +++ b/components/bootloader_support/src/esp_image_format.c @@ -45,7 +45,7 @@ #endif #endif -static const char *TAG = "esp_image"; +ESP_LOG_ATTR_TAG(TAG, "esp_image"); #define HASH_LEN ESP_IMAGE_HASH_LEN @@ -412,7 +412,7 @@ static bool verify_load_addresses(int segment_index, intptr_t load_addr, intptr_ intptr_t sp = (intptr_t)esp_cpu_get_sp(); if (bootloader_util_regions_overlap(sp - STACK_LOAD_HEADROOM, ROM_STACK_START, load_addr, load_end)) { - reason = "overlaps bootloader stack"; + reason = ESP_LOG_ATTR_STR("overlaps bootloader stack"); goto invalid; } @@ -421,7 +421,7 @@ static bool verify_load_addresses(int segment_index, intptr_t load_addr, intptr_ (_dram_start.._dram_end includes bss, data, rodata sections in DRAM) */ if (bootloader_util_regions_overlap((intptr_t)&_dram_start, (intptr_t)&_dram_end, load_addr, load_end)) { - reason = "overlaps bootloader data"; + reason = ESP_LOG_ATTR_STR("overlaps bootloader data"); goto invalid; } @@ -459,7 +459,7 @@ static bool verify_load_addresses(int segment_index, intptr_t load_addr, intptr_ /* Check for overlap of 'loader' section of IRAM */ if (bootloader_util_regions_overlap((intptr_t)&_loader_text_start, (intptr_t)&_loader_text_end, load_addr, load_end)) { - reason = "overlaps loader IRAM"; + reason = ESP_LOG_ATTR_STR("overlaps loader IRAM"); goto invalid; } @@ -514,7 +514,7 @@ static bool verify_load_addresses(int segment_index, intptr_t load_addr, intptr_ #endif else { /* Not a DRAM or an IRAM or RTC Fast IRAM, RTC Fast DRAM or RTC Slow address */ - reason = "bad load address range"; + reason = ESP_LOG_ATTR_STR("bad load address range"); goto invalid; } return true; @@ -617,7 +617,7 @@ static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segme ESP_LOGI(TAG, "segment %d: paddr=%08"PRIx32" vaddr=%08x size=%05"PRIx32"h (%6"PRIu32") %s", index, data_addr, load_addr, data_len, data_len, - (do_load) ? "load" : (is_mapping) ? "map" : ""); + (do_load) ? ESP_LOG_ATTR_STR("load") : (is_mapping) ? ESP_LOG_ATTR_STR("map") : ""); } diff --git a/components/bootloader_support/src/flash_encrypt.c b/components/bootloader_support/src/flash_encrypt.c index 381f17ed40..b675cb0c7f 100644 --- a/components/bootloader_support/src/flash_encrypt.c +++ b/components/bootloader_support/src/flash_encrypt.c @@ -24,7 +24,7 @@ #define WR_DIS_CRYPT_CNT ESP_EFUSE_WR_DIS_SPI_BOOT_CRYPT_CNT #endif -static const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); #ifndef BOOTLOADER_BUILD void esp_flash_encryption_init_checks() diff --git a/components/bootloader_support/src/flash_encryption/flash_encrypt.c b/components/bootloader_support/src/flash_encryption/flash_encrypt.c index 6d3ca7bc8c..24168e7cc7 100644 --- a/components/bootloader_support/src/flash_encryption/flash_encrypt.c +++ b/components/bootloader_support/src/flash_encryption/flash_encrypt.c @@ -39,7 +39,7 @@ * and if required encrypt the partitions in flash memory */ -static const char *TAG = "flash_encrypt"; +ESP_LOG_ATTR_TAG(TAG, "flash_encrypt"); /* Static functions for stages of flash encryption */ static esp_err_t encrypt_bootloader(void); diff --git a/components/bootloader_support/src/flash_partitions.c b/components/bootloader_support/src/flash_partitions.c index 8d0abd039d..a2e1fbb893 100644 --- a/components/bootloader_support/src/flash_partitions.c +++ b/components/bootloader_support/src/flash_partitions.c @@ -9,7 +9,7 @@ #include "esp_rom_md5.h" #include "esp_rom_spiflash.h" -static const char *TAG = "flash_parts"; +ESP_LOG_ATTR_TAG(TAG, "flash_parts"); esp_err_t esp_partition_table_verify(const esp_partition_info_t *partition_table, bool log_errors, int *num_partitions) { diff --git a/components/bootloader_support/src/secure_boot.c b/components/bootloader_support/src/secure_boot.c index 1faacdf84e..a7d566e8fd 100644 --- a/components/bootloader_support/src/secure_boot.c +++ b/components/bootloader_support/src/secure_boot.c @@ -17,7 +17,7 @@ #endif #ifndef BOOTLOADER_BUILD -static __attribute__((unused)) const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); #ifdef CONFIG_SECURE_BOOT static void efuse_batch_write_begin(bool *need_fix) diff --git a/components/bootloader_support/src/secure_boot_v1/secure_boot.c b/components/bootloader_support/src/secure_boot_v1/secure_boot.c index 5fb91e1d58..ce705ef03c 100644 --- a/components/bootloader_support/src/secure_boot_v1/secure_boot.c +++ b/components/bootloader_support/src/secure_boot_v1/secure_boot.c @@ -31,7 +31,7 @@ */ #ifdef CONFIG_SECURE_BOOT_V1_ENABLED -static const char *TAG = "secure_boot_v1"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v1"); /** * @function : secure_boot_generate * @description: generate boot digest (aka "abstract") & iv diff --git a/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_app.c b/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_app.c index 054adff3d3..c7057014cf 100644 --- a/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_app.c +++ b/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_app.c @@ -21,7 +21,7 @@ #include #ifdef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME -static const char *TAG = "secure_boot_v1"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v1"); extern const uint8_t signature_verification_key_start[] asm("_binary_signature_verification_key_bin_start"); extern const uint8_t signature_verification_key_end[] asm("_binary_signature_verification_key_bin_end"); diff --git a/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_bootloader.c b/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_bootloader.c index e177162f04..3d3ad04fc9 100644 --- a/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_bootloader.c +++ b/components/bootloader_support/src/secure_boot_v1/secure_boot_signatures_bootloader.c @@ -18,7 +18,7 @@ #include #include -static const char *TAG = "secure_boot"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot"); #ifdef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME extern const uint8_t signature_verification_key_start[] asm("_binary_signature_verification_key_bin_start"); diff --git a/components/bootloader_support/src/secure_boot_v2/secure_boot.c b/components/bootloader_support/src/secure_boot_v2/secure_boot.c index 07139d3178..9bfe03fb8e 100644 --- a/components/bootloader_support/src/secure_boot_v2/secure_boot.c +++ b/components/bootloader_support/src/secure_boot_v2/secure_boot.c @@ -28,7 +28,7 @@ extern esp_image_metadata_t tee_data; #endif #define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) -static const char *TAG = "secure_boot_v2"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v2"); /* A signature block is valid when it has correct magic byte, crc and image digest. */ static esp_err_t validate_signature_block(const ets_secure_boot_sig_block_t *block, int block_num, const uint8_t *image_digest) diff --git a/components/bootloader_support/src/secure_boot_v2/secure_boot_ecdsa_signature.c b/components/bootloader_support/src/secure_boot_v2/secure_boot_ecdsa_signature.c index f0996e4059..f737b1658c 100644 --- a/components/bootloader_support/src/secure_boot_v2/secure_boot_ecdsa_signature.c +++ b/components/bootloader_support/src/secure_boot_v2/secure_boot_ecdsa_signature.c @@ -16,7 +16,7 @@ #include "secure_boot_signature_priv.h" -static const char *TAG = "secure_boot_v2_ecdsa"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v2_ecdsa"); #define ECDSA_INTEGER_LEN 32 diff --git a/components/bootloader_support/src/secure_boot_v2/secure_boot_rsa_signature.c b/components/bootloader_support/src/secure_boot_v2/secure_boot_rsa_signature.c index f2f3bc916e..ce63ba9bcc 100644 --- a/components/bootloader_support/src/secure_boot_v2/secure_boot_rsa_signature.c +++ b/components/bootloader_support/src/secure_boot_v2/secure_boot_rsa_signature.c @@ -14,7 +14,7 @@ #include "secure_boot_signature_priv.h" -static const char *TAG = "secure_boot_v2_rsa"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v2_rsa"); esp_err_t verify_rsa_signature_block(const ets_secure_boot_signature_t *sig_block, const uint8_t *image_digest, const ets_secure_boot_sig_block_t *trusted_block) { diff --git a/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_app.c b/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_app.c index 52ab61e051..bdba167567 100644 --- a/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_app.c +++ b/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_app.c @@ -34,7 +34,7 @@ _Static_assert(SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS == SECURE_BOOT_NUM_BLOCKS, #if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME || CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT -static const char *TAG = "secure_boot_v2"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v2"); #define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) /* A signature block is valid when it has correct magic byte, crc. */ diff --git a/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_bootloader.c b/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_bootloader.c index 1e667cdc5a..dd94c28057 100644 --- a/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_bootloader.c +++ b/components/bootloader_support/src/secure_boot_v2/secure_boot_signatures_bootloader.c @@ -20,7 +20,7 @@ #if CONFIG_SECURE_BOOT_V2_ENABLED -static const char* TAG = "secure_boot_v2"; +ESP_LOG_ATTR_TAG(TAG, "secure_boot_v2"); #define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) diff --git a/components/efuse/esp32/esp_efuse_fields.c b/components/efuse/esp32/esp_efuse_fields.c index db7fa933ad..bb4b1331ea 100644 --- a/components/efuse/esp32/esp_efuse_fields.c +++ b/components/efuse/esp32/esp_efuse_fields.c @@ -18,7 +18,7 @@ #include "sys/param.h" #include "soc/syscon_reg.h" -const static char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32/esp_efuse_utility.c b/components/efuse/esp32/esp_efuse_utility.c index 0d6db9c0bc..6040c644ae 100644 --- a/components/efuse/esp32/esp_efuse_utility.c +++ b/components/efuse/esp32/esp_efuse_utility.c @@ -13,7 +13,7 @@ #include "sdkconfig.h" #include -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; @@ -220,7 +220,7 @@ static void read_r_data(esp_efuse_block_t num_block, uint32_t* buf_r_data) } } -// This function just checkes that given data for blocks will not rise a coding issue during the burn operation. +// This function just checks that given data for blocks will not rise a coding issue during the burn operation. // Encoded data will be set during the burn operation. esp_err_t esp_efuse_utility_apply_new_coding_scheme() { diff --git a/components/efuse/esp32c2/esp_efuse_fields.c b/components/efuse/esp32c2/esp_efuse_fields.c index b40c635954..f147b88e87 100644 --- a/components/efuse/esp32c2/esp_efuse_fields.c +++ b/components/efuse/esp32c2/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32c2/esp_efuse_utility.c b/components/efuse/esp32c2/esp_efuse_utility.c index e66281cde4..0aae5dbea0 100644 --- a/components/efuse/esp32c2/esp_efuse_utility.c +++ b/components/efuse/esp32c2/esp_efuse_utility.c @@ -13,7 +13,7 @@ #include "esp_private/esp_clk.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32c3/esp_efuse_fields.c b/components/efuse/esp32c3/esp_efuse_fields.c index b2765c7cd5..1ccfe9de47 100644 --- a/components/efuse/esp32c3/esp_efuse_fields.c +++ b/components/efuse/esp32c3/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32c3/esp_efuse_utility.c b/components/efuse/esp32c3/esp_efuse_utility.c index caa07db1be..57f27dcaf1 100644 --- a/components/efuse/esp32c3/esp_efuse_utility.c +++ b/components/efuse/esp32c3/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32c5/esp_efuse_fields.c b/components/efuse/esp32c5/esp_efuse_fields.c index 853fbf5ae7..a4fd8b3a92 100644 --- a/components/efuse/esp32c5/esp_efuse_fields.c +++ b/components/efuse/esp32c5/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32c5/esp_efuse_utility.c b/components/efuse/esp32c5/esp_efuse_utility.c index 44262ee4f7..0515f93748 100644 --- a/components/efuse/esp32c5/esp_efuse_utility.c +++ b/components/efuse/esp32c5/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32c6/esp_efuse_fields.c b/components/efuse/esp32c6/esp_efuse_fields.c index e15d9e7547..4a4a598fa0 100644 --- a/components/efuse/esp32c6/esp_efuse_fields.c +++ b/components/efuse/esp32c6/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32c6/esp_efuse_utility.c b/components/efuse/esp32c6/esp_efuse_utility.c index 0278565e13..7669df8a0b 100644 --- a/components/efuse/esp32c6/esp_efuse_utility.c +++ b/components/efuse/esp32c6/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32c61/esp_efuse_fields.c b/components/efuse/esp32c61/esp_efuse_fields.c index 8d376b672f..7ca195887a 100644 --- a/components/efuse/esp32c61/esp_efuse_fields.c +++ b/components/efuse/esp32c61/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32c61/esp_efuse_utility.c b/components/efuse/esp32c61/esp_efuse_utility.c index 6ba812a65c..ef4598e029 100644 --- a/components/efuse/esp32c61/esp_efuse_utility.c +++ b/components/efuse/esp32c61/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32h2/esp_efuse_fields.c b/components/efuse/esp32h2/esp_efuse_fields.c index e15d9e7547..4a4a598fa0 100644 --- a/components/efuse/esp32h2/esp_efuse_fields.c +++ b/components/efuse/esp32h2/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32h2/esp_efuse_utility.c b/components/efuse/esp32h2/esp_efuse_utility.c index 7d0c66c9c8..e1da5d691d 100644 --- a/components/efuse/esp32h2/esp_efuse_utility.c +++ b/components/efuse/esp32h2/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32h21/esp_efuse_fields.c b/components/efuse/esp32h21/esp_efuse_fields.c index e4cb7d9319..bbbf2de962 100644 --- a/components/efuse/esp32h21/esp_efuse_fields.c +++ b/components/efuse/esp32h21/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32h21/esp_efuse_utility.c b/components/efuse/esp32h21/esp_efuse_utility.c index ab94484354..2216e8d42f 100644 --- a/components/efuse/esp32h21/esp_efuse_utility.c +++ b/components/efuse/esp32h21/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32h4/esp_efuse_fields.c b/components/efuse/esp32h4/esp_efuse_fields.c index 4643ab2d6d..3486b026fa 100644 --- a/components/efuse/esp32h4/esp_efuse_fields.c +++ b/components/efuse/esp32h4/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32h4/esp_efuse_utility.c b/components/efuse/esp32h4/esp_efuse_utility.c index f1484daa99..82896accf1 100644 --- a/components/efuse/esp32h4/esp_efuse_utility.c +++ b/components/efuse/esp32h4/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32p4/esp_efuse_fields.c b/components/efuse/esp32p4/esp_efuse_fields.c index 5bb0023b07..c7136d7306 100644 --- a/components/efuse/esp32p4/esp_efuse_fields.c +++ b/components/efuse/esp32p4/esp_efuse_fields.c @@ -16,7 +16,7 @@ #include "bootloader_random.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32p4/esp_efuse_utility.c b/components/efuse/esp32p4/esp_efuse_utility.c index e095721eff..7c9c36583a 100644 --- a/components/efuse/esp32p4/esp_efuse_utility.c +++ b/components/efuse/esp32p4/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "soc/efuse_periph.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32s2/esp_efuse_fields.c b/components/efuse/esp32s2/esp_efuse_fields.c index 618286882a..8672cb5d3d 100644 --- a/components/efuse/esp32s2/esp_efuse_fields.c +++ b/components/efuse/esp32s2/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32s2/esp_efuse_utility.c b/components/efuse/esp32s2/esp_efuse_utility.c index 2a9635fbc3..03560be94c 100644 --- a/components/efuse/esp32s2/esp_efuse_utility.c +++ b/components/efuse/esp32s2/esp_efuse_utility.c @@ -13,7 +13,7 @@ #include "esp_private/esp_clk.h" #include "hal/efuse_hal.h" -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/esp32s3/esp_efuse_fields.c b/components/efuse/esp32s3/esp_efuse_fields.c index 22b16bd6ad..be27900261 100644 --- a/components/efuse/esp32s3/esp_efuse_fields.c +++ b/components/efuse/esp32s3/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/esp32s3/esp_efuse_utility.c b/components/efuse/esp32s3/esp_efuse_utility.c index 1a6540ee00..99fcbb148b 100644 --- a/components/efuse/esp32s3/esp_efuse_utility.c +++ b/components/efuse/esp32s3/esp_efuse_utility.c @@ -12,7 +12,7 @@ #include "sdkconfig.h" #include -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_EFUSE_VIRTUAL extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/linux/esp_efuse_fields.c b/components/efuse/linux/esp_efuse_fields.c index dc675d6ab9..ce143f4fe6 100644 --- a/components/efuse/linux/esp_efuse_fields.c +++ b/components/efuse/linux/esp_efuse_fields.c @@ -15,7 +15,7 @@ #include "soc/efuse_periph.h" #include "sys/param.h" -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // Contains functions that provide access to efuse fields which are often used in IDF. diff --git a/components/efuse/linux/esp_efuse_utility.c b/components/efuse/linux/esp_efuse_utility.c index 25c69d0cad..a8af8c0b95 100644 --- a/components/efuse/linux/esp_efuse_utility.c +++ b/components/efuse/linux/esp_efuse_utility.c @@ -16,7 +16,7 @@ #error Linux target supports only VIRTUAL eFuses #endif // CONFIG_EFUSE_VIRTUAL -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); extern uint32_t virt_blocks[EFUSE_BLK_MAX][COUNT_EFUSE_REG_PER_BLOCK]; diff --git a/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c b/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c index 1fa4b07a67..ffa6352cb8 100644 --- a/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c +++ b/components/efuse/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c @@ -18,7 +18,7 @@ * This special field is called key_purpose. */ -const static char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); /** * @brief Keys and their attributes are packed into a structure diff --git a/components/efuse/src/efuse_controller/keys/without_key_purposes/one_key_block/esp_efuse_api_key.c b/components/efuse/src/efuse_controller/keys/without_key_purposes/one_key_block/esp_efuse_api_key.c index b22008807c..973d342138 100644 --- a/components/efuse/src/efuse_controller/keys/without_key_purposes/one_key_block/esp_efuse_api_key.c +++ b/components/efuse/src/efuse_controller/keys/without_key_purposes/one_key_block/esp_efuse_api_key.c @@ -20,7 +20,7 @@ static esp_err_t esp_efuse_set_key_purpose(esp_efuse_block_t block, esp_efuse_purpose_t purpose); -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); /** * @brief Keys and their attributes are packed into a structure diff --git a/components/efuse/src/efuse_controller/keys/without_key_purposes/three_key_blocks/esp_efuse_api_key.c b/components/efuse/src/efuse_controller/keys/without_key_purposes/three_key_blocks/esp_efuse_api_key.c index 688a19f66d..b3e6db52b4 100644 --- a/components/efuse/src/efuse_controller/keys/without_key_purposes/three_key_blocks/esp_efuse_api_key.c +++ b/components/efuse/src/efuse_controller/keys/without_key_purposes/three_key_blocks/esp_efuse_api_key.c @@ -18,7 +18,7 @@ * There are no eFuse key purpose fields (added only virtual key purposes to support key APIs). */ -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); /** * @brief Keys and their attributes are packed into a structure diff --git a/components/efuse/src/esp_efuse_api.c b/components/efuse/src/esp_efuse_api.c index 853a36e429..fba1434577 100644 --- a/components/efuse/src/esp_efuse_api.c +++ b/components/efuse/src/esp_efuse_api.c @@ -11,7 +11,7 @@ #include "sdkconfig.h" #include "esp_efuse_table.h" -const static char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef NON_OS_BUILD #define EFUSE_LOCK_ACQUIRE_RECURSIVE() diff --git a/components/efuse/src/esp_efuse_fields.c b/components/efuse/src/esp_efuse_fields.c index 9bd1ef6156..9bb94cea08 100644 --- a/components/efuse/src/esp_efuse_fields.c +++ b/components/efuse/src/esp_efuse_fields.c @@ -27,7 +27,7 @@ #include "hal/ecdsa_ll.h" #endif /* SOC_ECDSA_SUPPORTED */ -static __attribute__((unused)) const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); #ifdef CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD #define APP_SEC_VER_SIZE_EFUSE_FIELD CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD diff --git a/components/efuse/src/esp_efuse_startup.c b/components/efuse/src/esp_efuse_startup.c index 55403f9139..efbe360c1c 100644 --- a/components/efuse/src/esp_efuse_startup.c +++ b/components/efuse/src/esp_efuse_startup.c @@ -31,7 +31,7 @@ #include "esp_app_desc.h" #endif -static __attribute__((unused)) const char *TAG = "efuse_init"; +ESP_LOG_ATTR_TAG(TAG, "efuse_init"); ESP_SYSTEM_INIT_FN(init_efuse_check, CORE, BIT(0), 1) { @@ -48,7 +48,7 @@ ESP_SYSTEM_INIT_FN(init_efuse_show_app_info, CORE, BIT(0), 21) if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { ESP_EARLY_LOGI(TAG, "Min chip rev: v%d.%d", CONFIG_ESP_REV_MIN_FULL / 100, CONFIG_ESP_REV_MIN_FULL % 100); ESP_EARLY_LOGI(TAG, "Max chip rev: v%d.%d %s", CONFIG_ESP_REV_MAX_FULL / 100, CONFIG_ESP_REV_MAX_FULL % 100, - efuse_hal_get_disable_wafer_version_major() ? "(constraint ignored)" : ""); + efuse_hal_get_disable_wafer_version_major() ? ESP_LOG_ATTR_STR("(constraint ignored)") : ""); unsigned revision = efuse_hal_chip_revision(); ESP_EARLY_LOGI(TAG, "Chip rev: v%d.%d", revision / 100, revision % 100); } diff --git a/components/efuse/src/esp_efuse_utility.c b/components/efuse/src/esp_efuse_utility.c index 7afbda05ee..7660504776 100644 --- a/components/efuse/src/esp_efuse_utility.c +++ b/components/efuse/src/esp_efuse_utility.c @@ -13,7 +13,7 @@ #include "sdkconfig.h" #include -static const char *TAG = "efuse"; +ESP_LOG_ATTR_TAG(TAG, "efuse"); // This counter is used to implement independent read access for efuses. // During the read operation, the counter should be unchanged and even. diff --git a/components/efuse/test_apps/main/one_key_block/test_efuse.c b/components/efuse/test_apps/main/one_key_block/test_efuse.c index c02b387524..393cd021e4 100644 --- a/components/efuse/test_apps/main/one_key_block/test_efuse.c +++ b/components/efuse/test_apps/main/one_key_block/test_efuse.c @@ -21,7 +21,7 @@ #include "sdkconfig.h" #include "esp_rom_efuse.h" -__attribute__((unused)) static const char* TAG = "efuse_test"; +ESP_LOG_ATTR_TAG(TAG, "efuse_test"); #ifdef CONFIG_EFUSE_VIRTUAL diff --git a/components/efuse/test_apps/main/one_key_block/test_efuse_keys.c b/components/efuse/test_apps/main/one_key_block/test_efuse_keys.c index 8e0e9cd98a..655c87af9c 100644 --- a/components/efuse/test_apps/main/one_key_block/test_efuse_keys.c +++ b/components/efuse/test_apps/main/one_key_block/test_efuse_keys.c @@ -16,7 +16,7 @@ #include "esp_efuse_utility.h" #include "sdkconfig.h" -__attribute__((unused)) static const char* TAG = "efuse_key_test"; +ESP_LOG_ATTR_TAG(TAG, "efuse_key_test"); #ifdef CONFIG_EFUSE_VIRTUAL diff --git a/components/efuse/test_apps/main/test_efuse.c b/components/efuse/test_apps/main/test_efuse.c index 4aa63356f2..88af951f9f 100644 --- a/components/efuse/test_apps/main/test_efuse.c +++ b/components/efuse/test_apps/main/test_efuse.c @@ -30,7 +30,7 @@ #define TASK_PRIORITY (5) -__attribute__((unused)) static const char* TAG = "efuse_test"; +ESP_LOG_ATTR_TAG(TAG, "efuse_test"); static void test_read_blob(void) diff --git a/components/efuse/test_apps/main/three_key_blocks/test_efuse.c b/components/efuse/test_apps/main/three_key_blocks/test_efuse.c index 6fb28bfa13..2d2d3c9c1d 100644 --- a/components/efuse/test_apps/main/three_key_blocks/test_efuse.c +++ b/components/efuse/test_apps/main/three_key_blocks/test_efuse.c @@ -21,7 +21,7 @@ #include "sdkconfig.h" #include "esp_rom_efuse.h" -__attribute__((unused)) static const char* TAG = "efuse_test"; +ESP_LOG_ATTR_TAG(TAG, "efuse_test"); #ifdef CONFIG_EFUSE_VIRTUAL diff --git a/components/efuse/test_apps/main/with_key_purposes/test_efuse.c b/components/efuse/test_apps/main/with_key_purposes/test_efuse.c index 9d2600a26d..7a3c0703fa 100644 --- a/components/efuse/test_apps/main/with_key_purposes/test_efuse.c +++ b/components/efuse/test_apps/main/with_key_purposes/test_efuse.c @@ -21,7 +21,7 @@ #include "sdkconfig.h" #include "esp_rom_efuse.h" -__attribute__((unused)) static const char* TAG = "efuse_test"; +ESP_LOG_ATTR_TAG(TAG, "efuse_test"); #ifdef CONFIG_EFUSE_VIRTUAL diff --git a/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c b/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c index c27d3d59b7..f7602bc14e 100644 --- a/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c +++ b/components/efuse/test_apps/main/with_key_purposes/test_efuse_keys.c @@ -16,7 +16,7 @@ #include "esp_efuse_utility.h" #include "sdkconfig.h" -__attribute__((unused)) static const char* TAG = "efuse_key_test"; +ESP_LOG_ATTR_TAG(TAG, "efuse_key_test"); #ifdef CONFIG_EFUSE_VIRTUAL diff --git a/components/esp_app_format/esp_app_desc.c b/components/esp_app_format/esp_app_desc.c index 6b68b618d0..eb169aebd7 100644 --- a/components/esp_app_format/esp_app_desc.c +++ b/components/esp_app_format/esp_app_desc.c @@ -16,7 +16,7 @@ #if !CONFIG_IDF_TARGET_LINUX && !ESP_TEE_BUILD #include "esp_private/startup_internal.h" -static const char *TAG = "app_init"; +ESP_LOG_ATTR_TAG(TAG, "app_init"); #endif // Application version info diff --git a/components/esp_common/test_apps/esp_common/main/test_attr.c b/components/esp_common/test_apps/esp_common/main/test_attr.c index 0dad47c982..d349c93b5a 100644 --- a/components/esp_common/test_apps/esp_common/main/test_attr.c +++ b/components/esp_common/test_apps/esp_common/main/test_attr.c @@ -19,7 +19,7 @@ #define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) -static const char *TAG = "attr_test"; +ESP_LOG_ATTR_TAG(TAG, "attr_test"); extern int _rtc_noinit_start; extern int _rtc_noinit_end; diff --git a/components/esp_hal_i2c/test_apps/hal_i2c/components/hal_i2c/hal_i2c.c b/components/esp_hal_i2c/test_apps/hal_i2c/components/hal_i2c/hal_i2c.c index 678e64a1c4..62d2065ccd 100644 --- a/components/esp_hal_i2c/test_apps/hal_i2c/components/hal_i2c/hal_i2c.c +++ b/components/esp_hal_i2c/test_apps/hal_i2c/components/hal_i2c/hal_i2c.c @@ -36,7 +36,7 @@ static inline uint32_t time_get_us_by_ccount(uint32_t counter) #define NOT_CHECK_ACK_VALUE (0) #define CHECK_ACK_VALUE (1) -static const char *TAG = "hal-i2c"; +ESP_LOG_ATTR_TAG(TAG, "hal-i2c"); // If Reset and Clock Control is independent, we need this macro to avoid concurrency issue #if !SOC_RCC_IS_INDEPENDENT diff --git a/components/esp_hal_i2c/test_apps/hal_i2c/main/hal_i2c_main.c b/components/esp_hal_i2c/test_apps/hal_i2c/main/hal_i2c_main.c index f7aa78110e..af2a2e42a5 100644 --- a/components/esp_hal_i2c/test_apps/hal_i2c/main/hal_i2c_main.c +++ b/components/esp_hal_i2c/test_apps/hal_i2c/main/hal_i2c_main.c @@ -17,7 +17,7 @@ #define TIMEOUT_MS (20) static const uint8_t slave_address = 0x50; -static const char *TAG = "hal_i2c_main"; +ESP_LOG_ATTR_TAG(TAG, "hal_i2c_main"); void app_main(void) { diff --git a/components/esp_hw_support/adc_share_hw_ctrl.c b/components/esp_hw_support/adc_share_hw_ctrl.c index e11b35eb66..15a6bfd235 100644 --- a/components/esp_hw_support/adc_share_hw_ctrl.c +++ b/components/esp_hw_support/adc_share_hw_ctrl.c @@ -39,7 +39,7 @@ #endif -static const char *TAG = "adc_share_hw_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "adc_share_hw_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/clk_ctrl_os.c b/components/esp_hw_support/clk_ctrl_os.c index 88e263cc6d..559a57748c 100644 --- a/components/esp_hw_support/clk_ctrl_os.c +++ b/components/esp_hw_support/clk_ctrl_os.c @@ -18,7 +18,7 @@ #endif #if SOC_CLK_APLL_SUPPORTED || SOC_CLK_MPLL_SUPPORTED -static const char *TAG = "clk_ctrl_os"; +ESP_LOG_ATTR_TAG(TAG, "clk_ctrl_os"); #endif static portMUX_TYPE __attribute__((unused)) periph_spinlock = portMUX_INITIALIZER_UNLOCKED; diff --git a/components/esp_hw_support/debug_probe/debug_probe.c b/components/esp_hw_support/debug_probe/debug_probe.c index 005bb87fa5..f1824e42cf 100644 --- a/components/esp_hw_support/debug_probe/debug_probe.c +++ b/components/esp_hw_support/debug_probe/debug_probe.c @@ -22,7 +22,7 @@ #include "esp_private/esp_gpio_reserve.h" #include "esp_rom_gpio.h" -static const char *TAG = "dbg_probe"; +ESP_LOG_ATTR_TAG(TAG, "dbg_probe"); typedef struct debug_probe_unit_t debug_probe_unit_t; typedef struct debug_probe_channel_t debug_probe_channel_t; diff --git a/components/esp_hw_support/dma/async_memcpy_cp_dma.c b/components/esp_hw_support/dma/async_memcpy_cp_dma.c index 3ea1e5d211..7030085e12 100644 --- a/components/esp_hw_support/dma/async_memcpy_cp_dma.c +++ b/components/esp_hw_support/dma/async_memcpy_cp_dma.c @@ -25,7 +25,7 @@ #include "hal/cp_dma_hal.h" #include "hal/cp_dma_ll.h" -static const char *TAG = "async_mcp.cpdma"; +ESP_LOG_ATTR_TAG(TAG, "async_mcp.cpdma"); #define MCP_DMA_DESCRIPTOR_BUFFER_MAX_SIZE 4095 diff --git a/components/esp_hw_support/dma/async_memcpy_gdma.c b/components/esp_hw_support/dma/async_memcpy_gdma.c index a962e31215..60e3bd1276 100644 --- a/components/esp_hw_support/dma/async_memcpy_gdma.c +++ b/components/esp_hw_support/dma/async_memcpy_gdma.c @@ -27,7 +27,7 @@ #include "hal/cache_ll.h" #include "hal/gdma_ll.h" -static const char *TAG = "async_mcp.gdma"; +ESP_LOG_ATTR_TAG(TAG, "async_mcp.gdma"); #define MCP_DMA_DESCRIPTOR_BUFFER_MAX_SIZE 4095 diff --git a/components/esp_hw_support/dma/dma2d.c b/components/esp_hw_support/dma/dma2d.c index eea35d061d..6add3aa581 100644 --- a/components/esp_hw_support/dma/dma2d.c +++ b/components/esp_hw_support/dma/dma2d.c @@ -40,7 +40,7 @@ * complete the transactions. */ -static const char *TAG = "dma2d"; +ESP_LOG_ATTR_TAG(TAG, "dma2d"); typedef struct dma2d_platform_t { _lock_t mutex; // platform level mutex lock to protect the dma2d_acquire_pool/dma2d_release_pool process diff --git a/components/esp_hw_support/dma/dw_gdma.c b/components/esp_hw_support/dma/dw_gdma.c index d3d71e8965..ac850daf2f 100644 --- a/components/esp_hw_support/dma/dw_gdma.c +++ b/components/esp_hw_support/dma/dw_gdma.c @@ -32,7 +32,7 @@ #include "hal/cache_ll.h" #include "esp_cache.h" -static const char *TAG = "dw-gdma"; +ESP_LOG_ATTR_TAG(TAG, "dw-gdma"); #if !SOC_RCC_IS_INDEPENDENT // Reset and Clock Control registers are mixing with other peripherals, so we need to use a critical section diff --git a/components/esp_hw_support/dma/esp_async_memcpy.c b/components/esp_hw_support/dma/esp_async_memcpy.c index c57c92fa12..47d4840463 100644 --- a/components/esp_hw_support/dma/esp_async_memcpy.c +++ b/components/esp_hw_support/dma/esp_async_memcpy.c @@ -8,7 +8,7 @@ #include "esp_async_memcpy.h" #include "esp_async_memcpy_priv.h" -static const char *TAG = "async_mcp"; +ESP_LOG_ATTR_TAG(TAG, "async_mcp"); esp_err_t esp_async_memcpy_uninstall(async_memcpy_handle_t asmcp) { diff --git a/components/esp_hw_support/dma/esp_dma_utils.c b/components/esp_hw_support/dma/esp_dma_utils.c index 9a0785602d..c098f0f89e 100644 --- a/components/esp_hw_support/dma/esp_dma_utils.c +++ b/components/esp_hw_support/dma/esp_dma_utils.c @@ -21,7 +21,7 @@ #include "hal/cache_ll.h" #include "esp_cache.h" -static const char *TAG = "dma_utils"; +ESP_LOG_ATTR_TAG(TAG, "dma_utils"); #define ALIGN_UP_BY(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) diff --git a/components/esp_hw_support/dma/gdma.c b/components/esp_hw_support/dma/gdma.c index 5be8a8050b..3129a88f1d 100644 --- a/components/esp_hw_support/dma/gdma.c +++ b/components/esp_hw_support/dma/gdma.c @@ -74,6 +74,8 @@ typedef struct { void (*hal_init)(gdma_hal_context_t *hal, const gdma_hal_config_t *config); } gdma_channel_search_info_t; +ESP_LOG_ATTR_TAG(TAG, "gdma"); + static esp_err_t do_allocate_gdma_channel(const gdma_channel_search_info_t *search_info, const gdma_channel_alloc_config_t *config, gdma_channel_handle_t *ret_chan) { esp_err_t ret = ESP_OK; diff --git a/components/esp_hw_support/dma/gdma_crc.c b/components/esp_hw_support/dma/gdma_crc.c index 0979f32703..e6e002d13b 100644 --- a/components/esp_hw_support/dma/gdma_crc.c +++ b/components/esp_hw_support/dma/gdma_crc.c @@ -6,6 +6,8 @@ #include "gdma_priv.h" +ESP_LOG_ATTR_TAG(TAG, "gdma"); + esp_err_t gdma_config_crc_calculator(gdma_channel_handle_t dma_chan, const gdma_crc_calculator_config_t *config) { ESP_RETURN_ON_FALSE(dma_chan && config, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); diff --git a/components/esp_hw_support/dma/gdma_etm.c b/components/esp_hw_support/dma/gdma_etm.c index c0e9be8191..02ef905fee 100644 --- a/components/esp_hw_support/dma/gdma_etm.c +++ b/components/esp_hw_support/dma/gdma_etm.c @@ -9,6 +9,8 @@ #define ETM_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT +ESP_LOG_ATTR_TAG(TAG, "gdma"); + typedef struct gdma_etm_task_t { esp_etm_task_t base; gdma_channel_t *chan; diff --git a/components/esp_hw_support/dma/gdma_link.c b/components/esp_hw_support/dma/gdma_link.c index c5be2cfcf3..46e3d1df7c 100644 --- a/components/esp_hw_support/dma/gdma_link.c +++ b/components/esp_hw_support/dma/gdma_link.c @@ -17,7 +17,7 @@ #include "hal/cache_ll.h" #include "esp_cache.h" -static const char *TAG = "gdma-link"; +ESP_LOG_ATTR_TAG(TAG, "gdma-link"); #if SOC_NON_CACHEABLE_OFFSET #define GDMA_CACHE_ADDR_TO_NON_CACHE_ADDR(addr) ((addr) + SOC_NON_CACHEABLE_OFFSET) diff --git a/components/esp_hw_support/dma/gdma_priv.h b/components/esp_hw_support/dma/gdma_priv.h index 4c0d921a59..0cccfa97ed 100644 --- a/components/esp_hw_support/dma/gdma_priv.h +++ b/components/esp_hw_support/dma/gdma_priv.h @@ -42,9 +42,6 @@ #define GDMA_ACCESS_ENCRYPTION_MEM_ALIGNMENT 16 /*!< The alignment of the memory and size when DMA accesses the encryption memory */ -///!< Logging settings -#define TAG "gdma" - #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp_hw_support/dma/gdma_sleep_retention.c b/components/esp_hw_support/dma/gdma_sleep_retention.c index 7deb476dac..6c8eeaf29c 100644 --- a/components/esp_hw_support/dma/gdma_sleep_retention.c +++ b/components/esp_hw_support/dma/gdma_sleep_retention.c @@ -13,6 +13,8 @@ typedef struct { int pair_id; } gdma_channel_retention_arg_t; +ESP_LOG_ATTR_TAG(TAG, "gdma"); + static esp_err_t sleep_gdma_channel_retention_init(void *arg) { gdma_channel_retention_arg_t *parg = (gdma_channel_retention_arg_t *)arg; diff --git a/components/esp_hw_support/esp_clock_output.c b/components/esp_hw_support/esp_clock_output.c index ff5a03fae6..4357aefd7f 100644 --- a/components/esp_hw_support/esp_clock_output.c +++ b/components/esp_hw_support/esp_clock_output.c @@ -38,7 +38,7 @@ typedef struct esp_clock_output_mapping { SLIST_ENTRY(esp_clock_output_mapping) next; } esp_clock_output_mapping_t; -static const char *TAG = "esp_clock_output"; +ESP_LOG_ATTR_TAG(TAG, "esp_clock_output"); static SLIST_HEAD(esp_clock_output_mapping_head, esp_clock_output_mapping) s_mapping_list = SLIST_HEAD_INITIALIZER(s_mapping_list_head); static portMUX_TYPE __attribute__((unused)) s_mapping_list_lock = portMUX_INITIALIZER_UNLOCKED; diff --git a/components/esp_hw_support/etm/esp_etm.c b/components/esp_hw_support/etm/esp_etm.c index 933aeb3ff2..8ee03a9b8b 100644 --- a/components/esp_hw_support/etm/esp_etm.c +++ b/components/esp_hw_support/etm/esp_etm.c @@ -39,7 +39,7 @@ #define ETM_RCC_ATOMIC() #endif -#define TAG "etm" +ESP_LOG_ATTR_TAG(TAG, "etm"); typedef struct etm_platform_t etm_platform_t; typedef struct etm_group_t etm_group_t; diff --git a/components/esp_hw_support/intr_alloc.c b/components/esp_hw_support/intr_alloc.c index 7469c56dd7..c1ef5505a1 100644 --- a/components/esp_hw_support/intr_alloc.c +++ b/components/esp_hw_support/intr_alloc.c @@ -40,7 +40,7 @@ /* For targets that uses a CLIC as their interrupt controller, CPU_INT_LINES_COUNT represents the external interrupts count */ #define CPU_INT_LINES_COUNT 32 -static const char* TAG = "intr_alloc"; +ESP_LOG_ATTR_TAG(TAG, "intr_alloc"); #define ETS_INTERNAL_TIMER0_INTR_NO 6 #define ETS_INTERNAL_TIMER1_INTR_NO 15 diff --git a/components/esp_hw_support/ldo/esp_ldo_regulator.c b/components/esp_hw_support/ldo/esp_ldo_regulator.c index 0d598bf6d1..f1e5bd6caa 100644 --- a/components/esp_hw_support/ldo/esp_ldo_regulator.c +++ b/components/esp_hw_support/ldo/esp_ldo_regulator.c @@ -16,7 +16,7 @@ #include "esp_ldo_regulator.h" #include "esp_private/critical_section.h" -static const char *TAG = "ldo"; +ESP_LOG_ATTR_TAG(TAG, "ldo"); typedef struct ldo_regulator_channel_t { int chan_id; diff --git a/components/esp_hw_support/lowpower/port/esp32c3/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32c3/sleep_cpu.c index 372fc2d066..ccae7a6628 100644 --- a/components/esp_hw_support/lowpower/port/esp32c3/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32c3/sleep_cpu.c @@ -25,7 +25,7 @@ #include "sdkconfig.h" -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); typedef struct { uint32_t start; diff --git a/components/esp_hw_support/lowpower/port/esp32c5/sleep_clock.c b/components/esp_hw_support/lowpower/port/esp32c5/sleep_clock.c index 4fede4f136..0b1a1fba57 100644 --- a/components/esp_hw_support/lowpower/port/esp32c5/sleep_clock.c +++ b/components/esp_hw_support/lowpower/port/esp32c5/sleep_clock.c @@ -15,7 +15,7 @@ #include "soc/chip_revision.h" #include "hal/efuse_hal.h" -static const char *TAG = "sleep_clock"; +ESP_LOG_ATTR_TAG(TAG, "sleep_clock"); esp_err_t sleep_clock_system_retention_init(void *arg) { diff --git a/components/esp_hw_support/lowpower/port/esp32c5/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32c5/sleep_cpu.c index cf86f77d1f..7185d5e3b6 100644 --- a/components/esp_hw_support/lowpower/port/esp32c5/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32c5/sleep_cpu.c @@ -36,7 +36,7 @@ #endif -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); static DRAM_ATTR sleep_cpu_retention_t s_cpu_retention; diff --git a/components/esp_hw_support/lowpower/port/esp32c5/sleep_mmu.c b/components/esp_hw_support/lowpower/port/esp32c5/sleep_mmu.c index 3a1cad1728..e93fa3eda8 100644 --- a/components/esp_hw_support/lowpower/port/esp32c5/sleep_mmu.c +++ b/components/esp_hw_support/lowpower/port/esp32c5/sleep_mmu.c @@ -18,7 +18,7 @@ #include "soc/spi_mem_reg.h" #include "esp_private/startup_internal.h" -static const char *TAG = "sleep_mmu"; +ESP_LOG_ATTR_TAG(TAG, "sleep_mmu"); typedef struct { uint32_t start; diff --git a/components/esp_hw_support/lowpower/port/esp32c5/sleep_modem_state.c b/components/esp_hw_support/lowpower/port/esp32c5/sleep_modem_state.c index c2881711da..d4e029131b 100644 --- a/components/esp_hw_support/lowpower/port/esp32c5/sleep_modem_state.c +++ b/components/esp_hw_support/lowpower/port/esp32c5/sleep_modem_state.c @@ -34,7 +34,7 @@ #define MODEM_FE_DATA_BASE (0x600a0400) #define MODEM_FE_CTRL_BASE (0x600a0800) -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); #if SOC_PM_PAU_REGDMA_LINK_IDX_WIFIMAC static esp_err_t sleep_modem_state_phy_wifi_init(void *arg) diff --git a/components/esp_hw_support/lowpower/port/esp32c6/sleep_clock.c b/components/esp_hw_support/lowpower/port/esp32c6/sleep_clock.c index 269178b969..809092647d 100644 --- a/components/esp_hw_support/lowpower/port/esp32c6/sleep_clock.c +++ b/components/esp_hw_support/lowpower/port/esp32c6/sleep_clock.c @@ -11,7 +11,7 @@ #include "modem/modem_lpcon_reg.h" #include "modem/modem_syscon_reg.h" -static const char *TAG = "sleep_clock"; +ESP_LOG_ATTR_TAG(TAG, "sleep_clock"); esp_err_t sleep_clock_system_retention_init(void *arg) { diff --git a/components/esp_hw_support/lowpower/port/esp32c6/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32c6/sleep_cpu.c index 1b39c68fff..58625074f7 100644 --- a/components/esp_hw_support/lowpower/port/esp32c6/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32c6/sleep_cpu.c @@ -51,7 +51,7 @@ #define CUSTOM_CSR_CO_AIA 0x7f2 -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); static DRAM_ATTR sleep_cpu_retention_t s_cpu_retention; diff --git a/components/esp_hw_support/lowpower/port/esp32c61/sleep_clock.c b/components/esp_hw_support/lowpower/port/esp32c61/sleep_clock.c index c123f58cdc..aa99bf8b89 100644 --- a/components/esp_hw_support/lowpower/port/esp32c61/sleep_clock.c +++ b/components/esp_hw_support/lowpower/port/esp32c61/sleep_clock.c @@ -12,7 +12,7 @@ #include "modem/modem_lpcon_reg.h" #include "modem/modem_syscon_reg.h" -static const char *TAG = "sleep_clock"; +ESP_LOG_ATTR_TAG(TAG, "sleep_clock"); esp_err_t sleep_clock_system_retention_init(void *arg) { diff --git a/components/esp_hw_support/lowpower/port/esp32c61/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32c61/sleep_cpu.c index 7ca3e2a268..dd228fd946 100644 --- a/components/esp_hw_support/lowpower/port/esp32c61/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32c61/sleep_cpu.c @@ -35,7 +35,7 @@ #include "hal/uart_hal.h" #endif -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); static DRAM_ATTR sleep_cpu_retention_t s_cpu_retention; diff --git a/components/esp_hw_support/lowpower/port/esp32h2/sleep_clock.c b/components/esp_hw_support/lowpower/port/esp32h2/sleep_clock.c index 94fb2886fe..9d57f16ba7 100644 --- a/components/esp_hw_support/lowpower/port/esp32h2/sleep_clock.c +++ b/components/esp_hw_support/lowpower/port/esp32h2/sleep_clock.c @@ -11,7 +11,7 @@ #include "modem/modem_lpcon_reg.h" -static const char *TAG = "sleep_clock"; +ESP_LOG_ATTR_TAG(TAG, "sleep_clock"); esp_err_t sleep_clock_system_retention_init(void *arg) { diff --git a/components/esp_hw_support/lowpower/port/esp32h2/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32h2/sleep_cpu.c index 632bfd510f..bf673f4a69 100644 --- a/components/esp_hw_support/lowpower/port/esp32h2/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32h2/sleep_cpu.c @@ -35,7 +35,7 @@ #include "hal/uart_hal.h" #endif -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); static DRAM_ATTR sleep_cpu_retention_t s_cpu_retention; diff --git a/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock.c b/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock.c index 74ec50da5c..7f8932a736 100644 --- a/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock.c +++ b/components/esp_hw_support/lowpower/port/esp32h21/sleep_clock.c @@ -11,7 +11,7 @@ #include "modem/modem_lpcon_reg.h" -static const char *TAG = "sleep_clock"; +ESP_LOG_ATTR_TAG(TAG, "sleep_clock"); esp_err_t sleep_clock_system_retention_init(void *arg) { diff --git a/components/esp_hw_support/lowpower/port/esp32h21/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32h21/sleep_cpu.c index 9b3c3877fb..356ccaa310 100644 --- a/components/esp_hw_support/lowpower/port/esp32h21/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32h21/sleep_cpu.c @@ -36,7 +36,7 @@ #include "hal/uart_hal.h" #endif -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); typedef struct { uint32_t start; diff --git a/components/esp_hw_support/lowpower/port/esp32p4/sleep_clock.c b/components/esp_hw_support/lowpower/port/esp32p4/sleep_clock.c index 36c06306b9..bc765058a5 100644 --- a/components/esp_hw_support/lowpower/port/esp32p4/sleep_clock.c +++ b/components/esp_hw_support/lowpower/port/esp32p4/sleep_clock.c @@ -10,7 +10,7 @@ #include "soc/lpperi_reg.h" #include "pmu_bit_defs.h" -static const char *TAG = "sleep_clock"; +ESP_LOG_ATTR_TAG(TAG, "sleep_clock"); esp_err_t sleep_clock_system_retention_init(void *arg) { diff --git a/components/esp_hw_support/lowpower/port/esp32p4/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32p4/sleep_cpu.c index 55bdbad1e7..cc0ca2c40c 100644 --- a/components/esp_hw_support/lowpower/port/esp32p4/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32p4/sleep_cpu.c @@ -44,7 +44,7 @@ static TCM_DRAM_ATTR smp_retention_state_t s_smp_retention_state[portNUM_PROCESS #endif -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); static TCM_DRAM_ATTR __attribute__((unused)) sleep_cpu_retention_t s_cpu_retention; diff --git a/components/esp_hw_support/lowpower/port/esp32s3/sleep_cpu.c b/components/esp_hw_support/lowpower/port/esp32s3/sleep_cpu.c index 14edd6563c..efdab5f71a 100644 --- a/components/esp_hw_support/lowpower/port/esp32s3/sleep_cpu.c +++ b/components/esp_hw_support/lowpower/port/esp32s3/sleep_cpu.c @@ -26,7 +26,7 @@ #include "hal/rtc_hal.h" #include "esp32s3/rom/cache.h" -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); typedef struct { uint32_t start; diff --git a/components/esp_hw_support/mac_addr.c b/components/esp_hw_support/mac_addr.c index 6059a92aaf..f52c3f2aa2 100644 --- a/components/esp_hw_support/mac_addr.c +++ b/components/esp_hw_support/mac_addr.c @@ -25,7 +25,7 @@ #define ESP_MAC_ADDRESS_LEN 6 #endif -static const char *TAG = "system_api"; +ESP_LOG_ATTR_TAG(TAG, "system_api"); typedef enum { STATE_INIT = 0, diff --git a/components/esp_hw_support/mipi_csi_share_hw_ctrl.c b/components/esp_hw_support/mipi_csi_share_hw_ctrl.c index b35438aa9a..c6c681449f 100644 --- a/components/esp_hw_support/mipi_csi_share_hw_ctrl.c +++ b/components/esp_hw_support/mipi_csi_share_hw_ctrl.c @@ -27,7 +27,7 @@ static csi_brg_share_ctx_t s_ctx = { .spinlock = portMUX_INITIALIZER_UNLOCKED, }; -static const char *TAG = "CSI_SHARE"; +ESP_LOG_ATTR_TAG(TAG, "CSI_SHARE"); esp_err_t mipi_csi_brg_claim(mipi_csi_brg_user_t user, int *out_id) { diff --git a/components/esp_hw_support/mspi_timing_tuning/port/esp32c5/mspi_timing_config.c b/components/esp_hw_support/mspi_timing_tuning/port/esp32c5/mspi_timing_config.c index 97ccddfd1e..6d491dd688 100644 --- a/components/esp_hw_support/mspi_timing_tuning/port/esp32c5/mspi_timing_config.c +++ b/components/esp_hw_support/mspi_timing_tuning/port/esp32c5/mspi_timing_config.c @@ -22,7 +22,7 @@ #define PSRAM_LOW_SPEED_CORE_CLOCK_MHZ MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT #define PSRAM_HIGH_SPEED_CORE_CLOCK_MHZ MSPI_TIMING_CORE_CLOCK_MHZ -const static char *TAG = "MSPI Timing"; +ESP_LOG_ATTR_TAG(TAG, "MSPI Timing"); //-------------------------------------MSPI Clock Setting-------------------------------------// static void s_mspi_flash_set_core_clock(uint8_t mspi_id, uint32_t core_clock_mhz) diff --git a/components/esp_hw_support/mspi_timing_tuning/port/esp32p4/mspi_timing_config.c b/components/esp_hw_support/mspi_timing_tuning/port/esp32p4/mspi_timing_config.c index d99b6558cf..ae0c57789a 100644 --- a/components/esp_hw_support/mspi_timing_tuning/port/esp32p4/mspi_timing_config.c +++ b/components/esp_hw_support/mspi_timing_tuning/port/esp32p4/mspi_timing_config.c @@ -18,7 +18,7 @@ #include "hal/mspi_ll.h" #include "soc/hp_sys_clkrst_struct.h" -const static char *TAG = "MSPI Timing"; +ESP_LOG_ATTR_TAG(TAG, "MSPI Timing"); //-------------------------------------MSPI Clock Setting-------------------------------------// void mspi_timing_config_set_psram_clock(uint32_t psram_freq_mhz, mspi_timing_speed_mode_t speed_mode, bool control_both_mspi) diff --git a/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/mspi_timing_by_mspi_delay.c b/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/mspi_timing_by_mspi_delay.c index b00e8d1581..5429bef029 100644 --- a/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/mspi_timing_by_mspi_delay.c +++ b/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/mspi_timing_by_mspi_delay.c @@ -50,7 +50,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////// #if MSPI_TIMING_FLASH_NEEDS_TUNING || MSPI_TIMING_PSRAM_NEEDS_TUNING -const static char *TAG = "MSPI Timing"; +ESP_LOG_ATTR_TAG(TAG, "MSPI Timing"); //If one of the FLASH / PSRAM or both of them need timing tuning, we should build following code typedef enum { diff --git a/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_dqs.c b/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_dqs.c index 79ec3b0db9..c8267c37ae 100644 --- a/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_dqs.c +++ b/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_dqs.c @@ -45,7 +45,7 @@ #define WRONG_DELAYLINE 16 -const static char *TAG = "MSPI DQS"; +ESP_LOG_ATTR_TAG(TAG, "MSPI DQS"); const static uint32_t s_test_data[MSPI_TIMING_TEST_DATA_LEN] = {0x7f786655, 0xa5ff005a, 0x3f3c33aa, 0xa5ff5a00, 0x1f1e9955, 0xa5005aff, 0x0f0fccaa, 0xa55a00ff, 0x07876655, 0xffa55a00, 0x03c333aa, 0xff00a55a, 0x01e19955, 0xff005aa5, 0x00f0ccaa, 0xff5a00a5, 0x80786655, 0x00a5ff5a, 0xc03c33aa, 0x00a55aff, 0xe01e9355, 0x00ff5aa5, 0xf00fccaa, 0x005affa5, diff --git a/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_flash_delay.c b/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_flash_delay.c index 3d158a1afc..805aeda0a7 100644 --- a/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_flash_delay.c +++ b/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_flash_delay.c @@ -25,7 +25,7 @@ #include "hal/mspi_ll.h" #include "rom/spi_flash.h" -const static char *TAG = "Flash Delay"; +ESP_LOG_ATTR_TAG(TAG, "Flash Delay"); void mspi_timing_flash_init(uint32_t flash_freq_mhz) { diff --git a/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_mspi_delay.c b/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_mspi_delay.c index ca3efb5b49..38c2092303 100644 --- a/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_mspi_delay.c +++ b/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/mspi_timing_by_mspi_delay.c @@ -31,7 +31,7 @@ #define QPI_PSRAM_WRITE 0X38 #define QPI_PSRAM_FAST_READ_DUMMY 6 -const static char *TAG = "MSPI Timing"; +ESP_LOG_ATTR_TAG(TAG, "MSPI Timing"); //-------------------------------------FLASH timing tuning register config-------------------------------------// void mspi_timing_get_flash_tuning_configs(mspi_timing_config_t *config) diff --git a/components/esp_hw_support/port/esp32/esp_clk_tree.c b/components/esp_hw_support/port/esp32/esp_clk_tree.c index 1e6670f950..b12f7bd13f 100644 --- a/components/esp_hw_support/port/esp32/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32/rtc_clk.c b/components/esp_hw_support/port/esp32/rtc_clk.c index b552519016..34844033ba 100644 --- a/components/esp_hw_support/port/esp32/rtc_clk.c +++ b/components/esp_hw_support/port/esp32/rtc_clk.c @@ -40,7 +40,7 @@ static void rtc_clk_cpu_freq_to_pll_mhz(int cpu_freq_mhz); // Current PLL frequency, in MHZ (320 or 480). Zero if PLL is not enabled. static uint32_t s_cur_pll_freq; -static const char* TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); static void rtc_clk_32k_enable_common(clk_ll_xtal32k_enable_mode_t mode) { diff --git a/components/esp_hw_support/port/esp32/rtc_clk_init.c b/components/esp_hw_support/port/esp32/rtc_clk_init.c index 6bb3df7a13..896ae39ac1 100644 --- a/components/esp_hw_support/port/esp32/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32/rtc_clk_init.c @@ -26,7 +26,7 @@ static soc_xtal_freq_t rtc_clk_xtal_freq_estimate(void); extern void rtc_clk_cpu_freq_to_xtal(int freq, int div); -static const char* TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32/rtc_time.c b/components/esp_hw_support/port/esp32/rtc_time.c index 8b8e7bca5b..6b0025012f 100644 --- a/components/esp_hw_support/port/esp32/rtc_time.c +++ b/components/esp_hw_support/port/esp32/rtc_time.c @@ -14,7 +14,7 @@ #include "esp_hw_log.h" #include "esp_private/periph_ctrl.h" -static const char *TAG = "rtc_time"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_time"); /* Calibration of RTC_SLOW_CLK is performed using a special feature of TIMG0. * This feature counts the number of XTAL clock cycles within a given number of diff --git a/components/esp_hw_support/port/esp32/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32/sar_periph_ctrl.c index 0eba0ac74b..3aef42c374 100644 --- a/components/esp_hw_support/port/esp32/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32/sar_periph_ctrl.c @@ -21,7 +21,7 @@ #include "esp_private/critical_section.h" #include "hal/sar_ctrl_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32c2/esp_clk_tree.c b/components/esp_hw_support/port/esp32c2/esp_clk_tree.c index dda7b7bbb0..de31da2167 100644 --- a/components/esp_hw_support/port/esp32c2/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32c2/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32c2/rtc_clk.c b/components/esp_hw_support/port/esp32c2/rtc_clk.c index 14787fdf33..36604d7b94 100644 --- a/components/esp_hw_support/port/esp32c2/rtc_clk.c +++ b/components/esp_hw_support/port/esp32c2/rtc_clk.c @@ -22,7 +22,7 @@ #include "hal/clk_tree_ll.h" #include "hal/regi2c_ctrl_ll.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 480MHZ. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32c2/rtc_clk_init.c b/components/esp_hw_support/port/esp32c2/rtc_clk_init.c index 1e064313a7..a1bffae372 100644 --- a/components/esp_hw_support/port/esp32c2/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32c2/rtc_clk_init.c @@ -19,7 +19,7 @@ #include "sdkconfig.h" #include "esp_rom_serial_output.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32c2/rtc_init.c b/components/esp_hw_support/port/esp32c2/rtc_init.c index 4f734f20e5..d876077e34 100644 --- a/components/esp_hw_support/port/esp32c2/rtc_init.c +++ b/components/esp_hw_support/port/esp32c2/rtc_init.c @@ -23,7 +23,7 @@ #include "esp_private/sar_periph_ctrl.h" #endif -static const char *TAG = "rtc_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_init"); static void set_ocode_by_efuse(int ocode_scheme_ver); static void calibrate_ocode(void); diff --git a/components/esp_hw_support/port/esp32c2/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32c2/sar_periph_ctrl.c index b5ab89cb7d..8601bf5097 100644 --- a/components/esp_hw_support/port/esp32c2/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32c2/sar_periph_ctrl.c @@ -24,7 +24,7 @@ #include "hal/sar_ctrl_ll.h" #include "hal/adc_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32c3/esp_clk_tree.c b/components/esp_hw_support/port/esp32c3/esp_clk_tree.c index cf885a4234..2c8c348b94 100644 --- a/components/esp_hw_support/port/esp32c3/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32c3/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32c3/rtc_clk.c b/components/esp_hw_support/port/esp32c3/rtc_clk.c index aaa391d0ac..bece066c44 100644 --- a/components/esp_hw_support/port/esp32c3/rtc_clk.c +++ b/components/esp_hw_support/port/esp32c3/rtc_clk.c @@ -20,7 +20,7 @@ #include "hal/clk_tree_ll.h" #include "hal/regi2c_ctrl_ll.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in MHZ (320 or 480). Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32c3/rtc_clk_init.c b/components/esp_hw_support/port/esp32c3/rtc_clk_init.c index f0530f6688..666d5c4da6 100644 --- a/components/esp_hw_support/port/esp32c3/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32c3/rtc_clk_init.c @@ -19,7 +19,7 @@ #include "sdkconfig.h" #include "esp_rom_serial_output.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32c3/rtc_init.c b/components/esp_hw_support/port/esp32c3/rtc_init.c index 43f2ec6f65..7620e0af8b 100644 --- a/components/esp_hw_support/port/esp32c3/rtc_init.c +++ b/components/esp_hw_support/port/esp32c3/rtc_init.c @@ -23,7 +23,7 @@ #include "esp_private/sar_periph_ctrl.h" #endif -static const char *TAG = "rtc_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_init"); static void set_ocode_by_efuse(int calib_version); static void calibrate_ocode(void); diff --git a/components/esp_hw_support/port/esp32c3/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32c3/sar_periph_ctrl.c index c47d5b5330..125af75b9c 100644 --- a/components/esp_hw_support/port/esp32c3/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32c3/sar_periph_ctrl.c @@ -24,7 +24,7 @@ #include "hal/sar_ctrl_ll.h" #include "hal/adc_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32c5/esp_clk_tree.c b/components/esp_hw_support/port/esp32c5/esp_clk_tree.c index ae2c99f909..8110fddc94 100644 --- a/components/esp_hw_support/port/esp32c5/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32c5/esp_clk_tree.c @@ -16,7 +16,7 @@ #include "esp_private/esp_clk_tree_common.h" #include "esp_rom_sys.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32c5/ocode_init.c b/components/esp_hw_support/port/esp32c5/ocode_init.c index d025e45a4a..2c45e2602a 100644 --- a/components/esp_hw_support/port/esp32c5/ocode_init.c +++ b/components/esp_hw_support/port/esp32c5/ocode_init.c @@ -15,7 +15,7 @@ #include "esp_private/regi2c_ctrl.h" #include "esp_hw_log.h" -static const char *TAG = "ocode_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "ocode_init"); static void set_ocode_by_efuse(int ocode_scheme_ver) { diff --git a/components/esp_hw_support/port/esp32c5/pmu_init.c b/components/esp_hw_support/port/esp32c5/pmu_init.c index ac3dd16c40..b55157bdba 100644 --- a/components/esp_hw_support/port/esp32c5/pmu_init.c +++ b/components/esp_hw_support/port/esp32c5/pmu_init.c @@ -18,8 +18,9 @@ #include "regi2c_ctrl.h" #include "esp_private/ocode_init.h" #include "esp_rom_sys.h" +#include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_init"); typedef struct { const pmu_hp_system_power_param_t *power; diff --git a/components/esp_hw_support/port/esp32c5/pmu_param.c b/components/esp_hw_support/port/esp32c5/pmu_param.c index 522ff1d8d3..a7da280db0 100644 --- a/components/esp_hw_support/port/esp32c5/pmu_param.c +++ b/components/esp_hw_support/port/esp32c5/pmu_param.c @@ -23,7 +23,7 @@ ((uint32_t)src == (uint32_t)SOC_MOD_CLK_PLL_F160M) ? 2 : \ ((uint32_t)src == (uint32_t)SOC_MOD_CLK_PLL_F240M) ? 3 : 0) -static __attribute__((unused)) const char *TAG = "pmu_param"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_param"); #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/components/esp_hw_support/port/esp32c5/pmu_sleep.c b/components/esp_hw_support/port/esp32c5/pmu_sleep.c index 74b9a2590c..2fda0e71e4 100644 --- a/components/esp_hw_support/port/esp32c5/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32c5/pmu_sleep.c @@ -23,7 +23,7 @@ #include "hal/efuse_hal.h" #include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_sleep"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_sleep"); #define HP(state) (PMU_MODE_HP_ ## state) #define LP(state) (PMU_MODE_LP_ ## state) diff --git a/components/esp_hw_support/port/esp32c5/rtc_clk.c b/components/esp_hw_support/port/esp32c5/rtc_clk.c index 89856f6752..dc9bb274d1 100644 --- a/components/esp_hw_support/port/esp32c5/rtc_clk.c +++ b/components/esp_hw_support/port/esp32c5/rtc_clk.c @@ -24,7 +24,7 @@ #include "soc/chip_revision.h" #include "esp_private/regi2c_ctrl.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 480MHz. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32c5/rtc_clk_init.c b/components/esp_hw_support/port/esp32c5/rtc_clk_init.c index 383a52ec58..1ed14b3f1d 100644 --- a/components/esp_hw_support/port/esp32c5/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32c5/rtc_clk_init.c @@ -26,7 +26,7 @@ #endif #include "pmu_param.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); /** * Initialize the ICG map of some modem clock domains in the PMU_ACTIVE state diff --git a/components/esp_hw_support/port/esp32c5/rtc_time.c b/components/esp_hw_support/port/esp32c5/rtc_time.c index 20f0a4f434..aeb87ddc59 100644 --- a/components/esp_hw_support/port/esp32c5/rtc_time.c +++ b/components/esp_hw_support/port/esp32c5/rtc_time.c @@ -17,7 +17,7 @@ #include "assert.h" #include "esp_private/periph_ctrl.h" -__attribute__((unused)) static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); #define CLK_CAL_TIMEOUT_THRES(cal_clk_sel, cycles) ((cal_clk_sel == CLK_CAL_32K_XTAL || cal_clk_sel == CLK_CAL_32K_OSC_SLOW) ? (cycles << 12) : (cycles << 10)) diff --git a/components/esp_hw_support/port/esp32c5/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32c5/sar_periph_ctrl.c index 9e138f896b..06aef6010e 100644 --- a/components/esp_hw_support/port/esp32c5/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32c5/sar_periph_ctrl.c @@ -23,7 +23,7 @@ #include "esp_private/critical_section.h" #include "hal/sar_ctrl_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; void sar_periph_ctrl_init(void) diff --git a/components/esp_hw_support/port/esp32c6/esp_clk_tree.c b/components/esp_hw_support/port/esp32c6/esp_clk_tree.c index 576720d656..8687eaec37 100644 --- a/components/esp_hw_support/port/esp32c6/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32c6/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32c6/ocode_init.c b/components/esp_hw_support/port/esp32c6/ocode_init.c index 04dcf65982..454be9af2c 100644 --- a/components/esp_hw_support/port/esp32c6/ocode_init.c +++ b/components/esp_hw_support/port/esp32c6/ocode_init.c @@ -14,7 +14,7 @@ #include "esp_private/regi2c_ctrl.h" #include "esp_hw_log.h" -static const char *TAG = "ocode_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "ocode_init"); static void set_ocode_by_efuse(int ocode_scheme_ver) { diff --git a/components/esp_hw_support/port/esp32c6/pmu_init.c b/components/esp_hw_support/port/esp32c6/pmu_init.c index 93d5b1645a..28dda13693 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_init.c +++ b/components/esp_hw_support/port/esp32c6/pmu_init.c @@ -19,8 +19,9 @@ #include "regi2c_ctrl.h" #include "esp_private/ocode_init.h" #include "esp_rom_sys.h" +#include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_init"); typedef struct { const pmu_hp_system_power_param_t *power; diff --git a/components/esp_hw_support/port/esp32c6/pmu_param.c b/components/esp_hw_support/port/esp32c6/pmu_param.c index 15184c698c..0e5b02a6d2 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_param.c +++ b/components/esp_hw_support/port/esp32c6/pmu_param.c @@ -17,7 +17,7 @@ #include "esp_hw_log.h" #include "soc/clk_tree_defs.h" -static __attribute__((unused)) const char *TAG = "pmu_param"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_param"); #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/components/esp_hw_support/port/esp32c6/pmu_sleep.c b/components/esp_hw_support/port/esp32c6/pmu_sleep.c index 274fd9ca61..1a928885e4 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32c6/pmu_sleep.c @@ -21,7 +21,7 @@ #include "hal/efuse_hal.h" #include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_sleep"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_sleep"); #define HP(state) (PMU_MODE_HP_ ## state) #define LP(state) (PMU_MODE_LP_ ## state) diff --git a/components/esp_hw_support/port/esp32c6/rtc_clk.c b/components/esp_hw_support/port/esp32c6/rtc_clk.c index ac5b2ba835..bdb38b696b 100644 --- a/components/esp_hw_support/port/esp32c6/rtc_clk.c +++ b/components/esp_hw_support/port/esp32c6/rtc_clk.c @@ -22,7 +22,7 @@ #include "esp_private/sleep_event.h" #include "esp_private/regi2c_ctrl.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 480MHz. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32c6/rtc_clk_init.c b/components/esp_hw_support/port/esp32c6/rtc_clk_init.c index a01979dfbd..51fdcafdec 100644 --- a/components/esp_hw_support/port/esp32c6/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32c6/rtc_clk_init.c @@ -26,7 +26,7 @@ #include "soc/pmu_reg.h" #include "pmu_param.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); /** * Initialize the ICG map of some modem clock domains in the PMU_ACTIVE state diff --git a/components/esp_hw_support/port/esp32c6/rtc_time.c b/components/esp_hw_support/port/esp32c6/rtc_time.c index 731deffac6..4278ce3383 100644 --- a/components/esp_hw_support/port/esp32c6/rtc_time.c +++ b/components/esp_hw_support/port/esp32c6/rtc_time.c @@ -18,7 +18,7 @@ #include "soc/chip_revision.h" #include "esp_private/periph_ctrl.h" -__attribute__((unused)) static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); /** * @brief Clock frequency calculation function used by rtc_clk_cal diff --git a/components/esp_hw_support/port/esp32c6/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32c6/sar_periph_ctrl.c index 0d6a9672de..88f6c05506 100644 --- a/components/esp_hw_support/port/esp32c6/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32c6/sar_periph_ctrl.c @@ -23,7 +23,7 @@ #include "esp_private/critical_section.h" #include "hal/sar_ctrl_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32c61/esp_clk_tree.c b/components/esp_hw_support/port/esp32c61/esp_clk_tree.c index eff66bd087..6bb70b0911 100644 --- a/components/esp_hw_support/port/esp32c61/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32c61/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32c61/ocode_init.c b/components/esp_hw_support/port/esp32c61/ocode_init.c index a2139b269e..73c8420188 100644 --- a/components/esp_hw_support/port/esp32c61/ocode_init.c +++ b/components/esp_hw_support/port/esp32c61/ocode_init.c @@ -14,7 +14,7 @@ #include "esp_private/regi2c_ctrl.h" #include "esp_hw_log.h" -static const char *TAG = "ocode_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "ocode_init"); static void set_ocode_by_efuse(int ocode_scheme_ver) { diff --git a/components/esp_hw_support/port/esp32c61/pmu_init.c b/components/esp_hw_support/port/esp32c61/pmu_init.c index a1df8ec31b..44437fbb70 100644 --- a/components/esp_hw_support/port/esp32c61/pmu_init.c +++ b/components/esp_hw_support/port/esp32c61/pmu_init.c @@ -19,8 +19,9 @@ #include "regi2c_ctrl.h" #include "esp_private/ocode_init.h" #include "esp_rom_sys.h" +#include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_init"); typedef struct { const pmu_hp_system_power_param_t *power; diff --git a/components/esp_hw_support/port/esp32c61/pmu_param.c b/components/esp_hw_support/port/esp32c61/pmu_param.c index 7901791846..eda44839fb 100644 --- a/components/esp_hw_support/port/esp32c61/pmu_param.c +++ b/components/esp_hw_support/port/esp32c61/pmu_param.c @@ -18,7 +18,7 @@ #include "esp_hw_log.h" #include "soc/clk_tree_defs.h" -static __attribute__((unused)) const char *TAG = "pmu_param"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_param"); #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/components/esp_hw_support/port/esp32c61/pmu_sleep.c b/components/esp_hw_support/port/esp32c61/pmu_sleep.c index ca7edfb618..c265b5bfd2 100644 --- a/components/esp_hw_support/port/esp32c61/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32c61/pmu_sleep.c @@ -21,7 +21,7 @@ #include "pmu_param.h" #include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_sleep"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_sleep"); #define HP(state) (PMU_MODE_HP_ ## state) #define LP(state) (PMU_MODE_LP_ ## state) diff --git a/components/esp_hw_support/port/esp32c61/rtc_clk.c b/components/esp_hw_support/port/esp32c61/rtc_clk.c index c896655364..2578b14900 100644 --- a/components/esp_hw_support/port/esp32c61/rtc_clk.c +++ b/components/esp_hw_support/port/esp32c61/rtc_clk.c @@ -22,7 +22,7 @@ #include "esp_private/sleep_event.h" #include "esp_private/regi2c_ctrl.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 480MHz. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32c61/rtc_clk_init.c b/components/esp_hw_support/port/esp32c61/rtc_clk_init.c index 196a0afac8..037f0957a5 100644 --- a/components/esp_hw_support/port/esp32c61/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32c61/rtc_clk_init.c @@ -27,7 +27,7 @@ #include "soc/pmu_reg.h" #include "pmu_param.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); /** * Initialize the ICG map of some modem clock domains in the PMU_ACTIVE state diff --git a/components/esp_hw_support/port/esp32c61/rtc_time.c b/components/esp_hw_support/port/esp32c61/rtc_time.c index 901768b46c..3d1808bc72 100644 --- a/components/esp_hw_support/port/esp32c61/rtc_time.c +++ b/components/esp_hw_support/port/esp32c61/rtc_time.c @@ -16,7 +16,7 @@ #include "assert.h" #include "esp_private/periph_ctrl.h" -__attribute__((unused)) static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); #define CLK_CAL_TIMEOUT_THRES(cal_clk_sel, cycles) ((cal_clk_sel == CLK_CAL_32K_XTAL || cal_clk_sel == CLK_CAL_32K_OSC_SLOW) ? (cycles << 12) : (cycles << 10)) diff --git a/components/esp_hw_support/port/esp32c61/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32c61/sar_periph_ctrl.c index 91753ee17f..ad07d62f33 100644 --- a/components/esp_hw_support/port/esp32c61/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32c61/sar_periph_ctrl.c @@ -23,7 +23,7 @@ #include "esp_private/critical_section.h" #include "hal/sar_ctrl_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; void sar_periph_ctrl_init(void) diff --git a/components/esp_hw_support/port/esp32h2/esp_clk_tree.c b/components/esp_hw_support/port/esp32h2/esp_clk_tree.c index e9125ac1d4..b5c7793330 100644 --- a/components/esp_hw_support/port/esp32h2/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32h2/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32h2/pmu_init.c b/components/esp_hw_support/port/esp32h2/pmu_init.c index a82f944368..34502e93c3 100644 --- a/components/esp_hw_support/port/esp32h2/pmu_init.c +++ b/components/esp_hw_support/port/esp32h2/pmu_init.c @@ -17,8 +17,9 @@ #include "soc/regi2c_pmu.h" #include "soc/regi2c_bias.h" #include "regi2c_ctrl.h" +#include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_init"); typedef struct { const pmu_hp_system_power_param_t *power; diff --git a/components/esp_hw_support/port/esp32h2/pmu_param.c b/components/esp_hw_support/port/esp32h2/pmu_param.c index f9de2ca5ae..e51185e2ce 100644 --- a/components/esp_hw_support/port/esp32h2/pmu_param.c +++ b/components/esp_hw_support/port/esp32h2/pmu_param.c @@ -17,7 +17,7 @@ #include "esp_hw_log.h" #include "soc/clk_tree_defs.h" -static __attribute__((unused)) const char *TAG = "pmu_param"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_param"); #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/components/esp_hw_support/port/esp32h2/pmu_sleep.c b/components/esp_hw_support/port/esp32h2/pmu_sleep.c index bea1ec2eb8..de4a8f434a 100644 --- a/components/esp_hw_support/port/esp32h2/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32h2/pmu_sleep.c @@ -23,7 +23,7 @@ #include "soc/regi2c_bias.h" #include "regi2c_ctrl.h" -static __attribute__((unused)) const char *TAG = "pmu_sleep"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_sleep"); #define HP(state) (PMU_MODE_HP_ ## state) #define LP(state) (PMU_MODE_LP_ ## state) diff --git a/components/esp_hw_support/port/esp32h2/rtc_clk.c b/components/esp_hw_support/port/esp32h2/rtc_clk.c index aa7b185e85..63e10b3fe2 100644 --- a/components/esp_hw_support/port/esp32h2/rtc_clk.c +++ b/components/esp_hw_support/port/esp32h2/rtc_clk.c @@ -22,7 +22,7 @@ #include "esp_private/sleep_event.h" #include "esp_private/regi2c_ctrl.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 96MHz. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32h2/rtc_clk_init.c b/components/esp_hw_support/port/esp32h2/rtc_clk_init.c index f400553e5a..394dac1014 100644 --- a/components/esp_hw_support/port/esp32h2/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32h2/rtc_clk_init.c @@ -22,7 +22,7 @@ #include "soc/pmu_reg.h" #include "pmu_param.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32h2/rtc_time.c b/components/esp_hw_support/port/esp32h2/rtc_time.c index aa39d6e932..71fbde6dbe 100644 --- a/components/esp_hw_support/port/esp32h2/rtc_time.c +++ b/components/esp_hw_support/port/esp32h2/rtc_time.c @@ -18,7 +18,7 @@ #include "soc/chip_revision.h" #include "esp_private/periph_ctrl.h" -__attribute__((unused)) static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); /** * @brief Clock frequency calculation function used by rtc_clk_cal diff --git a/components/esp_hw_support/port/esp32h2/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32h2/sar_periph_ctrl.c index 755b7ec40d..69c9d85316 100644 --- a/components/esp_hw_support/port/esp32h2/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32h2/sar_periph_ctrl.c @@ -22,7 +22,7 @@ #include "esp_private/critical_section.h" #include "hal/sar_ctrl_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32h21/esp_clk_tree.c b/components/esp_hw_support/port/esp32h21/esp_clk_tree.c index 1d848809f1..0148022792 100644 --- a/components/esp_hw_support/port/esp32h21/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32h21/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32h21/pmu_init.c b/components/esp_hw_support/port/esp32h21/pmu_init.c index 6b27a3d2c3..4a9f8d96f7 100644 --- a/components/esp_hw_support/port/esp32h21/pmu_init.c +++ b/components/esp_hw_support/port/esp32h21/pmu_init.c @@ -17,8 +17,9 @@ #include "regi2c_ctrl.h" #include "esp_private/ocode_init.h" #include "esp_rom_sys.h" +#include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_init"); typedef struct { const pmu_hp_system_power_param_t *power; diff --git a/components/esp_hw_support/port/esp32h21/pmu_param.c b/components/esp_hw_support/port/esp32h21/pmu_param.c index 1f709df7fa..391bc9060e 100644 --- a/components/esp_hw_support/port/esp32h21/pmu_param.c +++ b/components/esp_hw_support/port/esp32h21/pmu_param.c @@ -16,7 +16,7 @@ #include "esp_hw_log.h" #include "soc/clk_tree_defs.h" -static __attribute__((unused)) const char *TAG = "pmu_param"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_param"); #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/components/esp_hw_support/port/esp32h21/pmu_sleep.c b/components/esp_hw_support/port/esp32h21/pmu_sleep.c index af1a662878..29606fb43e 100644 --- a/components/esp_hw_support/port/esp32h21/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32h21/pmu_sleep.c @@ -23,7 +23,7 @@ #include "soc/regi2c_bias.h" #include "regi2c_ctrl.h" -static __attribute__((unused)) const char *TAG = "pmu_sleep"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_sleep"); #define HP(state) (PMU_MODE_HP_ ## state) #define LP(state) (PMU_MODE_LP_ ## state) diff --git a/components/esp_hw_support/port/esp32h21/rtc_clk.c b/components/esp_hw_support/port/esp32h21/rtc_clk.c index ec5d2749f8..4183989c9c 100644 --- a/components/esp_hw_support/port/esp32h21/rtc_clk.c +++ b/components/esp_hw_support/port/esp32h21/rtc_clk.c @@ -23,7 +23,7 @@ #include "esp_private/regi2c_ctrl.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 96MHz. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32h21/rtc_clk_init.c b/components/esp_hw_support/port/esp32h21/rtc_clk_init.c index 19df616b6b..2d1c8fd970 100644 --- a/components/esp_hw_support/port/esp32h21/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32h21/rtc_clk_init.c @@ -20,7 +20,7 @@ #include "soc/pmu_reg.h" #include "pmu_param.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32h21/rtc_time.c b/components/esp_hw_support/port/esp32h21/rtc_time.c index a7cbf7c668..c39aadbc79 100644 --- a/components/esp_hw_support/port/esp32h21/rtc_time.c +++ b/components/esp_hw_support/port/esp32h21/rtc_time.c @@ -16,7 +16,7 @@ #include "assert.h" #include "esp_private/periph_ctrl.h" -__attribute__((unused)) static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); #define RTC_SLOW_CLK_600K_CAL_TIMEOUT_THRES(cycles) (cycles << 10) #define RTC_SLOW_CLK_32K_CAL_TIMEOUT_THRES(cycles) (cycles << 12) diff --git a/components/esp_hw_support/port/esp32h4/esp_clk_tree.c b/components/esp_hw_support/port/esp32h4/esp_clk_tree.c index a5f918b294..091ebe17c4 100644 --- a/components/esp_hw_support/port/esp32h4/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32h4/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32h4/rtc_clk.c b/components/esp_hw_support/port/esp32h4/rtc_clk.c index 108f1def9e..1b241b140d 100644 --- a/components/esp_hw_support/port/esp32h4/rtc_clk.c +++ b/components/esp_hw_support/port/esp32h4/rtc_clk.c @@ -22,7 +22,7 @@ #include "esp_private/sleep_event.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in 96MHz. Zero if PLL is not enabled. static int s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32h4/rtc_clk_init.c b/components/esp_hw_support/port/esp32h4/rtc_clk_init.c index 106e80e917..20bb6fade7 100644 --- a/components/esp_hw_support/port/esp32h4/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32h4/rtc_clk_init.c @@ -25,7 +25,7 @@ #endif #include "pmu_param.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); /** * Initialize the ICG map of some modem clock domains in the PMU_ACTIVE state diff --git a/components/esp_hw_support/port/esp32h4/rtc_time.c b/components/esp_hw_support/port/esp32h4/rtc_time.c index 4c30f5c8e6..5ad913bac3 100644 --- a/components/esp_hw_support/port/esp32h4/rtc_time.c +++ b/components/esp_hw_support/port/esp32h4/rtc_time.c @@ -15,7 +15,7 @@ #include "assert.h" #include "esp_private/periph_ctrl.h" -static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); #define RTC_SLOW_CLK_600K_CAL_TIMEOUT_THRES(cycles) (cycles << 10) #define RTC_SLOW_CLK_32K_CAL_TIMEOUT_THRES(cycles) (cycles << 12) diff --git a/components/esp_hw_support/port/esp32p4/esp_clk_tree.c b/components/esp_hw_support/port/esp32p4/esp_clk_tree.c index 4e123b90b4..40de0a781c 100644 --- a/components/esp_hw_support/port/esp32p4/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32p4/esp_clk_tree.c @@ -15,7 +15,7 @@ #include "esp_private/esp_clk_tree_common.h" #include "esp_private/periph_ctrl.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32p4/pmu_init.c b/components/esp_hw_support/port/esp32p4/pmu_init.c index a223985f57..38328511c4 100644 --- a/components/esp_hw_support/port/esp32p4/pmu_init.c +++ b/components/esp_hw_support/port/esp32p4/pmu_init.c @@ -20,8 +20,9 @@ #include "regi2c_ctrl.h" #include "esp_rom_sys.h" #include "soc/rtc.h" +#include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_init"); typedef struct { const pmu_hp_system_power_param_t *power; diff --git a/components/esp_hw_support/port/esp32p4/pmu_param.c b/components/esp_hw_support/port/esp32p4/pmu_param.c index f1dbecfb8b..246f3d2564 100644 --- a/components/esp_hw_support/port/esp32p4/pmu_param.c +++ b/components/esp_hw_support/port/esp32p4/pmu_param.c @@ -17,7 +17,7 @@ #include "hal/efuse_hal.h" #include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_param"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_param"); #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) diff --git a/components/esp_hw_support/port/esp32p4/pmu_pvt.c b/components/esp_hw_support/port/esp32p4/pmu_pvt.c index 1eda49d0cc..58ae2f8db3 100644 --- a/components/esp_hw_support/port/esp32p4/pmu_pvt.c +++ b/components/esp_hw_support/port/esp32p4/pmu_pvt.c @@ -24,7 +24,7 @@ #include "hal/efuse_hal.h" #include "esp_hw_log.h" -static __attribute__((unused)) const char *TAG = "pmu_pvt"; +ESP_HW_LOG_ATTR_TAG(TAG, "pmu_pvt"); #if CONFIG_ESP_ENABLE_PVT diff --git a/components/esp_hw_support/port/esp32p4/rtc_clk.c b/components/esp_hw_support/port/esp32p4/rtc_clk.c index ecfd790c2c..24188e1c50 100644 --- a/components/esp_hw_support/port/esp32p4/rtc_clk.c +++ b/components/esp_hw_support/port/esp32p4/rtc_clk.c @@ -23,7 +23,7 @@ #include "esp_private/sleep_event.h" #include "esp_private/regi2c_ctrl.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // CPLL frequency option, in 360/400MHz. Zero if CPLL is not enabled. static int s_cur_cpll_freq = 0; diff --git a/components/esp_hw_support/port/esp32p4/rtc_clk_init.c b/components/esp_hw_support/port/esp32p4/rtc_clk_init.c index 27909eb58c..5b4ecfd8ef 100644 --- a/components/esp_hw_support/port/esp32p4/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32p4/rtc_clk_init.c @@ -24,7 +24,7 @@ #include "esp_private/esp_pmu.h" #include "hal/clk_tree_ll.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32p4/rtc_time.c b/components/esp_hw_support/port/esp32p4/rtc_time.c index ffbd10ef39..d61c55d96e 100644 --- a/components/esp_hw_support/port/esp32p4/rtc_time.c +++ b/components/esp_hw_support/port/esp32p4/rtc_time.c @@ -16,7 +16,7 @@ #include "esp_rom_sys.h" #include "esp_private/periph_ctrl.h" -__attribute__((unused)) static const char *TAG = "rtc_time"; +ESP_LOG_ATTR_TAG(TAG, "rtc_time"); #define CLK_CAL_TIMEOUT_THRES(cal_clk_sel, cycles) ((cal_clk_sel == CLK_CAL_RC32K || cal_clk_sel == CLK_CAL_32K_XTAL) ? (cycles << 12) : (cycles << 10)) diff --git a/components/esp_hw_support/port/esp32p4/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32p4/sar_periph_ctrl.c index 9283812da2..29822ef7aa 100644 --- a/components/esp_hw_support/port/esp32p4/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32p4/sar_periph_ctrl.c @@ -23,7 +23,7 @@ #include "esp_private/critical_section.h" #include "hal/sar_ctrl_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32s2/esp_clk_tree.c b/components/esp_hw_support/port/esp32s2/esp_clk_tree.c index 3ceca58f91..8cdfd05e23 100644 --- a/components/esp_hw_support/port/esp32s2/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32s2/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32s2/rtc_clk.c b/components/esp_hw_support/port/esp32s2/rtc_clk.c index e65c1cf588..399a5b9ec0 100644 --- a/components/esp_hw_support/port/esp32s2/rtc_clk.c +++ b/components/esp_hw_support/port/esp32s2/rtc_clk.c @@ -26,7 +26,7 @@ #include "hal/systimer_ll.h" #endif -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in MHZ (320 or 480). Zero if PLL is not enabled. // On the ESP32-S2, 480MHz PLL is enabled at reset. diff --git a/components/esp_hw_support/port/esp32s2/rtc_clk_init.c b/components/esp_hw_support/port/esp32s2/rtc_clk_init.c index acc445ed82..cffcdac622 100644 --- a/components/esp_hw_support/port/esp32s2/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32s2/rtc_clk_init.c @@ -18,7 +18,7 @@ #include "esp_cpu.h" #include "sdkconfig.h" -static const char* TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32s2/rtc_init.c b/components/esp_hw_support/port/esp32s2/rtc_init.c index e6e193a437..b7a0b7ab2a 100644 --- a/components/esp_hw_support/port/esp32s2/rtc_init.c +++ b/components/esp_hw_support/port/esp32s2/rtc_init.c @@ -21,7 +21,7 @@ #include "esp_private/sar_periph_ctrl.h" #endif -__attribute__((unused)) static const char *TAG = "rtc_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_init"); static void set_ocode_by_efuse(int calib_version); static void calibrate_ocode(void); diff --git a/components/esp_hw_support/port/esp32s2/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32s2/sar_periph_ctrl.c index 86fde96425..a79cc0d168 100644 --- a/components/esp_hw_support/port/esp32s2/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32s2/sar_periph_ctrl.c @@ -24,7 +24,7 @@ #include "hal/sar_ctrl_ll.h" #include "hal/adc_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp32s3/esp_clk_tree.c b/components/esp_hw_support/port/esp32s3/esp_clk_tree.c index 566d39c6ce..1911be9740 100644 --- a/components/esp_hw_support/port/esp32s3/esp_clk_tree.c +++ b/components/esp_hw_support/port/esp32s3/esp_clk_tree.c @@ -13,7 +13,7 @@ #include "hal/clk_tree_ll.h" #include "esp_private/esp_clk_tree_common.h" -static const char *TAG = "esp_clk_tree"; +ESP_LOG_ATTR_TAG(TAG, "esp_clk_tree"); esp_err_t esp_clk_tree_src_get_freq_hz(soc_module_clk_t clk_src, esp_clk_tree_src_freq_precision_t precision, uint32_t *freq_value) diff --git a/components/esp_hw_support/port/esp32s3/rtc_clk.c b/components/esp_hw_support/port/esp32s3/rtc_clk.c index 2840d87db5..31e15d4c8a 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_clk.c +++ b/components/esp_hw_support/port/esp32s3/rtc_clk.c @@ -26,7 +26,7 @@ #include "soc/sens_reg.h" #include "sdkconfig.h" -static const char *TAG = "rtc_clk"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk"); // Current PLL frequency, in MHZ (320 or 480). Zero if PLL is not enabled. static uint32_t s_cur_pll_freq; diff --git a/components/esp_hw_support/port/esp32s3/rtc_clk_init.c b/components/esp_hw_support/port/esp32s3/rtc_clk_init.c index 58a4c0aa85..5c614afb1a 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_clk_init.c +++ b/components/esp_hw_support/port/esp32s3/rtc_clk_init.c @@ -16,7 +16,7 @@ #include "esp_hw_log.h" #include "esp_cpu.h" -static const char *TAG = "rtc_clk_init"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtc_clk_init"); void rtc_clk_init(rtc_clk_config_t cfg) { diff --git a/components/esp_hw_support/port/esp32s3/rtc_init.c b/components/esp_hw_support/port/esp32s3/rtc_init.c index 41ea5b29cc..372e85e945 100644 --- a/components/esp_hw_support/port/esp32s3/rtc_init.c +++ b/components/esp_hw_support/port/esp32s3/rtc_init.c @@ -31,7 +31,7 @@ #define RTC_CNTL_MEM_FORCE_NOISO (RTC_CNTL_SLOWMEM_FORCE_NOISO | RTC_CNTL_FASTMEM_FORCE_NOISO) -static const char *TAG = "rtcinit"; +ESP_HW_LOG_ATTR_TAG(TAG, "rtcinit"); static void set_ocode_by_efuse(int calib_version); static void calibrate_ocode(void); diff --git a/components/esp_hw_support/port/esp32s3/sar_periph_ctrl.c b/components/esp_hw_support/port/esp32s3/sar_periph_ctrl.c index 5287d0fb35..ee6f697dde 100644 --- a/components/esp_hw_support/port/esp32s3/sar_periph_ctrl.c +++ b/components/esp_hw_support/port/esp32s3/sar_periph_ctrl.c @@ -24,7 +24,7 @@ #include "hal/sar_ctrl_ll.h" #include "hal/adc_ll.h" -static const char *TAG = "sar_periph_ctrl"; +ESP_LOG_ATTR_TAG(TAG, "sar_periph_ctrl"); extern portMUX_TYPE rtc_spinlock; diff --git a/components/esp_hw_support/port/esp_clk_tree_common.c b/components/esp_hw_support/port/esp_clk_tree_common.c index 3cc33e08eb..bf3a7e6b91 100644 --- a/components/esp_hw_support/port/esp_clk_tree_common.c +++ b/components/esp_hw_support/port/esp_clk_tree_common.c @@ -14,7 +14,7 @@ #include "sdkconfig.h" #include "esp_hw_log.h" -static const char *TAG = "esp_clk_tree_common"; +ESP_HW_LOG_ATTR_TAG(TAG, "esp_clk_tree_common"); typedef struct esp_clk_tree_calibrated_freq_t esp_clk_tree_calibrated_freq_t; diff --git a/components/esp_hw_support/port/include/esp_hw_log.h b/components/esp_hw_support/port/include/esp_hw_log.h index 19e66ce5f7..148d6c10c4 100644 --- a/components/esp_hw_support/port/include/esp_hw_log.h +++ b/components/esp_hw_support/port/include/esp_hw_log.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2016-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -17,6 +17,9 @@ #ifdef ESP_PLATFORM #include "esp_log.h" +#define ESP_HW_LOG_ATTR_TAG(tag, str) ESP_LOG_ATTR_TAG(tag, str) +#define ESP_HW_LOG_ATTR_TAG_DRAM(tag, str) ESP_LOG_ATTR_TAG_DRAM(tag, str) + #define ESP_HW_LOGE(tag, fmt, ...) ESP_EARLY_LOGE(tag, fmt, ##__VA_ARGS__) #define ESP_HW_LOGW(tag, fmt, ...) ESP_EARLY_LOGW(tag, fmt, ##__VA_ARGS__) #define ESP_HW_LOGI(tag, fmt, ...) ESP_EARLY_LOGI(tag, fmt, ##__VA_ARGS__) @@ -25,6 +28,9 @@ #else +#define ESP_HW_LOG_ATTR_TAG(tag, str) static __attribute__((unused)) const char *tag = str +#define ESP_HW_LOG_ATTR_TAG_DRAM(tag, str) static __attribute__((unused)) DRAM_ATTR const char tag[] = str + #define ESP_HW_LOGE(tag, fmt, ...) esp_rom_printf("%s(err): " fmt, tag, ##__VA_ARGS__) #define ESP_HW_LOGW(tag, fmt, ...) esp_rom_printf("%s(warn): " fmt, tag, ##__VA_ARGS__) #define ESP_HW_LOGI(tag, fmt, ...) esp_rom_printf("%s(info): " fmt, tag, ##__VA_ARGS__) diff --git a/components/esp_hw_support/port/pau_regdma.c b/components/esp_hw_support/port/pau_regdma.c index 40696e33e8..a66d78b10b 100644 --- a/components/esp_hw_support/port/pau_regdma.c +++ b/components/esp_hw_support/port/pau_regdma.c @@ -23,7 +23,7 @@ #define PAU_REGDMA_LINK_WAIT_RETRY_COUNT (1000) #define PAU_REGDMA_LINK_WAIT_READ_INTERNAL (32) -static __attribute__((unused)) const char *TAG = "pau_regdma"; +ESP_LOG_ATTR_TAG(TAG, "pau_regdma"); #if !SOC_RCC_IS_INDEPENDENT // Reset and Clock Control registers are mixing with other peripherals, so we need to use a critical section diff --git a/components/esp_hw_support/port/regdma_link.c b/components/esp_hw_support/port/regdma_link.c index 585eed43fe..ea714e2c29 100644 --- a/components/esp_hw_support/port/regdma_link.c +++ b/components/esp_hw_support/port/regdma_link.c @@ -726,7 +726,7 @@ void * regdma_find_prev_module_link_tail(void *link, void *tail, int entry, int return NULL; } -static __attribute__((unused)) const char *TAG = "regdma_link"; +ESP_LOG_ATTR_TAG(TAG, "regdma_link"); static const char* s_link_mode_str[] = { "CONTINUOUS", "ADDR_MAP", "WRITE", "WAIT" }; static const char* s_boolean_str[] = { "false", "true" }; diff --git a/components/esp_hw_support/power_supply/brownout.c b/components/esp_hw_support/power_supply/brownout.c index 771933a015..4e13a7a67f 100644 --- a/components/esp_hw_support/power_supply/brownout.c +++ b/components/esp_hw_support/power_supply/brownout.c @@ -36,7 +36,7 @@ #define BROWNOUT_DET_LVL 0 #endif -static __attribute__((unused)) DRAM_ATTR const char TAG[] = "BOD"; +ESP_LOG_ATTR_TAG_DRAM(TAG, "BOD"); static brownout_callback_t s_brownout_callback = NULL; diff --git a/components/esp_hw_support/power_supply/vbat.c b/components/esp_hw_support/power_supply/vbat.c index 5e750160f4..70f7782a0f 100644 --- a/components/esp_hw_support/power_supply/vbat.c +++ b/components/esp_hw_support/power_supply/vbat.c @@ -56,7 +56,7 @@ #endif #endif -static const char TAG[] = "VBAT"; +ESP_LOG_ATTR_TAG(TAG, "VBAT"); #endif static struct { diff --git a/components/esp_hw_support/regi2c_ctrl.c b/components/esp_hw_support/regi2c_ctrl.c index 95bdfd77d4..5ae13e21e2 100644 --- a/components/esp_hw_support/regi2c_ctrl.c +++ b/components/esp_hw_support/regi2c_ctrl.c @@ -17,7 +17,7 @@ static portMUX_TYPE __attribute__((unused)) mux = portMUX_INITIALIZER_UNLOCKED; -static DRAM_ATTR __attribute__((unused)) const char *TAG = "REGI2C"; +ESP_HW_LOG_ATTR_TAG_DRAM(TAG, "REGI2C"); uint8_t regi2c_ctrl_read_reg(uint8_t block, uint8_t host_id, uint8_t reg_add) { diff --git a/components/esp_hw_support/rtc_module.c b/components/esp_hw_support/rtc_module.c index ba8833ab46..85037d4ea5 100644 --- a/components/esp_hw_support/rtc_module.c +++ b/components/esp_hw_support/rtc_module.c @@ -29,7 +29,7 @@ #include "sys/queue.h" #if !SOC_LP_PERIPH_SHARE_INTERRUPT // TODO: IDF-8008 -static const char *TAG = "rtc_module"; +ESP_LOG_ATTR_TAG(TAG, "rtc_module"); #endif // rtc_spinlock is used by other peripheral drivers diff --git a/components/esp_hw_support/sar_tsens_ctrl.c b/components/esp_hw_support/sar_tsens_ctrl.c index c12385c322..10daf85b95 100644 --- a/components/esp_hw_support/sar_tsens_ctrl.c +++ b/components/esp_hw_support/sar_tsens_ctrl.c @@ -25,7 +25,7 @@ extern __attribute__((unused)) portMUX_TYPE rtc_spinlock; /*------------------------------------------------------------------------------------------------------------ -----------------------------------------Temperature Sensor--------------------------------------------------- ------------------------------------------------------------------------------------------------------------*/ -static const char *TAG_TSENS = "temperature_sensor"; +ESP_LOG_ATTR_TAG(TAG_TSENS, "temperature_sensor"); #define INT_NOT_USED 999999 diff --git a/components/esp_hw_support/sleep_event.c b/components/esp_hw_support/sleep_event.c index 3cc5ffd0cc..49bee884b5 100644 --- a/components/esp_hw_support/sleep_event.c +++ b/components/esp_hw_support/sleep_event.c @@ -16,7 +16,7 @@ #include "esp_check.h" #include "freertos/FreeRTOS.h" -static __attribute__((unused)) const char *TAG = "sleep_event"; +ESP_LOG_ATTR_TAG(TAG, "sleep_event"); #if CONFIG_ESP_SLEEP_EVENT_CALLBACKS esp_sleep_event_cbs_config_t g_sleep_event_cbs_config; diff --git a/components/esp_hw_support/sleep_gpio.c b/components/esp_hw_support/sleep_gpio.c index c0bf8d5d57..78d6b65241 100644 --- a/components/esp_hw_support/sleep_gpio.c +++ b/components/esp_hw_support/sleep_gpio.c @@ -32,7 +32,7 @@ #include "esp_private/startup_internal.h" #include "bootloader_flash.h" -static const char *TAG = "sleep_gpio"; +ESP_LOG_ATTR_TAG(TAG, "sleep_gpio"); #if CONFIG_IDF_TARGET_ESP32 /* On ESP32, for IOs with RTC functionality, setting SLP_PU, SLP_PD couldn't change IO status diff --git a/components/esp_hw_support/sleep_modem.c b/components/esp_hw_support/sleep_modem.c index 12269b777c..837048983b 100644 --- a/components/esp_hw_support/sleep_modem.c +++ b/components/esp_hw_support/sleep_modem.c @@ -26,7 +26,7 @@ #include "esp_pau.h" #endif -static __attribute__((unused)) const char *TAG = "sleep_modem"; +ESP_LOG_ATTR_TAG(TAG, "sleep_modem"); #if CONFIG_PM_SLP_DEFAULT_PARAMS_OPT static void esp_pm_light_sleep_default_params_config(int min_freq_mhz, int max_freq_mhz); diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index e89f51e2a7..0b786e06e7 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -325,7 +325,7 @@ static bool s_light_sleep_wakeup = false; is not thread-safe, so we need to disable interrupts before going to deep sleep. */ static portMUX_TYPE __attribute__((unused)) spinlock_rtc_deep_sleep = portMUX_INITIALIZER_UNLOCKED; -static const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); /* APP core of esp32 can't access to RTC FAST MEMORY, do not define it with RTC_IRAM_ATTR */ RTC_SLOW_ATTR static int32_t s_sleep_sub_mode_ref_cnt[ESP_SLEEP_MODE_MAX] = { 0 }; diff --git a/components/esp_hw_support/sleep_retention.c b/components/esp_hw_support/sleep_retention.c index 7df1d700cd..724ce38bbc 100644 --- a/components/esp_hw_support/sleep_retention.c +++ b/components/esp_hw_support/sleep_retention.c @@ -28,7 +28,7 @@ #include "hal/cache_ll.h" #endif -static __attribute__((unused)) const char *TAG = "sleep"; +ESP_LOG_ATTR_TAG(TAG, "sleep"); static int acquire_cnt; //for the force acquire lock diff --git a/components/esp_hw_support/sleep_system_peripheral.c b/components/esp_hw_support/sleep_system_peripheral.c index 477e3317bf..712be622b6 100644 --- a/components/esp_hw_support/sleep_system_peripheral.c +++ b/components/esp_hw_support/sleep_system_peripheral.c @@ -20,7 +20,7 @@ #include "esp_private/startup_internal.h" #include "esp_private/sleep_retention.h" -static __attribute__((unused)) const char *TAG = "sleep_sys_periph"; +ESP_LOG_ATTR_TAG(TAG, "sleep_sys_periph"); static __attribute__((unused)) esp_err_t sleep_sys_periph_intr_matrix_retention_init(void *arg) { diff --git a/components/esp_hw_support/spi_bus_lock.c b/components/esp_hw_support/spi_bus_lock.c index 7c3728b80a..0e0a0762a8 100644 --- a/components/esp_hw_support/spi_bus_lock.c +++ b/components/esp_hw_support/spi_bus_lock.c @@ -267,7 +267,7 @@ struct spi_bus_lock_dev_t { */ portMUX_TYPE s_spinlock = portMUX_INITIALIZER_UNLOCKED; -DRAM_ATTR static const char TAG[] = "bus_lock"; +ESP_LOG_ATTR_TAG_DRAM(TAG, "bus_lock"); static inline int mask_get_id(uint32_t mask); static inline int dev_lock_get_id(spi_bus_lock_dev_t *dev_lock); diff --git a/components/esp_hw_support/spi_share_hw_ctrl.c b/components/esp_hw_support/spi_share_hw_ctrl.c index 3d610bb49f..dd871c56e7 100644 --- a/components/esp_hw_support/spi_share_hw_ctrl.c +++ b/components/esp_hw_support/spi_share_hw_ctrl.c @@ -12,7 +12,7 @@ #include "hal/spi_ll.h" #include "esp_log.h" -static const char* SPI_TAG = "spi_share_hw_ctrl"; +ESP_LOG_ATTR_TAG(SPI_TAG, "spi_share_hw_ctrl"); //Periph 1 is 'claimed' by SPI flash code. static atomic_bool spi_periph_claimed[SOC_SPI_PERIPH_NUM] = { ATOMIC_VAR_INIT(true), ATOMIC_VAR_INIT(false), diff --git a/components/esp_hw_support/test_apps/dma2d/main/dma2d_test_utils.c b/components/esp_hw_support/test_apps/dma2d/main/dma2d_test_utils.c index 0395f80280..0eaea3fdb9 100644 --- a/components/esp_hw_support/test_apps/dma2d/main/dma2d_test_utils.c +++ b/components/esp_hw_support/test_apps/dma2d/main/dma2d_test_utils.c @@ -16,7 +16,7 @@ #include "esp_attr.h" #include "esp_log.h" -__attribute__((unused)) static const char *TAG = "dma2d_m2m"; +ESP_LOG_ATTR_TAG(TAG, "dma2d_m2m"); #if CONFIG_DMA2D_OPERATION_FUNC_IN_IRAM || CONFIG_DMA2D_ISR_IRAM_SAFE #define DMA2D_M2M_MEM_ALLOC_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT) diff --git a/components/esp_hw_support/test_apps/esp_hw_support_unity_tests/main/test_app_main.c b/components/esp_hw_support/test_apps/esp_hw_support_unity_tests/main/test_app_main.c index b893f539bc..37cc63d2ea 100644 --- a/components/esp_hw_support/test_apps/esp_hw_support_unity_tests/main/test_app_main.c +++ b/components/esp_hw_support/test_apps/esp_hw_support_unity_tests/main/test_app_main.c @@ -28,7 +28,7 @@ void set_leak_threshold(int threshold) static size_t before_free_8bit; static size_t before_free_32bit; -static const char* TAG = "esp_hw_support_test_app"; +ESP_LOG_ATTR_TAG(TAG, "esp_hw_support_test_app"); static void check_leak(size_t before_free, size_t after_free, const char *type) { diff --git a/components/esp_hw_support/test_apps/rtc_8md256/main/test_rtc_8md256.c b/components/esp_hw_support/test_apps/rtc_8md256/main/test_rtc_8md256.c index 893d00ade9..ac7669e8b7 100644 --- a/components/esp_hw_support/test_apps/rtc_8md256/main/test_rtc_8md256.c +++ b/components/esp_hw_support/test_apps/rtc_8md256/main/test_rtc_8md256.c @@ -17,7 +17,7 @@ #include "soc/soc_caps.h" -static const char TAG[] = "rtc_8m"; +ESP_LOG_ATTR_TAG(TAG, "rtc_8m"); static void test_deepsleep(bool force_rtc_periph) { diff --git a/components/esp_hw_support/test_apps/rtc_clk/main/test_app_main.c b/components/esp_hw_support/test_apps/rtc_clk/main/test_app_main.c index 6bd53a060c..4dbd00f512 100644 --- a/components/esp_hw_support/test_apps/rtc_clk/main/test_app_main.c +++ b/components/esp_hw_support/test_apps/rtc_clk/main/test_app_main.c @@ -23,7 +23,7 @@ void set_leak_threshold(int threshold) static size_t before_free_8bit; static size_t before_free_32bit; -static const char* TAG = "esp_hw_support_test_app"; +ESP_LOG_ATTR_TAG(TAG, "esp_hw_support_test_app"); static void check_leak(size_t before_free, size_t after_free, const char *type) { diff --git a/components/esp_hw_support/test_apps/rtc_power_modes/main/test_rtc_power.c b/components/esp_hw_support/test_apps/rtc_power_modes/main/test_rtc_power.c index ef9004873a..994036de95 100644 --- a/components/esp_hw_support/test_apps/rtc_power_modes/main/test_rtc_power.c +++ b/components/esp_hw_support/test_apps/rtc_power_modes/main/test_rtc_power.c @@ -19,7 +19,7 @@ #include "esp_private/esp_sleep_internal.h" #include "sdkconfig.h" -static const char TAG[] = "rtc_power"; +ESP_LOG_ATTR_TAG(TAG, "rtc_power"); static void check_deepsleep_reset(void) { diff --git a/components/esp_hw_support/test_apps/sleep_retention/main/test_retention.c b/components/esp_hw_support/test_apps/sleep_retention/main/test_retention.c index 23a282c78d..a4654badbb 100644 --- a/components/esp_hw_support/test_apps/sleep_retention/main/test_retention.c +++ b/components/esp_hw_support/test_apps/sleep_retention/main/test_retention.c @@ -14,7 +14,7 @@ #include "esp_sleep.h" #include "esp_private/sleep_cpu.h" -const char TAG[] = "retention"; +ESP_LOG_ATTR_TAG(TAG, "retention"); #if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP TEST_CASE("retention: can go to retention", "[retention]") diff --git a/components/esp_hw_support/test_apps/vad_wakeup/main/test_vad_wakeup.c b/components/esp_hw_support/test_apps/vad_wakeup/main/test_vad_wakeup.c index 0d2ceeb2cb..d734d7a308 100644 --- a/components/esp_hw_support/test_apps/vad_wakeup/main/test_vad_wakeup.c +++ b/components/esp_hw_support/test_apps/vad_wakeup/main/test_vad_wakeup.c @@ -28,7 +28,7 @@ extern const uint8_t test_vad_pcm_start[] asm("_binary_test_vad_8k_pcm_start"); extern const uint8_t test_vad_pcm_end[] asm("_binary_test_vad_8k_pcm_end"); -static const char *TAG = "TEST_VAD"; +ESP_LOG_ATTR_TAG(TAG, "TEST_VAD"); static void s_hp_i2s_config(void) { diff --git a/components/esp_hw_support/test_apps/wakeup_tests/main/src/io_wakeup_cmd.c b/components/esp_hw_support/test_apps/wakeup_tests/main/src/io_wakeup_cmd.c index 5c13c7fea2..de140f84a1 100644 --- a/components/esp_hw_support/test_apps/wakeup_tests/main/src/io_wakeup_cmd.c +++ b/components/esp_hw_support/test_apps/wakeup_tests/main/src/io_wakeup_cmd.c @@ -16,7 +16,7 @@ #include "argtable3/argtable3.h" #include "esp_log.h" -static const char* TAG = "io_wakeup_test"; +ESP_LOG_ATTR_TAG(TAG, "io_wakeup_test"); typedef enum { IO_WAKEUP_LEVEL_LOW = 0, diff --git a/components/esp_hw_support/test_apps/wakeup_tests/main/test_app_main.c b/components/esp_hw_support/test_apps/wakeup_tests/main/test_app_main.c index 7317c4d401..8899dc3fb1 100644 --- a/components/esp_hw_support/test_apps/wakeup_tests/main/test_app_main.c +++ b/components/esp_hw_support/test_apps/wakeup_tests/main/test_app_main.c @@ -16,7 +16,7 @@ #include "argtable3/argtable3.h" #include "io_wakeup_cmd.h" -static const char* TAG = "esp_hw_support_test_app"; +ESP_LOG_ATTR_TAG(TAG, "esp_hw_support_test_app"); #define PROMPT_STR "io_wakeup_test" #define LEAKS (100) diff --git a/components/esp_libc/src/random.c b/components/esp_libc/src/random.c index 259af50c7d..b43815b504 100644 --- a/components/esp_libc/src/random.c +++ b/components/esp_libc/src/random.c @@ -12,7 +12,7 @@ #include "esp_random.h" #include "esp_log.h" -static const char *TAG = "RANDOM"; +ESP_LOG_ATTR_TAG(TAG, "RANDOM"); ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { diff --git a/components/esp_libc/src/scandir.c b/components/esp_libc/src/scandir.c index 2781111f77..39d65ebe76 100644 --- a/components/esp_libc/src/scandir.c +++ b/components/esp_libc/src/scandir.c @@ -10,7 +10,7 @@ #include "esp_check.h" #include "esp_log.h" -static const char *TAG = "scandir"; +ESP_LOG_ATTR_TAG(TAG, "scandir"); int alphasort(const struct dirent **lhs, const struct dirent **rhs) { diff --git a/components/esp_libc/src/sysconf.c b/components/esp_libc/src/sysconf.c index 83f5a02053..ea0f5ccbc6 100644 --- a/components/esp_libc/src/sysconf.c +++ b/components/esp_libc/src/sysconf.c @@ -11,7 +11,7 @@ #include "esp_log.h" #include "sdkconfig.h" -static const char *TAG = "sysconf"; +ESP_LOG_ATTR_TAG(TAG, "sysconf"); #ifdef CONFIG_FREERTOS_UNICORE #define CPU_NUM 1 diff --git a/components/esp_partition/partition.c b/components/esp_partition/partition.c index 2e59589029..65a7561e1a 100644 --- a/components/esp_partition/partition.c +++ b/components/esp_partition/partition.c @@ -70,7 +70,7 @@ typedef struct esp_partition_iterator_opaque_ { static SLIST_HEAD(partition_list_head_, partition_list_item_) s_partition_list = SLIST_HEAD_INITIALIZER(s_partition_list); static _lock_t s_partition_list_lock; -static const char *TAG = "partition"; +ESP_LOG_ATTR_TAG(TAG, "partition"); static bool is_partition_encrypted(bool encryption_config, esp_partition_type_t type, esp_partition_subtype_t subtype) { diff --git a/components/esp_partition/partition_bootloader.c b/components/esp_partition/partition_bootloader.c index a408037fb3..941bfa96e8 100644 --- a/components/esp_partition/partition_bootloader.c +++ b/components/esp_partition/partition_bootloader.c @@ -10,7 +10,7 @@ #include "bootloader_flash_priv.h" // bootloader_ssupport/bootloader_flash/include #include "esp_log.h" -static const char* TAG = "partition_bootloader"; +ESP_LOG_ATTR_TAG(TAG, "partition_bootloader"); // populates the internal_partition_list from flash const esp_partition_t* esp_partition_find_first(esp_partition_type_t type, esp_partition_subtype_t subtype, const char* label) diff --git a/components/esp_partition/partition_linux.c b/components/esp_partition/partition_linux.c index ec8947399d..5d18a0d5b6 100644 --- a/components/esp_partition/partition_linux.c +++ b/components/esp_partition/partition_linux.c @@ -22,7 +22,7 @@ #include "esp_log.h" #include "spi_flash_mmap.h" -static const char *TAG = "linux_spiflash"; +ESP_LOG_ATTR_TAG(TAG, "linux_spiflash"); static void *s_spiflash_mem_file_buf = NULL; static int s_spiflash_mem_file_fd = -1; diff --git a/components/esp_partition/partition_tee.c b/components/esp_partition/partition_tee.c index c3fcd28cbb..30ebdb41e7 100644 --- a/components/esp_partition/partition_tee.c +++ b/components/esp_partition/partition_tee.c @@ -9,7 +9,7 @@ #include "esp_tee_flash.h" #include "esp_log.h" -static __attribute__((unused)) const char *TAG = "partition_tee"; +ESP_LOG_ATTR_TAG(TAG, "partition_tee"); const esp_partition_t *esp_partition_find_first(esp_partition_type_t type, esp_partition_subtype_t subtype, const char* label) { diff --git a/components/esp_system/fpga_overrides_clk.c b/components/esp_system/fpga_overrides_clk.c index f7e1cfdc77..73c13f1d91 100644 --- a/components/esp_system/fpga_overrides_clk.c +++ b/components/esp_system/fpga_overrides_clk.c @@ -21,7 +21,7 @@ #include "esp_rom_sys.h" #include "esp_rom_serial_output.h" -static const char *TAG = "fpga_clk"; +ESP_LOG_ATTR_TAG(TAG, "fpga_clk"); static void s_warn(void) { diff --git a/components/esp_system/fpga_overrides_rng.c b/components/esp_system/fpga_overrides_rng.c index 10014e5cec..0ccf37180a 100644 --- a/components/esp_system/fpga_overrides_rng.c +++ b/components/esp_system/fpga_overrides_rng.c @@ -7,7 +7,7 @@ #include "esp_log.h" #include "esp_attr.h" -static const char *TAG = "fpga_rng"; +ESP_LOG_ATTR_TAG(TAG, "fpga_rng"); /* Placed in IRAM since test_apps expects it to be */ void IRAM_ATTR bootloader_fill_random(void *buffer, size_t length) diff --git a/components/esp_system/int_wdt.c b/components/esp_system/int_wdt.c index e9c3b01e1c..bad31568f0 100644 --- a/components/esp_system/int_wdt.c +++ b/components/esp_system/int_wdt.c @@ -54,7 +54,7 @@ #if CONFIG_ESP_INT_WDT #if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_MWDT_SUPPORT_SLEEP_RETENTION -static const char* TAG = "int_wdt"; +ESP_LOG_ATTR_TAG(TAG, "int_wdt"); static esp_err_t sleep_int_wdt_retention_init(void *arg) { uint32_t group_id = *(uint32_t *)arg; diff --git a/components/esp_system/ld/elf_misc.ld.in b/components/esp_system/ld/elf_misc.ld.in index d9891a34e8..74ce86bf03 100644 --- a/components/esp_system/ld/elf_misc.ld.in +++ b/components/esp_system/ld/elf_misc.ld.in @@ -6,6 +6,9 @@ */ .noload 0 (INFO) : { + /* Reserve first 4 bytes as zero for vars pointed to NULL */ + . = 0; + LONG(0); _noload_keep_in_elf_start = ABSOLUTE(.); KEEP(*(.noload_keep_in_elf .noload_keep_in_elf.*)) mapping[noload_keep_in_elf] diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 60d4551782..2885b02c8d 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -156,7 +156,7 @@ extern int _vector_table; extern int _mtvt_table; #endif -static const char *TAG = "cpu_start"; +ESP_LOG_ATTR_TAG(TAG, "cpu_start"); #ifdef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY extern int _iram_bss_start; diff --git a/components/esp_system/port/soc/esp32/clk.c b/components/esp_system/port/soc/esp32/clk.c index eeda520dfe..e395163ce8 100644 --- a/components/esp_system/port/soc/esp32/clk.c +++ b/components/esp_system/port/soc/esp32/clk.c @@ -22,7 +22,7 @@ #include "sdkconfig.h" -static const char* TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); /* Number of cycles to wait from the 32k XTAL oscillator to consider it running. * Larger values increase startup delay. Smaller values may cause false positive diff --git a/components/esp_system/port/soc/esp32c2/cache_err_int.c b/components/esp_system/port/soc/esp32c2/cache_err_int.c index 3807aa12eb..24f264eef1 100644 --- a/components/esp_system/port/soc/esp32c2/cache_err_int.c +++ b/components/esp_system/port/soc/esp32c2/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); #define DIM(array) (sizeof(array)/sizeof(*array)) diff --git a/components/esp_system/port/soc/esp32c2/clk.c b/components/esp_system/port/soc/esp32c2/clk.c index f05dad4873..aebc98e4d0 100644 --- a/components/esp_system/port/soc/esp32c2/clk.c +++ b/components/esp_system/port/soc/esp32c2/clk.c @@ -53,7 +53,7 @@ typedef enum { static void select_rtc_slow_clk(slow_clk_sel_t slow_clk); static __attribute__((unused)) void recalib_bbpll(void); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32c3/cache_err_int.c b/components/esp_system/port/soc/esp32c3/cache_err_int.c index 8f9d2765da..2c8e560804 100644 --- a/components/esp_system/port/soc/esp32c3/cache_err_int.c +++ b/components/esp_system/port/soc/esp32c3/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); #define DIM(array) (sizeof(array)/sizeof(*array)) diff --git a/components/esp_system/port/soc/esp32c3/clk.c b/components/esp_system/port/soc/esp32c3/clk.c index 5fbade339f..a57742fecf 100644 --- a/components/esp_system/port/soc/esp32c3/clk.c +++ b/components/esp_system/port/soc/esp32c3/clk.c @@ -54,7 +54,7 @@ typedef enum { static void select_rtc_slow_clk(slow_clk_sel_t slow_clk); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32c5/cache_err_int.c b/components/esp_system/port/soc/esp32c5/cache_err_int.c index d4c1cae619..10f0cdd45a 100644 --- a/components/esp_system/port/soc/esp32c5/cache_err_int.c +++ b/components/esp_system/port/soc/esp32c5/cache_err_int.c @@ -20,7 +20,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32c5/clk.c b/components/esp_system/port/soc/esp32c5/clk.c index 07a9890ae5..0db05faac6 100644 --- a/components/esp_system/port/soc/esp32c5/clk.c +++ b/components/esp_system/port/soc/esp32c5/clk.c @@ -77,7 +77,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32c6/cache_err_int.c b/components/esp_system/port/soc/esp32c6/cache_err_int.c index 9034f72ed9..5cc77ed1ac 100644 --- a/components/esp_system/port/soc/esp32c6/cache_err_int.c +++ b/components/esp_system/port/soc/esp32c6/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32c6/clk.c b/components/esp_system/port/soc/esp32c6/clk.c index b56de02f6e..870baab647 100644 --- a/components/esp_system/port/soc/esp32c6/clk.c +++ b/components/esp_system/port/soc/esp32c6/clk.c @@ -59,7 +59,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); static __attribute__((unused)) void recalib_bbpll(void); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32c61/cache_err_int.c b/components/esp_system/port/soc/esp32c61/cache_err_int.c index 141b52382d..7dd5661632 100644 --- a/components/esp_system/port/soc/esp32c61/cache_err_int.c +++ b/components/esp_system/port/soc/esp32c61/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32c61/clk.c b/components/esp_system/port/soc/esp32c61/clk.c index 0da9c0710a..906ead4ecf 100644 --- a/components/esp_system/port/soc/esp32c61/clk.c +++ b/components/esp_system/port/soc/esp32c61/clk.c @@ -36,7 +36,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32h2/cache_err_int.c b/components/esp_system/port/soc/esp32h2/cache_err_int.c index bad10facb9..e4b0b03d4f 100644 --- a/components/esp_system/port/soc/esp32h2/cache_err_int.c +++ b/components/esp_system/port/soc/esp32h2/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32h2/clk.c b/components/esp_system/port/soc/esp32h2/clk.c index 04fdd17a66..3915948a4b 100644 --- a/components/esp_system/port/soc/esp32h2/clk.c +++ b/components/esp_system/port/soc/esp32h2/clk.c @@ -61,7 +61,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); static __attribute__((unused)) void recalib_bbpll(void); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32h21/cache_err_int.c b/components/esp_system/port/soc/esp32h21/cache_err_int.c index 05a4cbd893..4b9d86e859 100644 --- a/components/esp_system/port/soc/esp32h21/cache_err_int.c +++ b/components/esp_system/port/soc/esp32h21/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32h21/clk.c b/components/esp_system/port/soc/esp32h21/clk.c index 3d1913b32c..4f1e99ecd8 100644 --- a/components/esp_system/port/soc/esp32h21/clk.c +++ b/components/esp_system/port/soc/esp32h21/clk.c @@ -37,7 +37,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32h4/cache_err_int.c b/components/esp_system/port/soc/esp32h4/cache_err_int.c index b99d9ff146..7a598319e9 100644 --- a/components/esp_system/port/soc/esp32h4/cache_err_int.c +++ b/components/esp_system/port/soc/esp32h4/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32h4/clk.c b/components/esp_system/port/soc/esp32h4/clk.c index 4bc1bf69cf..3e4a969229 100644 --- a/components/esp_system/port/soc/esp32h4/clk.c +++ b/components/esp_system/port/soc/esp32h4/clk.c @@ -36,7 +36,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); void esp_rtc_init(void) { diff --git a/components/esp_system/port/soc/esp32p4/cache_err_int.c b/components/esp_system/port/soc/esp32p4/cache_err_int.c index 86e5b8da07..8bd4960f5f 100644 --- a/components/esp_system/port/soc/esp32p4/cache_err_int.c +++ b/components/esp_system/port/soc/esp32p4/cache_err_int.c @@ -19,7 +19,7 @@ #include "hal/cache_ll.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); const char cache_error_msg[] = "Cache access error"; diff --git a/components/esp_system/port/soc/esp32p4/clk.c b/components/esp_system/port/soc/esp32p4/clk.c index d5c7b8859e..9f5638f7a0 100644 --- a/components/esp_system/port/soc/esp32p4/clk.c +++ b/components/esp_system/port/soc/esp32p4/clk.c @@ -76,7 +76,7 @@ static void select_rtc_slow_clk(soc_rtc_slow_clk_src_t rtc_slow_clk_src); -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); // This function must be allocated in IRAM. void IRAM_ATTR esp_rtc_init(void) diff --git a/components/esp_system/port/soc/esp32s2/clk.c b/components/esp_system/port/soc/esp32s2/clk.c index d6a3534e9f..2550d46407 100644 --- a/components/esp_system/port/soc/esp32s2/clk.c +++ b/components/esp_system/port/soc/esp32s2/clk.c @@ -27,7 +27,7 @@ #include "bootloader_clock.h" #include "soc/syscon_reg.h" -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); /* Number of cycles to wait from the 32k XTAL oscillator to consider it running. * Larger values increase startup delay. Smaller values may cause false positive diff --git a/components/esp_system/port/soc/esp32s3/cache_err_int.c b/components/esp_system/port/soc/esp32s3/cache_err_int.c index f668cf156c..247e21ee3d 100644 --- a/components/esp_system/port/soc/esp32s3/cache_err_int.c +++ b/components/esp_system/port/soc/esp32s3/cache_err_int.c @@ -28,7 +28,7 @@ #include "soc/extmem_reg.h" #include "esp_private/cache_err_int.h" -static const char *TAG = "CACHE_ERR"; +ESP_LOG_ATTR_TAG(TAG, "CACHE_ERR"); #define DIM(array) (sizeof(array)/sizeof(*array)) diff --git a/components/esp_system/port/soc/esp32s3/clk.c b/components/esp_system/port/soc/esp32s3/clk.c index 127bbd78d8..efaae2084e 100644 --- a/components/esp_system/port/soc/esp32s3/clk.c +++ b/components/esp_system/port/soc/esp32s3/clk.c @@ -27,7 +27,7 @@ #include "bootloader_clock.h" #include "soc/syscon_reg.h" -static const char *TAG = "clk"; +ESP_LOG_ATTR_TAG(TAG, "clk"); /* Number of cycles to wait from the 32k XTAL oscillator to consider it running. * Larger values increase startup delay. Smaller values may cause false positive diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 0d957a207b..d0887f02e7 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -56,7 +56,7 @@ static volatile bool s_system_full_inited = false; const sys_startup_fn_t g_startup_fn[1] = { start_cpu0 }; #endif -static const char* TAG = "cpu_start"; +ESP_LOG_ATTR_TAG(TAG, "cpu_start"); #ifdef CONFIG_COMPILER_CXX_EXCEPTIONS /** diff --git a/components/esp_system/startup_funcs.c b/components/esp_system/startup_funcs.c index 23a0527a97..953842b4aa 100644 --- a/components/esp_system/startup_funcs.c +++ b/components/esp_system/startup_funcs.c @@ -48,7 +48,7 @@ #endif // Using the same tag as in startup.c to keep the logs unchanged -static const char* TAG = "cpu_start"; +ESP_LOG_ATTR_TAG(TAG, "cpu_start"); // Hook to force the linker to include this file void esp_system_include_startup_funcs(void) diff --git a/components/esp_system/systick_etm.c b/components/esp_system/systick_etm.c index a5a1dc7922..75b366cc12 100644 --- a/components/esp_system/systick_etm.c +++ b/components/esp_system/systick_etm.c @@ -15,7 +15,7 @@ #define ETM_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT -static const char *TAG = "systick-etm"; +ESP_LOG_ATTR_TAG(TAG, "systick-etm"); static esp_err_t systick_etm_event_del(esp_etm_event_t *event) { diff --git a/components/esp_system/task_wdt/task_wdt.c b/components/esp_system/task_wdt/task_wdt.c index 723740f41a..bcb56b7177 100644 --- a/components/esp_system/task_wdt/task_wdt.c +++ b/components/esp_system/task_wdt/task_wdt.c @@ -84,7 +84,7 @@ struct twdt_obj { // ----------------------- Objects ------------------------- -static const char *TAG = "task_wdt"; +ESP_LOG_ATTR_TAG(TAG, "task_wdt"); static portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; static twdt_obj_t *p_twdt_obj = NULL; @@ -488,7 +488,7 @@ static void task_wdt_isr(void *arg) return; } - ESP_EARLY_LOGE(TAG, "%s", DRAM_STR("Tasks currently running:")); + ESP_EARLY_LOGE(TAG, "%s", ESP_LOG_ATTR_DRAM_STR("Tasks currently running:")); for (int x = 0; x < CONFIG_FREERTOS_NUMBER_OF_CORES; x++) { ESP_EARLY_LOGE(TAG, "CPU %d: %s", x, pcTaskGetName(xTaskGetCurrentTaskHandleForCore(x))); } diff --git a/components/esp_system/task_wdt/task_wdt_impl_esp_timer.c b/components/esp_system/task_wdt/task_wdt_impl_esp_timer.c index d6441f7d43..e88e077a45 100644 --- a/components/esp_system/task_wdt/task_wdt_impl_esp_timer.c +++ b/components/esp_system/task_wdt/task_wdt_impl_esp_timer.c @@ -37,7 +37,7 @@ typedef struct { * init function. */ static twdt_ctx_soft_t init_context; -static const char *TAG = "task_wdt_impl_soft"; +ESP_LOG_ATTR_TAG(TAG, "task_wdt_impl_soft"); esp_err_t esp_task_wdt_impl_timer_allocate(const esp_task_wdt_config_t *config, twdt_isr_callback callback, diff --git a/components/esp_system/task_wdt/task_wdt_impl_timergroup.c b/components/esp_system/task_wdt/task_wdt_impl_timergroup.c index 46fc6a9f6f..dd365b79fd 100644 --- a/components/esp_system/task_wdt/task_wdt_impl_timergroup.c +++ b/components/esp_system/task_wdt/task_wdt_impl_timergroup.c @@ -53,7 +53,7 @@ typedef struct { static twdt_ctx_hard_t init_context; #if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_MWDT_SUPPORT_SLEEP_RETENTION -static const char* TAG = "task_wdt"; +ESP_LOG_ATTR_TAG(TAG, "task_wdt"); static esp_err_t sleep_task_wdt_retention_init(void *arg) { uint32_t group_id = *(uint32_t *)arg; diff --git a/components/esp_timer/src/esp_timer.c b/components/esp_timer/src/esp_timer.c index 8c59fbe40d..24bd5805a4 100644 --- a/components/esp_timer/src/esp_timer.c +++ b/components/esp_timer/src/esp_timer.c @@ -71,7 +71,7 @@ static void timer_insert_inactive(esp_timer_handle_t timer); static void timer_remove_inactive(esp_timer_handle_t timer); #endif // WITH_PROFILING -__attribute__((unused)) static const char* TAG = "esp_timer"; +ESP_LOG_ATTR_TAG(TAG, "esp_timer"); // lists of currently armed timers for two dispatch methods: ISR and TASK static LIST_HEAD(esp_timer_list, esp_timer) s_timers[ESP_TIMER_MAX] = { diff --git a/components/esp_timer/src/esp_timer_etm.c b/components/esp_timer/src/esp_timer_etm.c index 6996a5a710..fd05eef305 100644 --- a/components/esp_timer/src/esp_timer_etm.c +++ b/components/esp_timer/src/esp_timer_etm.c @@ -14,7 +14,7 @@ #define ETM_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT -static const char *TAG = "esptimer-etm"; +ESP_LOG_ATTR_TAG(TAG, "esptimer-etm"); static esp_err_t esp_timer_etm_event_del(esp_etm_event_t *event) { diff --git a/components/esp_timer/src/esp_timer_impl_lac.c b/components/esp_timer/src/esp_timer_impl_lac.c index 277d5409e4..9c0efe4c32 100644 --- a/components/esp_timer/src/esp_timer_impl_lac.c +++ b/components/esp_timer/src/esp_timer_impl_lac.c @@ -69,7 +69,7 @@ typedef struct { }; } timer_64b_reg_t; -static const char* TAG = "esp_timer_impl"; +ESP_LOG_ATTR_TAG(TAG, "esp_timer_impl"); #define NOT_USED 0xBAD00FAD diff --git a/components/esp_timer/src/esp_timer_impl_systimer.c b/components/esp_timer/src/esp_timer_impl_systimer.c index d642db58f8..270d2c23c7 100644 --- a/components/esp_timer/src/esp_timer_impl_systimer.c +++ b/components/esp_timer/src/esp_timer_impl_systimer.c @@ -34,7 +34,7 @@ * @note systimer counter0 and alarm2 are adopted to implemented esp_timer */ -static const char *TAG = "esp_timer_systimer"; +ESP_LOG_ATTR_TAG(TAG, "esp_timer_systimer"); #define NOT_USED 0xBAD00FAD diff --git a/components/esp_timer/src/system_time.c b/components/esp_timer/src/system_time.c index 9b7ed25568..0e39c39233 100644 --- a/components/esp_timer/src/system_time.c +++ b/components/esp_timer/src/system_time.c @@ -18,7 +18,7 @@ #include "esp_private/startup_internal.h" #include "esp_rtc_time.h" -__attribute__((unused)) static const char* TAG = "system_time"; +ESP_LOG_ATTR_TAG(TAG, "system_time"); // Correction for underlying timer to keep definition // of system time consistent. diff --git a/components/esp_timer/test_apps/main/test_esp_timer_dfs.c b/components/esp_timer/test_apps/main/test_esp_timer_dfs.c index e40a52898d..5bc5669334 100644 --- a/components/esp_timer/test_apps/main/test_esp_timer_dfs.c +++ b/components/esp_timer/test_apps/main/test_esp_timer_dfs.c @@ -26,7 +26,7 @@ #define ALARM_PERIOD_MS 100 #define ALARM_TIMES 200 // 200*100ms = 20s -static const char* TAG = "ESP_TIMER with DFS"; +ESP_LOG_ATTR_TAG(TAG, "ESP_TIMER with DFS"); static uint32_t s_current_alarm = 0; static uint64_t s_alarm_records[ALARM_TIMES + 1] = {0}; diff --git a/components/esp_usb_cdc_rom_console/usb_console.c b/components/esp_usb_cdc_rom_console/usb_console.c index 5f946e1608..342e1de947 100644 --- a/components/esp_usb_cdc_rom_console/usb_console.c +++ b/components/esp_usb_cdc_rom_console/usb_console.c @@ -70,7 +70,7 @@ static esp_usb_console_cb_t s_tx_cb; static void *s_cb_arg; static esp_timer_handle_t s_restart_timer; -static const char* TAG = "usb_console"; +ESP_LOG_ATTR_TAG(TAG, "usb_console"); /* This lock is used for two purposes: * - To protect functions which write something to USB, e.g. esp_usb_console_write_buf. diff --git a/components/freertos/app_startup.c b/components/freertos/app_startup.c index c7f8116769..0aad7e93c1 100644 --- a/components/freertos/app_startup.c +++ b/components/freertos/app_startup.c @@ -57,7 +57,7 @@ CONFIG_FREERTOS_UNICORE and CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE should be identic // -------------------- Declarations ----------------------- static void main_task(void* args); -static const char* APP_START_TAG = "app_start"; +ESP_LOG_ATTR_TAG(APP_START_TAG, "app_start"); // ------------------ CPU0 App Startup --------------------- @@ -144,7 +144,7 @@ void esp_startup_start_app_other_cores(void) * - main_task will self delete if app_main returns * ------------------------------------------------------------------------------------------------------------------ */ -static const char* MAIN_TAG = "main_task"; +ESP_LOG_ATTR_TAG(MAIN_TAG, "main_task"); #if !CONFIG_FREERTOS_UNICORE static volatile bool s_other_cpu_startup_done = false; diff --git a/components/hal/adc_oneshot_hal.c b/components/hal/adc_oneshot_hal.c index 096fbcfb89..935302c081 100644 --- a/components/hal/adc_oneshot_hal.c +++ b/components/hal/adc_oneshot_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -24,6 +24,7 @@ #include "esp_rom_sys.h" #endif +HAL_LOG_ATTR_TAG(TAG, "adc_hal"); #if CONFIG_ADC_DISABLE_DAC_OUTPUT // To disable DAC, workarounds, see this function body to know more @@ -105,14 +106,14 @@ static void adc_hal_onetime_start(adc_unit_t unit, uint32_t clk_src_freq_hz, uin uint32_t adc_ctrl_clk = clk_src_freq_hz / (ADC_LL_CLKM_DIV_NUM_DEFAULT + ADC_LL_CLKM_DIV_A_DEFAULT / ADC_LL_CLKM_DIV_B_DEFAULT + 1); //Convert frequency to time (us). Since decimals are removed by this division operation. Add 1 here in case of the fact that delay is not enough. uint32_t sample_delay_us = ((1000 * 1000) / adc_ctrl_clk + 1) * 3; - HAL_EARLY_LOGD("adc_hal", "clk_src_freq_hz: %"PRIu32", adc_ctrl_clk: %"PRIu32", sample_delay_us: %"PRIu32"", clk_src_freq_hz, adc_ctrl_clk, sample_delay_us); + HAL_EARLY_LOGD(TAG, "clk_src_freq_hz: %"PRIu32", adc_ctrl_clk: %"PRIu32", sample_delay_us: %"PRIu32"", clk_src_freq_hz, adc_ctrl_clk, sample_delay_us); //This coefficient (8) is got from test, and verified from DT. When digi_clk is not smaller than ``APB_CLK_FREQ/8``, no delay is needed. if (adc_ctrl_clk >= APB_CLK_FREQ/8) { sample_delay_us = 0; } - HAL_EARLY_LOGD("adc_hal", "delay for `onetime_start` signal captured: %"PRIu32"", sample_delay_us); + HAL_EARLY_LOGD(TAG, "delay for `onetime_start` signal captured: %"PRIu32"", sample_delay_us); adc_oneshot_ll_start(false); esp_rom_delay_us(sample_delay_us); adc_oneshot_ll_start(true); @@ -125,7 +126,7 @@ static void adc_hal_onetime_start(adc_unit_t unit, uint32_t clk_src_freq_hz, uin */ uint32_t sar_clk = adc_ctrl_clk / ADC_LL_DIGI_SAR_CLK_DIV_DEFAULT; *read_delay_us = ((1000 * 1000) / sar_clk + 1) * ADC_LL_DELAY_CYCLE_AFTER_DONE_SIGNAL; - HAL_EARLY_LOGD("adc_hal", "clk_src_freq_hz: %"PRIu32", sar_clk: %"PRIu32", read_delay_us: %"PRIu32"", clk_src_freq_hz, sar_clk, read_delay_us); + HAL_EARLY_LOGD(TAG, "clk_src_freq_hz: %"PRIu32", sar_clk: %"PRIu32", read_delay_us: %"PRIu32"", clk_src_freq_hz, sar_clk, read_delay_us); #endif //ADC_LL_DELAY_CYCLE_AFTER_DONE_SIGNAL #else diff --git a/components/hal/esp32/clk_tree_hal.c b/components/hal/esp32/clk_tree_hal.c index 1b5b676cea..ecd7c90712 100644 --- a/components/hal/esp32/clk_tree_hal.c +++ b/components/hal/esp32/clk_tree_hal.c @@ -11,7 +11,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32c2/clk_tree_hal.c b/components/hal/esp32c2/clk_tree_hal.c index ca8a1b27cd..9e14659ac8 100644 --- a/components/hal/esp32c2/clk_tree_hal.c +++ b/components/hal/esp32c2/clk_tree_hal.c @@ -12,7 +12,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32c3/clk_tree_hal.c b/components/hal/esp32c3/clk_tree_hal.c index 6ce1f5a11a..5842ddd7f4 100644 --- a/components/hal/esp32c3/clk_tree_hal.c +++ b/components/hal/esp32c3/clk_tree_hal.c @@ -11,7 +11,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32c6/clk_tree_hal.c b/components/hal/esp32c6/clk_tree_hal.c index 432b75d7b3..b803cfdb2d 100644 --- a/components/hal/esp32c6/clk_tree_hal.c +++ b/components/hal/esp32c6/clk_tree_hal.c @@ -11,7 +11,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32h2/clk_tree_hal.c b/components/hal/esp32h2/clk_tree_hal.c index 006d63d261..257081d390 100644 --- a/components/hal/esp32h2/clk_tree_hal.c +++ b/components/hal/esp32h2/clk_tree_hal.c @@ -11,7 +11,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32p4/clk_tree_hal.c b/components/hal/esp32p4/clk_tree_hal.c index b8f809dc79..16fc5d5b68 100644 --- a/components/hal/esp32p4/clk_tree_hal.c +++ b/components/hal/esp32p4/clk_tree_hal.c @@ -10,7 +10,7 @@ #include "hal/assert.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32s2/clk_tree_hal.c b/components/hal/esp32s2/clk_tree_hal.c index b8deecb311..6c1f750a18 100644 --- a/components/hal/esp32s2/clk_tree_hal.c +++ b/components/hal/esp32s2/clk_tree_hal.c @@ -11,7 +11,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/esp32s3/clk_tree_hal.c b/components/hal/esp32s3/clk_tree_hal.c index f72f6f2dd7..44a75f79da 100644 --- a/components/hal/esp32s3/clk_tree_hal.c +++ b/components/hal/esp32s3/clk_tree_hal.c @@ -11,7 +11,7 @@ #include "hal/gpio_ll.h" #include "hal/log.h" -static const char *CLK_HAL_TAG = "clk_hal"; +HAL_LOG_ATTR_TAG(CLK_HAL_TAG, "clk_hal"); uint32_t clk_hal_soc_root_get_freq_mhz(soc_cpu_clk_src_t cpu_clk_src) { diff --git a/components/hal/lcd_hal.c b/components/hal/lcd_hal.c index e28752d796..fc147a42df 100644 --- a/components/hal/lcd_hal.c +++ b/components/hal/lcd_hal.c @@ -8,6 +8,8 @@ #include "hal/lcd_ll.h" #include "hal/log.h" +HAL_LOG_ATTR_TAG(TAG, "lcd_hal"); + void lcd_hal_init(lcd_hal_context_t *hal, int id) { hal->dev = LCD_LL_GET_HW(id); @@ -37,7 +39,7 @@ uint32_t lcd_hal_cal_pclk_freq(lcd_hal_context_t *hal, uint32_t src_freq_hz, uin real_freq = hal_utils_calc_clk_div_frac_fast(&lcd_clk_info, lcd_clk_div); } - HAL_EARLY_LOGD("lcd_hal", "n=%"PRIu32",a=%"PRIu32",b=%"PRIu32",mo=%"PRIu32, lcd_clk_div->integer, lcd_clk_div->denominator, lcd_clk_div->numerator, mo); + HAL_EARLY_LOGD(TAG, "n=%"PRIu32",a=%"PRIu32",b=%"PRIu32",mo=%"PRIu32, lcd_clk_div->integer, lcd_clk_div->denominator, lcd_clk_div->numerator, mo); lcd_ll_set_pixel_clock_prescale(hal->dev, mo); return real_freq / mo; } diff --git a/components/hal/mipi_csi_hal.c b/components/hal/mipi_csi_hal.c index 80f3e1e636..07e8e203c1 100644 --- a/components/hal/mipi_csi_hal.c +++ b/components/hal/mipi_csi_hal.c @@ -11,6 +11,8 @@ #define MHZ (1000 * 1000) +HAL_LOG_ATTR_TAG(TAG, "csi_hal"); + void s_mipi_csi_hal_phy_write_register(mipi_csi_hal_context_t *hal, uint8_t reg_addr, uint8_t reg_val) { mipi_csi_phy_ll_write_clock(hal->host_dev, 0, false); @@ -47,7 +49,7 @@ void mipi_csi_hal_init(mipi_csi_hal_context_t *hal, const mipi_csi_hal_config_t } } s_mipi_csi_hal_phy_write_register(hal, 0x44, hs_freq_sel << 1); - HAL_LOGD("csi_hal", "CSI-DPHY lane_rate: %d Hz, hs_freq: 0x%x, lane_num: 0x%x", csi_lane_rate, hs_freq_sel, config->lanes_num); + HAL_LOGD(TAG, "CSI-DPHY lane_rate: %d Hz, hs_freq: 0x%x, lane_num: 0x%x", csi_lane_rate, hs_freq_sel, config->lanes_num); mipi_csi_phy_ll_enable_shutdown_input(hal->host_dev, false); mipi_csi_phy_ll_enable_reset_output(hal->host_dev, false); mipi_csi_host_ll_enable_reset_output(hal->host_dev, false); diff --git a/components/hal/mipi_dsi_hal.c b/components/hal/mipi_dsi_hal.c index 8e57fab191..5d5c247761 100644 --- a/components/hal/mipi_dsi_hal.c +++ b/components/hal/mipi_dsi_hal.c @@ -12,6 +12,8 @@ #include "hal/log.h" #include "soc/mipi_dsi_periph.h" +HAL_LOG_ATTR_TAG(TAG, "dsi_hal"); + void mipi_dsi_hal_init(mipi_dsi_hal_context_t *hal, const mipi_dsi_hal_config_t *config) { hal->host = MIPI_DSI_LL_GET_HOST(config->bus_id); @@ -85,7 +87,7 @@ void mipi_dsi_hal_configure_phy_pll(mipi_dsi_hal_context_t *hal, uint32_t phy_cl mipi_dsi_hal_phy_write_register(hal, 0x18, 0x80 | (((pll_M - 1) >> 5) & 0x0F)); // update the real lane bit rate hal->lane_bit_rate_mbps = ref_freq_mhz * pll_M / pll_N; - HAL_LOGD("dsi_hal", "phy pll: ref=%" PRIu32 "Hz, lane_bit_rate=%" PRIu32 "Mbps, M=%" PRId16 ", N=%" PRId8 ", hsfreqrange=%" PRId8, + HAL_LOGD(TAG, "phy pll: ref=%" PRIu32 "Hz, lane_bit_rate=%" PRIu32 "Mbps, M=%" PRId16 ", N=%" PRId8 ", hsfreqrange=%" PRId8, phy_clk_src_freq_hz, hal->lane_bit_rate_mbps, pll_M, pll_N, hs_freq_sel); } diff --git a/components/hal/platform_port/include/hal/log.h b/components/hal/platform_port/include/hal/log.h index bfa9c58494..0d42fe9bb9 100644 --- a/components/hal/platform_port/include/hal/log.h +++ b/components/hal/platform_port/include/hal/log.h @@ -14,6 +14,8 @@ #if __has_include("esp_log.h") #include "esp_log.h" +#define HAL_LOG_ATTR_TAG(tag, str) ESP_LOG_ATTR_TAG(tag, str) +#define HAL_LOG_ATTR_TAG_DRAM(tag, str) ESP_LOG_ATTR_TAG_DRAM(tag, str) #define HAL_LOGE(...) ESP_LOGE(__VA_ARGS__) #define HAL_LOGW(...) ESP_LOGW(__VA_ARGS__) @@ -38,6 +40,8 @@ #define HAL_LOG_DEBUG 4 #define HAL_LOG_VERBOSE 5 +#define HAL_LOG_ATTR_TAG(tag, str) static __attribute__((unused)) const char *tag = str +#define HAL_LOG_ATTR_TAG_DRAM(tag, str) static __attribute__((unused)) DRAM_ATTR const char tag[] = str #if CONFIG_HAL_LOG_LEVEL >= HAL_LOG_ERROR #define HAL_LOGE(tag, fmt, ...) esp_rom_printf("%s(err): " fmt, tag, ##__VA_ARGS__) diff --git a/components/hal/sdio_slave_hal.c b/components/hal/sdio_slave_hal.c index 1c48fe18d9..6f6dfc55c3 100644 --- a/components/hal/sdio_slave_hal.c +++ b/components/hal/sdio_slave_hal.c @@ -23,8 +23,7 @@ return ret_val;\ } }while (0) -/* The tag may be unused if log level is set to NONE */ -static const __attribute__((unused)) char TAG[] = "SDIO_HAL"; +HAL_LOG_ATTR_TAG(TAG, "SDIO_HAL"); static esp_err_t init_send_queue(sdio_slave_context_t *hal); diff --git a/components/hal/spi_flash_hal.c b/components/hal/spi_flash_hal.c index 98d3199bc2..6716e94ad2 100644 --- a/components/hal/spi_flash_hal.c +++ b/components/hal/spi_flash_hal.c @@ -19,7 +19,7 @@ #define APB_CYCLE_NS (1000*1000*1000LL/APB_CLK_FREQ) -static const char *TAG = "flash_hal"; +HAL_LOG_ATTR_TAG(TAG, "flash_hal"); static uint32_t get_flash_clock_divider(const spi_flash_hal_config_t *cfg) { diff --git a/components/hal/spi_hal_iram.c b/components/hal/spi_hal_iram.c index 1b38660a58..cfde4fd518 100644 --- a/components/hal/spi_hal_iram.c +++ b/components/hal/spi_hal_iram.c @@ -14,8 +14,7 @@ #include "soc/ext_mem_defs.h" #include "soc/soc_caps.h" -/* The tag may be unused if log level is set to NONE */ -static __attribute__((unused)) char SPI_HAL_TAG[] = "spi_hal"; +HAL_LOG_ATTR_TAG(SPI_HAL_TAG, "spi_hal"); void spi_hal_setup_device(spi_hal_context_t *hal, const spi_hal_dev_config_t *dev) { diff --git a/components/hal/test_apps/crypto/main/ds/test_ds.c b/components/hal/test_apps/crypto/main/ds/test_ds.c index e56d2f3c57..5f9531b3c7 100644 --- a/components/hal/test_apps/crypto/main/ds/test_ds.c +++ b/components/hal/test_apps/crypto/main/ds/test_ds.c @@ -15,7 +15,7 @@ #include "esp_log.h" #include "ds_types.h" -const static char *TAG = "test_ds"; +ESP_LOG_ATTR_TAG(TAG, "test_ds"); #include "rom/efuse.h" #include "rom/sha.h" diff --git a/components/hal/test_apps/crypto/main/ecdsa/test_ecdsa.c b/components/hal/test_apps/crypto/main/ecdsa/test_ecdsa.c index 7e78cacb30..5b91d3d4e9 100644 --- a/components/hal/test_apps/crypto/main/ecdsa/test_ecdsa.c +++ b/components/hal/test_apps/crypto/main/ecdsa/test_ecdsa.c @@ -31,7 +31,7 @@ #include "ecdsa_params.h" #include "hal_crypto_common.h" -__attribute__((unused)) static const char * TAG = "crypto_test"; +ESP_LOG_ATTR_TAG(TAG, "crypto_test"); static void ecdsa_enable_and_reset(void) { diff --git a/components/hal/test_apps/crypto/main/xts_aes/test_xts_aes.c b/components/hal/test_apps/crypto/main/xts_aes/test_xts_aes.c index 6d40d0f106..7b2ed7319b 100644 --- a/components/hal/test_apps/crypto/main/xts_aes/test_xts_aes.c +++ b/components/hal/test_apps/crypto/main/xts_aes/test_xts_aes.c @@ -17,7 +17,7 @@ #include "unity_fixture.h" #include "xts_aes_params.h" -const static char *TAG = "test_xts_aes"; +ESP_LOG_ATTR_TAG(TAG, "test_xts_aes"); const esp_partition_t *get_test_data_partition(void) { diff --git a/components/log/include/esp_log_attr.h b/components/log/include/esp_log_attr.h index 514456adfc..a41fd020c6 100644 --- a/components/log/include/esp_log_attr.h +++ b/components/log/include/esp_log_attr.h @@ -5,6 +5,7 @@ */ #pragma once +#include "sdkconfig.h" #include "esp_attr.h" #include "esp_private/log_attr.h" #include "esp_log_config.h" @@ -14,13 +15,54 @@ extern "C" { #endif #if ESP_LOG_MODE_BINARY_EN +#define ESP_LOG_ATTR NOLOAD_ATTR #define ESP_LOG_ATTR_STR(str) (__builtin_constant_p(str) ? ESP_LOG_NOLOAD_STR(str) : str) #define ESP_LOG_ATTR_DRAM_STR(str) ESP_LOG_NOLOAD_STR(str) #else +#define ESP_LOG_ATTR #define ESP_LOG_ATTR_STR(str) (str) #define ESP_LOG_ATTR_DRAM_STR(str) DRAM_STR(str) #endif +/** + * @brief Macro to initialize a static log tag string. + * + * This macro defines a static constant character array for a log tag with the specified name. + * If the configuration enables binary log mode and disables tag level implementation, + * the tag is placed with `NOLOAD_ATTR`. + * + * @param tag The variable name for the log tag. + * @param str The string literal representing the log tag. + * + * Usage example: + * ESP_LOG_ATTR_TAG(TAG, "TAG_NAME"); + */ +#if ESP_LOG_MODE_BINARY_EN && (NON_OS_BUILD || CONFIG_LOG_TAG_LEVEL_IMPL_NONE) +#define ESP_LOG_ATTR_TAG(tag, str) static __attribute__((unused)) NOLOAD_ATTR const char tag[] = str +#else +#define ESP_LOG_ATTR_TAG(tag, str) static __attribute__((unused)) const char *tag = str +#endif + +/** + * @brief Macro to initialize a static log tag string in DRAM. + * + * This macro defines a static constant character array for a log tag with the specified name, + * placing it in DRAM. It is used when the log tag needs to be accessible even when the cache is disabled. + * If the configuration enables binary log mode and disables tag level implementation, + * the tag is placed with `NOLOAD_ATTR`. + * + * @param tag The variable name for the log tag. + * @param str The string literal representing the log tag. + * + * Usage example: + * ESP_LOG_ATTR_TAG_DRAM(TAG, "TAG_NAME"); + */ +#if ESP_LOG_MODE_BINARY_EN && (NON_OS_BUILD || CONFIG_LOG_TAG_LEVEL_IMPL_NONE) +#define ESP_LOG_ATTR_TAG_DRAM(tag, str) ESP_LOG_ATTR_TAG(tag, str) +#else +#define ESP_LOG_ATTR_TAG_DRAM(tag, str) static __attribute__((unused)) DRAM_ATTR const char tag[] = str +#endif + #ifdef __cplusplus } #endif diff --git a/components/log/src/buffer/log_buffers.c b/components/log/src/buffer/log_buffers.c index e8b48f1dff..87f2453e7b 100644 --- a/components/log/src/buffer/log_buffers.c +++ b/components/log/src/buffer/log_buffers.c @@ -38,9 +38,11 @@ static void log_buffer_char_line(uintptr_t orig_buff, const void *ptr_line, char static void log_buffer_hexdump_line(uintptr_t orig_buff, const void *ptr_line, char *output_str, int buff_len); static void print_buffer(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t log_level, char *output_str, print_line_t print_line_func); -__attribute__((unused)) const char __ESP_BUFFER_HEX_FORMAT__[] = "__ESP_BUFFER_HEX_FORMAT__ len %d, array %s, address %p"; -__attribute__((unused)) const char __ESP_BUFFER_CHAR_FORMAT__[] = "__ESP_BUFFER_CHAR_FORMAT__ len %d, array %s, address %p"; -__attribute__((unused)) const char __ESP_BUFFER_HEXDUMP_FORMAT__[] = "__ESP_BUFFER_HEXDUMP_FORMAT__ len %d, array %s, address %p"; +#if ESP_LOG_MODE_BINARY_EN +NOLOAD_ATTR const char __ESP_BUFFER_HEX_FORMAT__[] = "__ESP_BUFFER_HEX_FORMAT__ len %d, array %s, address %p"; +NOLOAD_ATTR const char __ESP_BUFFER_CHAR_FORMAT__[] = "__ESP_BUFFER_CHAR_FORMAT__ len %d, array %s, address %p"; +NOLOAD_ATTR const char __ESP_BUFFER_HEXDUMP_FORMAT__[] = "__ESP_BUFFER_HEXDUMP_FORMAT__ len %d, array %s, address %p"; +#endif void esp_log_buffer_hex_internal(const char *tag, const void *buffer, uint16_t buff_len, esp_log_level_t log_level) { diff --git a/components/spi_flash/cache_utils.c b/components/spi_flash/cache_utils.c index 66fe47fab1..38ce2444ef 100644 --- a/components/spi_flash/cache_utils.c +++ b/components/spi_flash/cache_utils.c @@ -39,7 +39,7 @@ #include "esp_private/freertos_idf_additions_priv.h" #include "esp_log.h" -static __attribute__((unused)) const char *TAG = "cache"; +ESP_LOG_ATTR_TAG(TAG, "cache"); // Used only on ROM impl. in idf, this param unused, cache status hold by hal static uint32_t s_flash_op_cache_state[2]; diff --git a/components/spi_flash/esp_flash_api.c b/components/spi_flash/esp_flash_api.c index 257dfb4209..b67c16ca0e 100644 --- a/components/spi_flash/esp_flash_api.c +++ b/components/spi_flash/esp_flash_api.c @@ -118,7 +118,9 @@ void esp_flash_dump_counters(FILE* stream) #define IO_STR_LEN 10 -static const char io_mode_str[][IO_STR_LEN] = { +// Used only for logging, do not use for other purposes or remove ESP_LOG_ATTR. +// (this can be placed in noload section for bin logging mode). +static ESP_LOG_ATTR const char io_mode_str[][IO_STR_LEN] = { "slowrd", "fastrd", "dout", diff --git a/components/spi_flash/spi_flash_chip_drivers.c b/components/spi_flash/spi_flash_chip_drivers.c index ae5190854a..d866d72954 100644 --- a/components/spi_flash/spi_flash_chip_drivers.c +++ b/components/spi_flash/spi_flash_chip_drivers.c @@ -17,7 +17,7 @@ #include "sdkconfig.h" #include "esp_log.h" -__attribute__((unused)) static const char *TAG = "spi_flash"; +ESP_LOG_ATTR_TAG(TAG, "spi_flash"); #define FORMAT_STR "Detected %s flash chip but using generic driver. For optimal functionality, enable `SPI_FLASH_SUPPORT_%s_CHIP` in menuconfig" @@ -67,39 +67,39 @@ void spi_flash_chip_list_check(esp_flash_t *chip, uint32_t device_id) { { case SPI_FLASH_GD: if (&esp_flash_chip_gd == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "GigaDevice", "GD"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("GigaDevice"), ESP_LOG_ATTR_STR("GD")); } break; case SPI_FLASH_ISSI: if (&esp_flash_chip_issi == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "ISSI", "ISSI"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("ISSI"), ESP_LOG_ATTR_STR("ISSI")); } break; case SPI_FLASH_TH: if (&esp_flash_chip_th == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "TH", "TH"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("TH"), ESP_LOG_ATTR_STR("TH")); } break; case SPI_FLASH_WINBOND: if (&esp_flash_chip_winbond == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "winbond", "WINBOND"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("winbond"), ESP_LOG_ATTR_STR("WINBOND")); } break; case SPI_FLASH_MXIC: // Need to tell the difference between octal and quad flash. if (chip->read_mode < SPI_FLASH_OPI_FLAG) { if (&esp_flash_chip_mxic == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "MXIC", "MXIC"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("MXIC"), ESP_LOG_ATTR_STR("MXIC")); } } else { if (&esp_flash_chip_mxic_opi == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "MXIC", "MXIC_OPI"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("MXIC"), ESP_LOG_ATTR_STR("MXIC_OPI")); } } break; case SPI_FLASH_BY: if (&esp_flash_chip_boya == NULL) { - ESP_EARLY_LOGW(TAG, FORMAT_STR, "boya", "BOYA"); + ESP_EARLY_LOGW(TAG, FORMAT_STR, ESP_LOG_ATTR_STR("boya"), ESP_LOG_ATTR_STR("BOYA")); } break; default: