• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Build web servers W/ESP32, p.291, firmware elf error 1

Q&A Forum › Category: ESP32 › Build web servers W/ESP32, p.291, firmware elf error 1
0 Vote Up Vote Down
Larry A Toney asked 1 year ago

After making the style.css, the index.html, and the main.cpp files I clicked on the PlatformO:Build check mark.
I get the following error message and I have no idea what it means.
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32doit-devkit-v1\firmware.elf] Error 1
============================== [FAILED] Took 15.54 seconds ===
I Need help.

I have gone back to the beginning of the course and I tried to platformIO build on the blink sketch.  I get this same error.

do I need to remove VS and start over. Seems pretty desperate. I have python 3.11 loaded

when I open VS I no longer get the first screen shown in the book. Is there a way to get back to that screen and maybe start over from there?

I managed to get back to the beginning of the course and used all course provided code for each step. Every step worked according to the course  program. That includes the “Hello World” example.

When I got back to chapter 2.1 = Web Server – Control Outputs, I used all example files from the course. The only modification I made was to the ssid and password. When I tried to check the program I got the above error again and now the “Hello World” example no longer works but also gives the above error code

 

Question Tags: ESP32 Web Server course., firmware.elf Error 1
9 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
That must be just the last part of the error: collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32doit-devkit-v1\firmware.elf] Error 1

Can you scroll up on the terminal window and share the rest of the error?.

Alternatively, you may want to send a printscreen. To share a picture, upload a photo to google drive or dropbox and then share a link to the file.

Regards,
Sara

0 Vote Up Vote Down
Larry A Toney answered 1 year ago

Executing task in folder 1_1_Hello_World: C:\Users\laton\.platformio\penv\Scripts\platformio.exe run
Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
————————————————————————————————–Verbose mode can be enabled via `-v, –verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (6.5.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
– framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
– tool-esptoolpy @ 1.40501.0 (4.5.1)
– toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies…
Dependency Graph
|– ESP Async WebServer @ 1.2.3
|– SPIFFS @ 2.0.0
|– AsyncTCP @ 1.1.1
|– WiFi @ 2.0.0
Building in release mode
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
c:/users/laton/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\libd0d\libESP Async WebServer.a(WebAuthentication.cpp.o):(.literal._ZL6getMD5PhtPc+0x4): undefined reference to `mbedtls_md5_starts’
c:/users/laton/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\libd0d\libESP Async WebServer.a(WebAuthentication.cpp.o): in function `getMD5(unsigned char*, unsigned short, char*)’:
C:\Users\laton\OneDrive\Documents\PlatformIO\Projects\1_1_Hello_World/.pio/libdeps/esp32doit-devkit-v1/ESP Async WebServer/src/WebAuthentication.cpp:73: undefined reference to `mbedtls_md5_starts’collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32doit-devkit-v1\firmware.elf] Error 1
================================== [FAILED] Took 19.79 seconds ==================================
* The terminal process “C:\Users\laton\.platformio\penv\Scripts\platformio.exe ‘run'” terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

0 Vote Up Vote Down
Larry A Toney answered 1 year ago

I’m not sure how to save a screen shot but I’ll try to get that too. Ctrl V doesn’t seem to paste screenshots from the clipboard.

 

0 Vote Up Vote Down
Larry A Toney answered 1 year ago

here is a link to the VS desktop picture showing my setup

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
What ebook
version do you have?
On the latest version (2.2), page 188 addresses that issue.
I suggest following option 2 or option 3 to fix the issue.
 
If you don’t have the latest eBook version, you can download it here: https://rntlab.com/module-1/welcome-build-web-servers/
 
Let me know if this fixes the issue.
Regards,
Sara

0 Vote Up Vote Down
Larry A Toney answered 1 year ago

I don’t know my version but it must be the latest because I just bought the course and have been working on it about two weeks.  Somehow I didn’t see several pages right around there. Thanks for the help. I will go back a ways and start this exercise over. 

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Ok. Great.
Then, let me know if you were able to solve the issue.
Regards,
Sara

0 Vote Up Vote Down
Larry A Toney answered 1 year ago

I’m working on  2.3 – WebSocket Web Server chapter. The error came back as usual when I compiled the project for the first time. I mouse over the yellow error message and Ctrl-Click to bring up the WebAuthentication.cpp file and edit the 3 lines of code and then Ctrl-S the changes to save them. Then I went back and recompile as in all previous examples.  This time I get error again but it appears to be on a different file. See attached pictures.
I have tried deleting the folder twice and starting completely from scratch using the course provided data files without modifications and the main.cpp file with my credentials but I continue to get this error.
When I go back to earlier lessons I can compile them and they work as designed.
Notice that yellow file above the error message is a different file.
https://www.dropbox.com/scl/fi/bngnz9gwtxftgpcqe7ub6/IMG_6552.HEIC?rlkey=nlnx3n4des23cs1p4fbxz54x1&dl=0
When I try to do the Ctrl-Click on the file I get this file and error message.
https://www.dropbox.com/scl/fi/njkx8fniyumyja4yy55dj/IMG_6553.HEIC?rlkey=ne1p3ix2vnydh02xwez10hz5n&dl=0
 
 

 

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
Try to change the platformio.ini file.
Use
platform = espressif32@3.5.0
Instead of 
platform = espressif32
 
Let me know if this solves the issue.
 
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.