question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESP32CAM Fails at Linking firmware.elf

See original GitHub issue

I am using PlatformIO v2.2.1 I am trying to set up this project although I am getting some errors, other errors I was able to debug and find a solution, but this elf issue I cannot seem to resolve.

The tutorial is here https://d268s23yov0ww.cloudfront.net/aws-csdk-mqtt-rekognition-src.zip - a aws guide by amazon.

my plantformio.ini looks like this

[env:esp32dev] platform = espressif32 **//I have also tried using the url here as per other solutions, still same error** framework = espidf **// I have also swapped board and framework order, still same issue.** board = esp32cam monitor_speed = 115200 upload_port = COM32 board_build.embed_txtfiles = src/certs/private.pem.key src/certs/certificate.pem.crt src/certs/aws-root-ca.pem board_build.partitions = partitions_singleapp.csv

Below is the error i receive Linking .pio\build\esp32dev\firmware.elf c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\aws-root-ca.pem.S.o: in function aws_root_ca_pem’: (.rodata.embedded+0x0): multiple definition of aws_root_ca_pem'; .pio\build\esp32dev\aws-root-ca.pem.o:(.rodata.embedded+0x0): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\aws-root-ca.pem.S.o: in function aws_root_ca_pem’: (.rodata.embedded+0x0): multiple definition of _binary_aws_root_ca_pem_start'; .pio\build\esp32dev\aws-root-ca.pem.o:(.rodata.embedded+0x0): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\aws-root-ca.pem.S.o: in function _binary_aws_root_ca_pem_end’: (.rodata.embedded+0x4a5): multiple definition of _binary_aws_root_ca_pem_end'; .pio\build\esp32dev\aws-root-ca.pem.o:(.rodata.embedded+0x4a5): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\aws-root-ca.pem.S.o: in function _binary_aws_root_ca_pem_end’: (.rodata.embedded+0x4a5): multiple definition of aws_root_ca_pem_length'; .pio\build\esp32dev\aws-root-ca.pem.o:(.rodata.embedded+0x4a5): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\certificate.pem.crt.S.o: in function certificate_pem_crt’: (.rodata.embedded+0x0): multiple definition of certificate_pem_crt'; .pio\build\esp32dev\certificate.pem.crt.o:(.rodata.embedded+0x0): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\certificate.pem.crt.S.o: in function certificate_pem_crt’: (.rodata.embedded+0x0): multiple definition of _binary_certificate_pem_crt_start'; .pio\build\esp32dev\certificate.pem.crt.o:(.rodata.embedded+0x0): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\certificate.pem.crt.S.o: in function _binary_certificate_pem_crt_end’: (.rodata.embedded+0x4c9): multiple definition of _binary_certificate_pem_crt_end'; .pio\build\esp32dev\certificate.pem.crt.o:(.rodata.embedded+0x4c9): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\certificate.pem.crt.S.o: in function _binary_certificate_pem_crt_end’: (.rodata.embedded+0x4c9): multiple definition of certificate_pem_crt_length'; .pio\build\esp32dev\certificate.pem.crt.o:(.rodata.embedded+0x4c9): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\private.pem.key.S.o: in function private_pem_key’: (.rodata.embedded+0x0): multiple definition of private_pem_key'; .pio\build\esp32dev\private.pem.key.o:(.rodata.embedded+0x0): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\private.pem.key.S.o: in function private_pem_key’: (.rodata.embedded+0x0): multiple definition of _binary_private_pem_key_start'; .pio\build\esp32dev\private.pem.key.o:(.rodata.embedded+0x0): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\private.pem.key.S.o: in function _binary_private_pem_key_end’: (.rodata.embedded+0x690): multiple definition of _binary_private_pem_key_end'; .pio\build\esp32dev\private.pem.key.o:(.rodata.embedded+0x690): first defined here c:/users/imgreenman/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\esp-idf\.pio\build\esp32dev\private.pem.key.S.o: in function _binary_private_pem_key_end’: (.rodata.embedded+0x690): multiple definition of private_pem_key_length'; .pio\build\esp32dev\private.pem.key.o:(.rodata.embedded+0x690): first defined here collect2.exe: error: ld returned 1 exit status *** [.pio\build\esp32dev\firmware.elf] Error 1

**I created new certs, does not make a difference, I have commented them out in the platfromio.ini to receive a different warning.

There was a an error** home/xxx/workspace/m5cam/components/esp32-camera/driver/twi.c:61:24: error: 'rtc_gpio_desc' undeclared (first use in this function); did you mean 'rtc_io_desc'? uint32_t rtc_reg = rtc_gpio_desc[pin].reg;

Which was resolved by https://user-images.githubusercontent.com/30533684/82684064-04b3cc00-9c20-11ea-82bb-a4b4960fbe71.png

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kennycodercommented, Dec 9, 2020

Ok I found the issue with the newer version. In the src folder, open CMakeLists.txt and remove the following:

if(CONFIG_EXAMPLE_EMBEDDED_CERTS) target_add_binary_data(${COMPONENT_TARGET} “certs/aws-root-ca.pem” TEXT) target_add_binary_data(${COMPONENT_TARGET} “certs/certificate.pem.crt” TEXT) target_add_binary_data(${COMPONENT_TARGET} “certs/private.pem.key” TEXT) endif()

This is not necessary anymore

I will update the main source code provided with AWS’s example. Thanks for reporting!

2reactions
kennycodercommented, Dec 9, 2020

I’m building with the following versions:

  • espressif32 1.12.3
  • framework-espidf 3.40001.200521 (4.0.1)
  • tool-cmake 3.16.4
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • tool-idf 1.0.1
  • tool-mconf 1.4060000.20190628 (406.0.0)
  • tool-ninja 1.9.0
  • toolchain-esp32ulp 1.22851.190618 (2.28.51)
  • toolchain-xtensa32 2.80200.200226 (8.2.0)`

However after upgrading to the latest versions of everything it started to fail linking. I will look into what is happening and will report back here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linking error esp32-cam example.
I'm trying to compile the example esp32-cam. I added to platformio.ini the following: Code: Select all [env] lib_deps = esp32-camera.
Read more >
Compiler error for ESP32-CAM configuration - ESPHome
Hello guys, I am facing next problem while trying to compile for ESP32-CAM. I am using this quiet simple post The Eye of...
Read more >
ld returned 1 exit status *** [.pio\build\d1\firmware.elf] Error 1
Hello I am doing an application on ESP8266 Wemos d1 r1 using Platformio. When I compile, I get the following error message.
Read more >
ESP32 Troubleshooting Guide | Random Nerd Tutorials
Your ESP32 board should have a pin labeled 5V. ... But the fatal error is related to the fact that the ESP32-CAM is...
Read more >
undefined reference to `init'/[.pio\build\uno\firmware.elf] Error 1 ...
Linking .pio\build\uno\firmware.elf. C:\Users\ridho\AppData\Local\Temp\ccrKx04Q.ltrans0.ltrans.o: In function main': ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found