Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: pio run -t nobuild -t upload #286

Open
4 tasks
Bighoneypot opened this issue Nov 25, 2022 · 3 comments
Open
4 tasks

Error: pio run -t nobuild -t upload #286

Bighoneypot opened this issue Nov 25, 2022 · 3 comments

Comments

@Bighoneypot
Copy link
Contributor

Bighoneypot commented Nov 25, 2022

What kind of issue is this?

  • PlatformIO IDE.
    [PlatformIO IDE for VSCode]

  • Development Platform or Board.
    [env:nodemcuv2]
    platform = espressif8266
    board = nodemcuv2
    framework = arduino
    upload_speed = 3000000
    monitor_speed = 115200
    board_build.f_cpu = 160000000L
    upload_protocol = esptool

  • Feature Request.
    New button to upload only sketch without rebuild project, for fast and easy use it

  • PlatformIO Core.
    6.1.5

You can erase any parts of this template not applicable to your Issue.


Configuration

**Windows 10 PRO 22H2 build 19045.2251 **:

PlatformIO Version (6.1.5):

Description of problem

In my case is impossible command pio run -t nobuild -t upload
image

Error: Could not find LD Script

@ivankravets ivankravets transferred this issue from platformio/platformio-core Nov 25, 2022
@Daiki51
Copy link

Daiki51 commented Dec 6, 2022

I am also encountering the same error.
I would like to add that the same thing happens when the host/remote is Ubuntu 22.

@mcspr
Copy link
Contributor

mcspr commented Dec 6, 2022

Also looks like platformio/platform-espressif32#861

We try to call env.GetActualLDScript() to retrieve our flash size info
https://github.com/platformio/platformio-core/blob/48655ad728c25c6af67da913c36651e27fdd05ad/platformio/builder/tools/piomisc.py#L42-L84

Which is broken in nobuild case, since there is no env.BuildProgram() and LINKFLAGS is empty. As a workaround, one could do the same thing as suggested in the esp32 issue - populate it manually with the -Wl,-T...ld entry from the currently used board .json

ldsizes = _parse_ld_sizes(env.GetActualLDScript())

ldsizes = _parse_ld_sizes(env.GetActualLDScript())

ldsizes = _parse_ld_sizes(env.GetActualLDScript())

Not really sure if nobuild is implemented correctly, though. Perhaps it should still invoke pre-requisite actions but somehow inhibit the PROGRAM .bin regeneration when scons thinks any of the targets need to be built i.e. somehow tell it that all of our dependencies for .bin are up-to-date

@Jason2866
Copy link
Contributor

This one worked in my test for pio run -t nobuild -t upload

#
# The script sets the missing "LDSCRIPT_PATH" when using the command `pio run -t nobuild`
# Adopted from https://github.com/platformio/platform-espressif32/issues/861#issuecomment-1241871437
# Possible now to upload the firmware or the filesystem with (when builded already!):
#
# `pio run -t nobuild -t upload` and `pio run -t nobuild -t uploadfs`
#

Import("env")

import os
from SCons.Script import COMMAND_LINE_TARGETS

board_config = env.BoardConfig()
framework_dir = env.PioPlatform().get_package_dir("framework-arduinoespressif8266")
assert os.path.isdir(framework_dir)

if "nobuild" in COMMAND_LINE_TARGETS:
    env.Replace(
        LDSCRIPT_PATH=os.path.join(
            framework_dir,
            "tools",
            "sdk",
            "ld",
            board_config.get("build.arduino.ldscript"),
        )
    )
#    print("Set LDSCRIPT_PATH to: ", os.path.join(framework_dir,"tools","sdk","ld",board_config.get("build.arduino.ldscript")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants