Page 1 of 1

Update from 4.4 to 5.2 leads to linker errors

Posted: Mon Jun 10, 2024 9:04 pm
by N3xus132
Hi all!

This is my first post in this forum and I hope that you are able to help me.

I inherited a project that uses IDF 4.4. Because of the maintenance period I now wanted to update the complete Project to the latest one (5.2.1).
I did this by downloading the IDF 5.2.1 to my Laptop and running the build. Of course many problems popped up so I solved one after the other. During this process it was necessary to manually go through the sdkconfig file because nearly none of the settings that were used were correctly translated or reused. It seems that most of them were set to the defaults.

Now I got stuck with the following error message:

Code: Select all

/Documents/esp/.espressif/python_env/idf5.2_py3.9_env/bin/python /Users/-/Documents/esp/v5.2.1/esp-idf/components/esptool_py/esptool/espsecure.py sign_data -k secure_boot_signing_key2.pem -v 2 --append_signatures -o signed_bootloader.bin build/bootloader/bootloader.bin" && /opt/homebrew/Cellar/cmake/3.28.2/bin/cmake -E echo "Secure boot enabled, so bootloader not flashed automatically." && /opt/homebrew/Cellar/cmake/3.28.2/bin/cmake -E echo "      /Users/-/Documents/esp/.espressif/python_env/idf5.2_py3.9_env/bin/python  /Users/-/Documents/esp/v5.2.1/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32s2 --port=(PORT) --baud=(BAUD) --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_freq 80m --flash_size keep 0x1000 /Users/-/Documents/project/build/bootloader/bootloader.bin" && /opt/homebrew/Cellar/cmake/3.28.2/bin/cmake -E echo ==============================================================================
/Users/-/Documents/esp/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/esp_hw_support/libesp_hw_support.a(rtc_time.c.obj):(.literal.startup.enable_timer_group0_for_calibration+0x4): undefined reference to `periph_rcc_acquire_enter'
/Users/-/Documents/esp/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/esp_hw_support/libesp_hw_support.a(rtc_time.c.obj):(.literal.startup.enable_timer_group0_for_calibration+0x8): undefined reference to `periph_rcc_acquire_exit'
/Users/-/Documents/esp/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: esp-idf/esp_hw_support/libesp_hw_support.a(rtc_time.c.obj): in function `enable_timer_group0_for_calibration':
/Users/-/Documents/esp/v5.2.1/esp-idf/components/esp_hw_support/port/esp32s2/rtc_time.c:266:(.text.startup.enable_timer_group0_for_calibration+0x6): undefined reference to `periph_rcc_acquire_enter'
/Users/-/Documents/esp/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld: /Users/-/Documents/esp/v5.2.1/esp-idf/components/esp_hw_support/port/esp32s2/rtc_time.c:266:(.text.startup.enable_timer_group0_for_calibration+0x53): undefined reference to `periph_rcc_acquire_exit'
Can somebody help me with this error?
Is there generally a more straightforward way to update the IDF?

Thanks in advance!

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 11, 2024 5:37 am
by ESP_Sprite
Strange. Do you still get this when you delete the 'build' directory and do a full rebuild?

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 11, 2024 6:20 am
by N3xus132
Yes, unfortunately the problem still exists after a complete rebuild.

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 11, 2024 8:05 am
by chegewara
Did you finish update with

Code: Select all

git submodule update
and
./install.sh

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 11, 2024 9:57 am
by ESP_Sprite
Can you share your sdkconfig file? EDIT: Also what ^^ said.

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 11, 2024 3:33 pm
by N3xus132
chegewara wrote:
Tue Jun 11, 2024 8:05 am
Did you finish update with

Code: Select all

git submodule update
and
./install.sh
I made the update to the new IDF by installing the new version using VS Code. Nevertheless I went to the folder and ran the commands above. Unfortunately without success. The same error still shows up.
ESP_Sprite wrote: Can you share your sdkconfig file? EDIT: Also what ^^ said.
I attached the sdkconfig (as a txt to fulfill the requirements of the forum).

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 11, 2024 8:41 pm
by N3xus132
I also realized now that it seems to happen if I enable the option CONFIG_BOOTLOADER_RESERVE_RTC_SIZE in menuconfig.
Does it help somehow?

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Tue Jun 18, 2024 9:13 pm
by N3xus132
No ideas somebody?

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Thu Jun 20, 2024 6:09 pm
by DreadNaught
I am fairly new to IDF and just migrated a project from IDF 4.4 to 5.2.
It also had many linking errors when the 4.4 project was opened in 5.2

My solution was to create a new project in IDF 5.2 using the template-app and copy over the source code.
It did have a few different #include errors, but the migration documents showed the old and new include name.

Re: Update from 4.4 to 5.2 leads to linker errors

Posted: Thu Jun 27, 2024 11:59 pm
by chegewara
N3xus132 wrote:
Tue Jun 11, 2024 8:41 pm
I also realized now that it seems to happen if I enable the option CONFIG_BOOTLOADER_RESERVE_RTC_SIZE in menuconfig.
Does it help somehow?
It looks like a bug to report on github