This is an esp32 wroom project I have compiled numerous time successfully in VS PlatformIO. But now I can’t build. I was always getting some warning messages but nothing as an error about:
JSON:
class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
SPI:
#warning "INFO: ARDUINO SPI interface selected."
However now when Linking the firmware I get the following error:
The log file gets pretty big, 3124576 characters, pastebin allows me to paste 512kb per paste. Would you like to paste just the errors or break it in parts? Sorry for the inconvenience.
I have included the start and finish of each environment, I hope this can help https://pastebin.com/CXU3RFM2
Should these messages just before ld returned 1 exit status direct us to think that there is something wrong with path or platformio installation setup? There are some warning messages about SPI as I said earlier
#warning "INFO: ARDUINO SPI interface selected."
and I have relocated the project directory to /home/Projects/ , I did all the Misc. check and verbose builds and the error persists.
I have found the problem!! It was hidden in plain sight !! In platformio.ini (see above) there are the lines that describe the build flags. The correct syntax is without spaces in between!! Like so:
build_flags =
-DDEBUG_MODE=1
-DVERSION=1
The linking somehow was messed up when spaces were present.
Linking .pio/build/esp32doit-devkit-v1/firmware.elf
Retrieving maximum program size .pio/build/esp32doit-devkit-v1/firmware.elf
Checking size .pio/build/esp32doit-devkit-v1/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [== ] 15.1% (used 49424 bytes from 327680 bytes)
Flash: [=== ] 29.6% (used 987933 bytes from 3342336 bytes)
Building .pio/build/esp32doit-devkit-v1/firmware.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 27 ELF sections
Successfully created esp32 image.
==================================================================== [SUCCESS] Took 48.02 seconds ====================================================================