Closed vrabcak closed 5 years ago
I'm seeing the same error when specifying pio run -e env -t nobuild -t upload
After some tracing, I noticed that the error message comes from platformio-core: https://github.com/platformio/platformio-core/blob/5e73348263ef10458a950a0022dabaec803f46a6/platformio/builder/tools/piomisc.py#L235-L277
But LINKFLAGS
is missing. Only place that I've noticed it may come from is target elf generation, but it will only trigger on building:
https://github.com/platformio/platformio-core/blob/5e73348263ef10458a950a0022dabaec803f46a6/platformio/builder/tools/platformio.py#L109
https://github.com/platformio/platform-espressif8266/blob/fa48bca577365b9cf1870fe3a443b02419874ff2/builder/main.py#L204-L205
Adding the env.ProcessFlags(env.get("BUILD_FLAGS"))
fixes the LD script detection.
edit: ...and also this part of BuildProgram, if build_flags is empty / without -Wl,-T ...:
https://github.com/platformio/platformio-core/blob/5e73348263ef10458a950a0022dabaec803f46a6/platformio/builder/tools/platformio.py#L127-L129
if (env.get("LDSCRIPT_PATH")
and not any("-Wl,-T" in f for f in env['LINKFLAGS'])):
env.Prepend(LINKFLAGS=["-T", "$LDSCRIPT_PATH"])
But it looks like that the platformio-core must always parse build flags and not the platform code?
Same problem using espressif8266@2.2.2 with platformio 3.6.7. However, quick workaround suggested here https://community.platformio.org/t/esp8266-error-on-remote-uploading/4618 works. Adding --force-remote solves the problem by building on the remote agent.
The workaround is not working for me with pio v4.0.0.
For me, the workaround leads to
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini_pro/libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x4): undefined reference to `setup'
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini_pro/libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x8): undefined reference to `loop'
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini_pro/libFrameworkArduino.a(core_esp8266_main.cpp.o): in function `loop_wrapper()':
core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x21): undefined reference to `setup'
/home/lakidd/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x2d): undefined reference to `loop'
collect2: error: ld returned 1 exit status
*** [.pio/build/d1_mini_pro/firmware.elf] Error 1
[EDIT] Ok the above seems to be caused by --force-remote putting the *.cpp file into /include on the remote system, not /src . When I manually move it there and build locally on the remote RPi, it works.
for me is not an option to use --force-remote, I need to build on CI server. Also, downgrading platform to 2.2.1 worked, so the problem seems to have been introduced int the latest espressif8266@2.2.2 release
Please re-run pio remote update
or pio update
on the remote device. Fixed in https://github.com/platformio/platform-espressif8266/releases/tag/v2.2.3
Yep, that fixed it ! Thanks
fixed, thanks
I have following setup: Platformio installed on Raspberry Pi and gen4iod board connected to the Raspberry via USB. I run remote agent on the Raspberry.
When I try to upload firmware remotely from my PC, it ends with the error:
When I compile exactly the same project locally on the Raspberry and upload it locally (with
pio run --target upload
), it uploads the firmware to the board without any problems.I'm using PlatformIO, version 4.0.0 and espressif8266 @ 2.2.2