From d1c800fbbb0bf0193172d8a567db821e1fae1483 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Wed, 13 Jan 2021 20:05:57 +0800 Subject: [PATCH] components: fix ldgen check errors --- components/app_trace/linker.lf | 9 +++--- components/esp_hw_support/linker.lf | 3 +- .../port/esp32s3/CMakeLists.txt | 3 +- .../port/esp32s3/rtc_wdt.c} | 2 -- components/esp_pm/linker.lf | 14 ++++---- components/esp_system/linker.lf | 4 --- components/freertos/linker.lf | 32 +++++++++++-------- components/hal/linker.lf | 14 ++++---- components/heap/linker.lf | 3 +- components/lwip/linker.lf | 1 - components/soc/esp32/CMakeLists.txt | 1 - components/soc/esp32/rtc_periph.c | 0 components/soc/esp32s2/CMakeLists.txt | 1 - components/soc/esp32s3/CMakeLists.txt | 1 - components/soc/esp32s3/rtc_periph.c | 0 components/spi_flash/linker.lf | 3 +- components/xtensa/linker.lf | 3 +- tools/ci/check_ldgen_mapping_exceptions.txt | 1 + tools/ci/config/build.yml | 4 +-- 19 files changed, 51 insertions(+), 48 deletions(-) rename components/{soc/esp32s2/rtc_periph.c => esp_hw_support/port/esp32s3/rtc_wdt.c} (95%) delete mode 100644 components/soc/esp32/rtc_periph.c delete mode 100644 components/soc/esp32s3/rtc_periph.c diff --git a/components/app_trace/linker.lf b/components/app_trace/linker.lf index 9cdcf6b342..66d02d79cc 100644 --- a/components/app_trace/linker.lf +++ b/components/app_trace/linker.lf @@ -3,10 +3,11 @@ archive: libapp_trace.a entries: app_trace (noflash) app_trace_util (noflash) - SEGGER_SYSVIEW (noflash) - SEGGER_RTT_esp32 (noflash) - SEGGER_SYSVIEW_Config_FreeRTOS (noflash) - SEGGER_SYSVIEW_FreeRTOS (noflash) + if SYSVIEW_ENABLE = y: + SEGGER_SYSVIEW (noflash) + SEGGER_RTT_esp32 (noflash) + SEGGER_SYSVIEW_Config_FreeRTOS (noflash) + SEGGER_SYSVIEW_FreeRTOS (noflash) [mapping:driver] archive: libdriver.a diff --git a/components/esp_hw_support/linker.lf b/components/esp_hw_support/linker.lf index 1216b732d9..f0d4a3cceb 100644 --- a/components/esp_hw_support/linker.lf +++ b/components/esp_hw_support/linker.lf @@ -6,9 +6,8 @@ entries: regi2c_ctrl (noflash) rtc_clk (noflash) rtc_init:rtc_vddsdio_set_config (noflash) - rtc_periph (noflash_text) rtc_pm (noflash_text) rtc_sleep (noflash_text) rtc_time (noflash_text) - if IDF_TARGET_ESP32S3 = n: + if IDF_TARGET_ESP32C3 = n: rtc_wdt (noflash_text) diff --git a/components/esp_hw_support/port/esp32s3/CMakeLists.txt b/components/esp_hw_support/port/esp32s3/CMakeLists.txt index f9cdd99191..ae6dfd219d 100644 --- a/components/esp_hw_support/port/esp32s3/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32s3/CMakeLists.txt @@ -7,7 +7,8 @@ set(srcs "rtc_init.c" "rtc_pm.c" "rtc_sleep.c" - "rtc_time.c") + "rtc_time.c" + "rtc_wdt.c") add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" "${srcs}") target_sources(${COMPONENT_LIB} PRIVATE "${srcs}") diff --git a/components/soc/esp32s2/rtc_periph.c b/components/esp_hw_support/port/esp32s3/rtc_wdt.c similarity index 95% rename from components/soc/esp32s2/rtc_periph.c rename to components/esp_hw_support/port/esp32s3/rtc_wdt.c index 72b0de6ec5..d95ec54695 100644 --- a/components/soc/esp32s2/rtc_periph.c +++ b/components/esp_hw_support/port/esp32s3/rtc_wdt.c @@ -11,5 +11,3 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. - -#include "soc/rtc_periph.h" diff --git a/components/esp_pm/linker.lf b/components/esp_pm/linker.lf index e076a516c6..bb1acdd1c5 100644 --- a/components/esp_pm/linker.lf +++ b/components/esp_pm/linker.lf @@ -34,12 +34,14 @@ entries: archive: libesp_timer.a entries: if PM_SLP_IRAM_OPT = y: - esp_timer_impl_lac:esp_timer_impl_lock (noflash) - esp_timer_impl_lac:esp_timer_impl_unlock (noflash) - esp_timer_impl_lac:esp_timer_impl_advance (noflash) - esp_timer_impl_systimer:esp_timer_impl_lock (noflash) - esp_timer_impl_systimer:esp_timer_impl_unlock (noflash) - esp_timer_impl_systimer:esp_timer_impl_advance (noflash) + if ESP_TIMER_IMPL_TG0_LAC = y: + esp_timer_impl_lac:esp_timer_impl_lock (noflash) + esp_timer_impl_lac:esp_timer_impl_unlock (noflash) + esp_timer_impl_lac:esp_timer_impl_advance (noflash) + elif ESP_TIMER_IMPL_SYSTIMER = y: + esp_timer_impl_systimer:esp_timer_impl_lock (noflash) + esp_timer_impl_systimer:esp_timer_impl_unlock (noflash) + esp_timer_impl_systimer:esp_timer_impl_advance (noflash) [mapping:newlib_pm] archive: libnewlib.a diff --git a/components/esp_system/linker.lf b/components/esp_system/linker.lf index 17ab599c35..00544ff0df 100644 --- a/components/esp_system/linker.lf +++ b/components/esp_system/linker.lf @@ -6,10 +6,6 @@ entries: panic_arch (noflash) reset_reason (noflash) system_api:esp_system_abort (noflash) - startup:do_core_init (default) - startup:do_secondary_init (default) - startup:start_cpu0_default (default) - if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF: usb_console:esp_usb_console_write_char (noflash) diff --git a/components/freertos/linker.lf b/components/freertos/linker.lf index b1653f27c8..8daf386b88 100644 --- a/components/freertos/linker.lf +++ b/components/freertos/linker.lf @@ -2,18 +2,19 @@ archive: libfreertos.a entries: * (noflash_text) - queue:xQueueGenericCreateStatic (default) if FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y: port: pxPortInitialiseStack (default) port: xPortStartScheduler (default) - port: vPortStoreTaskMPUSettings (default) - port: vPortReleaseTaskMPUSettings (default) if ESP_PANIC_HANDLER_IRAM != y: tasks: uxTaskGetSnapshotAll (default) tasks: prvTaskGetSnapshot (default) tasks: prvTaskGetSnapshotsFromList (default) + if IDF_TARGET_ESP32S2 =n && IDF_TARGET_ESP32C3 = n : + port: vPortReleaseTaskMPUSettings (default) + tasks: xTaskCreateRestricted (default) + port: vPortStoreTaskMPUSettings (default) + tasks: vTaskAllocateMPURegions (default) tasks: prvTaskCheckFreeStackSpace (default) - tasks: prvListTaskWithinSingleList (default) tasks: prvInitialiseNewTask (default) tasks: prvInitialiseTaskLists (default) tasks: prvDeleteTCB (default) @@ -21,7 +22,6 @@ entries: tasks: prvAddCurrentTaskToDelayedList (default) tasks: prvIdleTask (default) tasks: prvAddNewTaskToReadyList (default) - tasks: xTaskCreateStaticPinnedToCore (default) tasks: xTaskCreatePinnedToCore (default) tasks: vTaskResume (default) tasks: vTaskStartScheduler (default) @@ -45,16 +45,14 @@ entries: tasks: uxTaskResetEventItemValue (default) tasks: ulTaskNotifyTake (default) tasks: xTaskNotifyWait (default) - tasks: xTaskNotify (default) + tasks: xTaskGenericNotify (default) tasks: eTaskGetState (default) tasks: pxTaskGetStackStart (default) tasks: uxTaskGetStackHighWaterMark (default) - tasks: vTaskAllocateMPURegions (default) tasks: vTaskEndScheduler (default) tasks: vTaskList (default) tasks: vTaskMissedYield (default) tasks: vTaskSetThreadLocalStoragePointer (default) - tasks: xTaskCreateRestricted (default) tasks: xTaskGetAffinity (default) tasks: xTaskGetIdleTaskHandleForCPU (default) timers: prvInsertTimerInActiveList (default) @@ -68,7 +66,6 @@ entries: timers: prvProcessReceivedCommands (default) timers: xTimerCreateTimerTask (default) timers: xTimerCreate (default) - timers: xTimerCreateStatic (default) timers: xTimerGenericCommand (default) timers: xTimerGetPeriod (default) timers: xTimerGetExpiryTime (default) @@ -77,7 +74,6 @@ entries: timers: vTimerSetTimerID (default) timers: prvGetNextExpireTime (default) event_groups: prvTestWaitCondition (default) - event_groups: xEventGroupCreateStatic (default) event_groups: xEventGroupCreate (default) event_groups: xEventGroupWaitBits (default) event_groups: xEventGroupClearBits (default) @@ -92,11 +88,9 @@ entries: queue: xQueueGenericReset (default) queue: xQueueGenericCreate (default) queue: xQueueGetMutexHolder (default) - queue: xQueueCreateCountingSemaphoreStatic (default) queue: xQueueCreateCountingSemaphore (default) queue: xQueueGenericSend (default) queue: xQueueCreateMutex (default) - queue: xQueueCreateMutexStatic (default) queue: xQueueGiveMutexRecursive (default) queue: xQueueTakeMutexRecursive (default) queue: uxQueueMessagesWaiting (default) @@ -114,4 +108,16 @@ entries: queue: xQueueSelectFromSet (default) port_common:main_task (default) port:esp_startup_start_app (default) - port:esp_startup_start_app_other_cores (default) + if ESP_SYSTEM_SINGLE_CORE_MODE = n: + port:esp_startup_start_app_other_cores (default) + +if FREERTOS_SUPPORT_STATIC_ALLOCATION = y && FREERTOS_PLACE_FUNCTIONS_INTO_FLASH = y: + [mapping:freertos_static] + archive: libfreertos.a + entries: + queue:xQueueGenericCreateStatic (default) + queue: xQueueCreateCountingSemaphoreStatic (default) + tasks: xTaskCreateStaticPinnedToCore (default) + timers: xTimerCreateStatic (default) + event_groups: xEventGroupCreateStatic (default) + queue: xQueueCreateMutexStatic (default) diff --git a/components/hal/linker.lf b/components/hal/linker.lf index a00bed5fb4..16084fd7f7 100644 --- a/components/hal/linker.lf +++ b/components/hal/linker.lf @@ -10,12 +10,14 @@ entries: spi_flash_hal_iram (noflash) ledc_hal_iram (noflash) i2c_hal_iram (noflash) - spi_flash_hal_gpspi (noflash) cpu_hal (noflash) soc_hal (noflash) wdt_hal_iram (noflash) - systimer_hal (noflash) - if TWAI_ISR_IN_IRAM = y: - twai_hal_iram (noflash) - else: - twai_hal_iram (default) + if IDF_TARGET_ESP32C3 = n: + if TWAI_ISR_IN_IRAM = y: + twai_hal_iram (noflash) + else: + twai_hal_iram (default) + if IDF_TARGET_ESP32 = n: + spi_flash_hal_gpspi (noflash) + systimer_hal (noflash) diff --git a/components/heap/linker.lf b/components/heap/linker.lf index 377ba7adae..a2be01e113 100644 --- a/components/heap/linker.lf +++ b/components/heap/linker.lf @@ -3,4 +3,5 @@ archive: libheap.a entries: heap_tlsf (noflash) multi_heap (noflash) - multi_heap_poisoning (noflash) + if HEAP_POISONING_DISABLED = n: + multi_heap_poisoning (noflash) diff --git a/components/lwip/linker.lf b/components/lwip/linker.lf index 6ee75ab24c..55972ecae5 100644 --- a/components/lwip/linker.lf +++ b/components/lwip/linker.lf @@ -62,7 +62,6 @@ entries: pbuf:pbuf_header_impl (noflash_text) pbuf:pbuf_header (noflash_text) pbuf:pbuf_free (noflash_text) - timeouts:sys_timeouts_mbox_fetch (noflash_text) udp:udp_input_local_match (noflash_text) udp:udp_input (noflash_text) udp:udp_send (noflash_text) diff --git a/components/soc/esp32/CMakeLists.txt b/components/soc/esp32/CMakeLists.txt index da24107659..3814ba716f 100644 --- a/components/soc/esp32/CMakeLists.txt +++ b/components/soc/esp32/CMakeLists.txt @@ -9,7 +9,6 @@ set(srcs "pcnt_periph.c" "rmt_periph.c" "rtc_io_periph.c" - "rtc_periph.c" "sdio_slave_periph.c" "sdmmc_periph.c" "sigmadelta_periph.c" diff --git a/components/soc/esp32/rtc_periph.c b/components/soc/esp32/rtc_periph.c deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/components/soc/esp32s2/CMakeLists.txt b/components/soc/esp32s2/CMakeLists.txt index e25f98acb0..ef4dc08edc 100644 --- a/components/soc/esp32s2/CMakeLists.txt +++ b/components/soc/esp32s2/CMakeLists.txt @@ -10,7 +10,6 @@ set(srcs "pcnt_periph.c" "rmt_periph.c" "rtc_io_periph.c" - "rtc_periph.c" "sigmadelta_periph.c" "soc_memory_layout.c" "spi_periph.c" diff --git a/components/soc/esp32s3/CMakeLists.txt b/components/soc/esp32s3/CMakeLists.txt index 6db89831b6..3a33c3186f 100644 --- a/components/soc/esp32s3/CMakeLists.txt +++ b/components/soc/esp32s3/CMakeLists.txt @@ -11,7 +11,6 @@ set(srcs "pcnt_periph.c" "rmt_periph.c" "rtc_io_periph.c" - "rtc_periph.c" "sdio_slave_periph.c" "sdmmc_periph.c" "sigmadelta_periph.c" diff --git a/components/soc/esp32s3/rtc_periph.c b/components/soc/esp32s3/rtc_periph.c deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/components/spi_flash/linker.lf b/components/spi_flash/linker.lf index 25d9641143..6691173e54 100644 --- a/components/spi_flash/linker.lf +++ b/components/spi_flash/linker.lf @@ -1,8 +1,7 @@ [mapping:spi_flash] archive: libspi_flash.a entries: - if IDF_TARGET_ESP32 = y: - spi_flash_rom_patch (noflash) + spi_flash_rom_patch (noflash) spi_flash_chip_generic (noflash) spi_flash_chip_issi (noflash) spi_flash_chip_mxic (noflash) diff --git a/components/xtensa/linker.lf b/components/xtensa/linker.lf index 3ab5bc7c7a..157857b722 100644 --- a/components/xtensa/linker.lf +++ b/components/xtensa/linker.lf @@ -2,7 +2,8 @@ archive: libxtensa.a entries: eri (noflash_text) - stdatomic (noflash) + if IDF_TARGET_ESP32S2 = y: + stdatomic (noflash) [mapping:xt_hal] archive: libxt_hal.a diff --git a/tools/ci/check_ldgen_mapping_exceptions.txt b/tools/ci/check_ldgen_mapping_exceptions.txt index 86370cb96e..eebfb1cd7c 100644 --- a/tools/ci/check_ldgen_mapping_exceptions.txt +++ b/tools/ci/check_ldgen_mapping_exceptions.txt @@ -1,2 +1,3 @@ libc sha256_coredump +gcc diff --git a/tools/ci/config/build.yml b/tools/ci/config/build.yml index bc057aadb1..7344367396 100644 --- a/tools/ci/config/build.yml +++ b/tools/ci/config/build.yml @@ -114,7 +114,7 @@ build_ssc_esp32s2: BUILD_SYSTEM: "cmake" TEST_TYPE: "unit_test" PYTHON_VER: 3 - LDGEN_CHECK_MAPPING: 0 + LDGEN_CHECK_MAPPING: 1 script: - ${IDF_PATH}/tools/ci/find_apps_build_apps.sh - cd $CI_PROJECT_DIR/tools/unit-test-app @@ -157,7 +157,7 @@ build_esp_idf_tests_cmake_esp32c3: LOG_PATH: ${CI_PROJECT_DIR}/log_${TEST_PREFIX} BUILD_PATH: ${CI_PROJECT_DIR}/build_${TEST_PREFIX} PYTHON_VER: 3 - LDGEN_CHECK_MAPPING: 0 + LDGEN_CHECK_MAPPING: 1 script: # it's not possible to build 100% out-of-tree and have the "artifacts" # mechanism work, but this is the next best thing