PlatformIO Community

Missing LD Script error (Could not find LD script)

Hi all

I want to send the Blink example to my remote WeMos D1 mini

My platformio.ini is

; PlatformIO Project Configuration File

;

;   Build options: build flags, source filter, extra scripting

;   Upload options: custom port, speed and extra flags

;   Library options: dependencies, extra library storages

;

; Please visit documentation for the other options and examples

; http://docs.platformio.org/page/projectconf.html

[env:d1_mini]

platform = espressif8266

framework = arduino

board = d1_mini

board_build.filesystem = littlefs

; Custom linker script

board_build.ldscript = eagle.flash.1m256.ld

upload_port = /dev/ttyUSB0

upload_speed = 115200

;upload_protocol = esptool

Executing task in folder 201124-205351-arduino-blink: C:\Users\xxxx.platformio\penv\Scripts\pio.exe run --environment d1_mini <

Processing d1_mini (platform: espressif8266; framework: arduino; board: d1_mini)
---------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 (2.6.2) > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.20704.0 (2.7.4)
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.20800.0 (2.8.0)
 - toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\d1_mini\src\main.cpp.o
Generating LD script .pio\build\d1_mini\ld\local.eagle.app.v6.common.ld
Archiving .pio\build\d1_mini\libFrameworkArduinoVariant.a
Compiling .pio\build\d1_mini\FrameworkArduino\Crypto.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Esp-frag.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Esp-version.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\FS.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\FSnoop.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Print.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Schedule.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\StackThunk.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\TypeConversion.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\Updater.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\WString.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\abi.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\base64.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\cont.S.o
Compiling .pio\build\d1_mini\FrameworkArduino\cont_util.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_app_entry_noextra4k.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_eboot_command.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_features.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_flash_quirks.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_flash_utils.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_i2s.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_main.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_noniso.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_phy.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_postmortem.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_si2c.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_sigma_delta.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_spi_utils.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_timer.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_waveform.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_wiring.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_wiring_analog.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_wiring_digital.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_wiring_pulse.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_wiring_pwm.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\core_esp8266_wiring_shift.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\crc32.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\debug.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\flash_hal.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\gdb_hooks.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\heap.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\libb64\cdecode.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\libb64\cencode.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\libc_replacements.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\sntp-lwip2.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\spiffs\spiffs_cache.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\spiffs\spiffs_check.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\spiffs\spiffs_gc.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\spiffs\spiffs_hydrogen.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\spiffs\spiffs_nucleus.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\spiffs_api.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\sqrt32.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\time.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\uart.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\umm_malloc\umm_info.c.o
Compiling .pio\build\d1_mini\FrameworkArduino\umm_malloc\umm_integrity.c.o
Compiling .pio\build\d1_mini\FrameworkArduino\umm_malloc\umm_local.c.o
Compiling .pio\build\d1_mini\FrameworkArduino\umm_malloc\umm_malloc.cpp.o
Compiling .pio\build\d1_mini\FrameworkArduino\umm_malloc\umm_poison.c.o
Archiving .pio\build\d1_mini\libFrameworkArduino.a
Linking .pio\build\d1_mini\firmware.elf
Building .pio\build\d1_mini\firmware.bin
Retrieving maximum program size .pio\build\d1_mini\firmware.elf
Checking size .pio\build\d1_mini\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  32.9% (used 26916 bytes from 81920 bytes)
Flash: [===       ]  34.4% (used 262140 bytes from 761840 bytes)
Creating BIN file ".pio\build\d1_mini\firmware.bin" using "C:\Users\vw603\.platformio\packages\framework-arduinoespressif8266\bootloaders\eboot\eboot.elf" and ".pio\build\d1_mini\firmware.elf"
================================================= [SUCCESS] Took 165.30 seconds =================================================

Terminal will be reused by tasks, press any key to close it.

If i after run an remote upload I got

> Executing task in folder 201124-205351-arduino-blink: C:\Users\vw603\.platformio\penv\Scripts\pio.exe remote run --target upload --environment d1_mini <

Building project locally
Processing d1_mini (platform: espressif8266; framework: arduino; board: d1_mini)
---------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 (2.6.2) > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.20704.0 (2.7.4)
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.20800.0 (2.8.0)
 - toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\d1_mini\firmware.elf
Checking size .pio\build\d1_mini\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  32.9% (used 26916 bytes from 81920 bytes)
Flash: [===       ]  34.4% (used 262140 bytes from 761840 bytes)
================================================= [SUCCESS] Took 16.50 seconds =================================================
Uploading firmware remotely
Processing ?[36m?[1md1_mini?[0m (platform: espressif8266; framework: arduino; board: d1_mini)
?[1m--------------------------------------------------------------------------------?[0m
Tool Manager: Installing ?[36mtool-esptoolpy @ ~1.20800.0?[0m?[0m
Unpacking...
Tool Manager: ?[32mtool-esptoolpy @ 1.20800.0 has been installed!?[0m
Verbose mode can be enabled via `-v, --verbose` option
?[0m?[31mError: Could not find LD script
?[0m========================== [?[31m?[1mFAILED?[0m] Took 3.35 seconds ==========================?[0m
The terminal process "C:\Users\vw603\.platformio\penv\Scripts\pio.exe 'remote', 'run', '--target', 'upload', '--environment', 'd1_mini'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

If i run an upgrade, i got:

You're up-to-date!
PlatformIO 5.0.4b1 is currently the newest version available.

While if i run update I got:

Updating platformio/contrib-piohome           3.3.1 @ ~3.3.1                     [Up-to-date]
Updating platformio/contrib-pysite            2.37.191020 @ ~2.37.0              [Incompatible 2.39.201019]
Updating platformio/tool-unity                1.20500.200612 @ ~1.20500.0        [Up-to-date]
Updating platformio/tool-scons                4.40001.0 @ ~4.40001.0             [Up-to-date]

Platform Manager
================
Platform espressif32
--------
Updating platformio/espressif32               2.1.0                              [Up-to-date]
Updating platformio/toolchain-xtensa32        2.50200.80 @ ~2.50200.0            [Up-to-date]
Updating platformio/framework-arduinoespressif32 3.10004.201016 @ ~3.10004.191002   [Up-to-date]
Updating platformio/tool-openocd-esp32        2.1000.20201202 @ ~2.1000.0        [Up-to-date]

Platform espressif8266
--------
Updating platformio/espressif8266             2.6.2                              [Up-to-date]
Updating platformio/toolchain-xtensa          2.40802.200502 @ ~2.40802.191122   [Up-to-date]
Updating platformio/framework-arduinoespressif8266 3.20704.0 @ ~3.20704.0             [Up-to-date]
Updating platformio/tool-esptool              1.413.0 @ <2                       [Up-to-date]
Updating platformio/tool-esptoolpy            1.20800.0 @ ~1.20800.0             [Up-to-date]
Updating platformio/tool-mkspiffs             1.200.0 @ ~1.200.0                 [Up-to-date]
Updating platformio/tool-mklittlefs           1.203.200522 @ ~1.203.0            [Up-to-date]


Library Manager
===============
Library Storage: C:\Users\vw603\.platformio\lib
Updating AsyncMqttClient                      0.8.2                              [Up-to-date]
Updating AsyncTCP                             1.1.1                              [Up-to-date]
Updating me-no-dev/ESPAsyncTCP                1.2.2                              [Up-to-date]

According to commit https://github.com/platformio/platform-espressif8266/commit/e69a2cb6d1f38f72ff7bff9d87707689b4fef739 this should have been a fixed issue.

Originally tracked in https://github.com/platformio/platform-espressif8266/issues/165 and related to https://github.com/platformio/platform-espressif8266/issues/228.

Maybe @ivankravets can have a look at this?

1 Like

Maybe my lack in my knowledge, I update ‘main.py’ with change reported on the commit above, but nothing change. Still error message.

I modified file \.platformio\platforms\espressif8266\builder\main.py according to commit on github.
Then I remove the platform by

PS C:\Users\xxx\Documents\PlatformIO\Projects\201124-205351-arduino-blink> pio platform uninstall espressif8266
Platform Manager: Removing espressif8266 @ 2.6.2
Platform Manager: espressif8266 @ 2.6.2 has been removed!
The platform 'espressif8266' has been successfully removed!

Then I run

PS C:\Users\xxx\Documents\PlatformIO\Projects\201124-205351-arduino-blink> pio platform install C:\Users\vw603\.platformio\platforms\espressif8266
Platform Manager: espressif8266 @ 2.6.2 is already installed
Tool Manager: toolchain-xtensa @ 2.40802.200502 is already installed
Tool Manager: tool-esptool @ 1.413.0 is already installed
Tool Manager: tool-esptoolpy @ 1.20800.0 is already installed
The platform 'C:\Users\vw603\.platformio\platforms\espressif8266' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

If i run a Remote Upload, I retreive the same result:

Executing task in folder 201124-205351-arduino-blink: C:\Users\xxx\.platformio\penv\Scripts\pio.exe remote run --target upload --environment d1_mini <

Building project locally
Processing d1_mini (platform: espressif8266; framework: arduino; board: d1_mini)
---------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 (2.6.2) > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.20704.0 (2.7.4)
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.20800.0 (2.8.0)
 - toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\d1_mini\firmware.elf
Checking size .pio\build\d1_mini\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  32.9% (used 26916 bytes from 81920 bytes)
Flash: [===       ]  34.4% (used 262140 bytes from 761840 bytes)
================================================= [SUCCESS] Took 14.97 seconds =================================================
Uploading firmware remotely
Processing ?[36m?[1md1_mini?[0m (platform: espressif8266; framework: arduino; board: d1_mini)
?[1m--------------------------------------------------------------------------------?[0m
Verbose mode can be enabled via `-v, --verbose` option
?[0m?[31mError: Could not find LD script
?[0m========================== [?[31m?[1mFAILED?[0m] Took 1.72 seconds ==========================?[0m
The terminal process "C:\Users\vw603\.platformio\penv\Scripts\pio.exe 'remote', 'run', '--target', 'upload', '--environment', 'd1_mini'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

.
What I failed?

The commit is over 1 year old and already included in the most recent version, so one shouldn’t apply it by itself. For now I see two options:

  • wait until the bug is being investigated by developers
  • try using --force-remote as a flag in pio remote run as a workaround as described in the issues

Ok, I’m waiting for the fix.

Two questions :

  1. Does it is possible to set '--force-remote inside platformio.ini file?
  2. If I want to understand better the code to solve (help?) this issue, where I have to start?

Not to my knowledge and the documentation. However, you can add a little bit of code in the project so that you have that option in the “project tasks” window pane. Adapt from docs to create a pio remote run --force-remote shortcut.

I’m not sure about this myself, but the platform code is at https://github.com/platformio/platform-espressif8266 and the main PlatformIO core is at https://github.com/platformio/platformio-core/. The underlying build system is SCons. This is fairly complex though when being first introduced to it.