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

PlatformIO v4.0: Problem compiling with 2.3.0 core #6073

Closed
andreamastro opened this issue Jul 11, 2019 · 32 comments

Comments

@andreamastro
Copy link

commented Jul 11, 2019

I have this problem when i try to compile with 2.3.0 core:
Linking .pio\build\sonoff\firmware.elf
c:/users/mastro/.platformio/packages/toolchain-xtensa@1.40802.0/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\sonoff\firmware.elf sect
ion .text' will not fit in region iram1_0_seg'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\sonoff\firmware.elf] Error 1
========================= [ERROR] Took 50.17 seconds =========================

================================== [SUMMARY] ==================================
Environment sonoff-minimal [IGNORED]
Environment sonoff-basic [IGNORED]
Environment sonoff-classic [IGNORED]
Environment sonoff-knx [IGNORED]
Environment sonoff-sensors [IGNORED]
Environment sonoff-display [IGNORED]
Environment sonoff-BG [IGNORED]
Environment sonoff-BR [IGNORED]
Environment sonoff-CN [IGNORED]
Environment sonoff-CZ [IGNORED]
Environment sonoff-DE [IGNORED]
Environment sonoff-ES [IGNORED]
Environment sonoff-FR [IGNORED]
Environment sonoff-GR [IGNORED]
Environment sonoff-HE [IGNORED]
Environment sonoff-HU [IGNORED]
Environment sonoff-IT [IGNORED]
Environment sonoff-KO [IGNORED]
Environment sonoff-NL [IGNORED]
Environment sonoff-PL [IGNORED]
Environment sonoff-PT [IGNORED]
Environment sonoff-RU [IGNORED]
Environment sonoff [FAILED]
=================== 1 failed, 0 succeeded in 50.17 seconds ===================
Environment sonoff-SE [IGNORED]
Environment sonoff-SK [IGNORED]
Environment sonoff-TR [IGNORED]
Environment sonoff-TW [IGNORED]
Environment sonoff-UK [IGNORED]

How to fix it?

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

It is a strange setup error of the build environment.
I do have the same error when trying to compile with gitpod
Doing absolute the same on my local PC (with VSC / platformio) it compiles just fine!

@andreamastro

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

Tried with VSC. Same problem
Cattura

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

It does work for me with VSC
image

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

What CPU do you have? Your compile time is only 49 seconds!
My i5 needs 106 seconds

@andreamastro

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

i5 6500

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Okay, i think it is 2 times faster.... I am out of ideas what the problem could be!

@riotm0de

This comment has been minimized.

Copy link

commented Jul 11, 2019

same here, cant compile with ATOM and VSC!

i tried with Tasmota 6.6.0 and 6.5.0

i get:
/Users/xxxxxxxx/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: .pio/build/sonoff-DE/firmware.elf section .text' will not fit in region iram1_0_seg'

@gemu2015

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

had the same problem
deleting the folder .platformio fixed it

@andreamastro

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

Already tried. Doesn't work for me

@ascillato

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Hi,

In my environment latest Tasmota (as default) is compiling fine with core 2.3.0

Have you enabled something else in my_user_config.h file?

@riotm0de

This comment has been minimized.

Copy link

commented Jul 11, 2019

Have you enabled something else in my_user_config.h file?

i did nothing beside of inserting " SSID + PASS "
Still no success :(

Tried on OSX 10.13 & Win 10 with VSC & ATOM

@curzon01

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

I'd the same issue 2 weeks ago and it had nothing to do with own config or just used a fresh git clone.
The reason was the platformio install with installed libs.

I didn't dig deep into the real issue, but my previous not working platformio environment was based on several platformio update/upgrade and displayed meantime 4.x

I removed platformio completely, do again the steps written here in Wiki installed a fresh platformio. Now platformio is still v3.x even after command line update/upgrade (currently can not show real version, don't have access to my PC) and the error above is gone.

May be someone helps...

@riotm0de

This comment has been minimized.

Copy link

commented Jul 11, 2019

yesterday platformio was released with core 4
i already tried to uninstall all and did a new fresh install of current VSC and Platformio (core 4), no success :(

please help

@ascillato

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

@curzon01

That makes sense. I can compile without issue and my Platformio is v3.6.7

Gitpod uses latest PIO also. So the problem seems to rely on platformio 4.

I was reading the release notes and they change several things like workdir

https://docs.platformio.org/en/latest/migration.html

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

@curzon01 Can confirm i am on Platformio v.3.6.7 too.
Gitpod uses v.4.x

@riotm0de

This comment has been minimized.

Copy link

commented Jul 11, 2019

so is there a quick fix for me or do i need to wait for an update ? thanks

@arendst

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2019

I'm also still using 3 after my bad experience with a core 4 beta.

See docs here https://docs.platformio.org/en/latest/migration.html?utm_source=platformio&utm_medium=mail&utm_campaign=pio-core-4

I love this

PlatformIO Core 4.0 is fully backward compatible with v3.x.

where it's obviously not...

@ascillato2

This comment has been minimized.

Copy link
Collaborator

commented Jul 11, 2019

@riotm0de

so is there a quick fix for me or do i need to wait for an update ? thanks

Quick? You can compile in a different core than 2.3.0

@ascillato2 ascillato2 changed the title Problem compiling with 2.3.0 core Atom/PlatformIO Problem compiling with 2.3.0 core on PlatformIO v4.0 Jul 11, 2019

@ascillato2 ascillato2 changed the title Problem compiling with 2.3.0 core on PlatformIO v4.0 PlatformIO v4.0: Problem compiling with 2.3.0 core Jul 11, 2019

@ascillato2 ascillato2 added help needed and removed duplicated labels Jul 11, 2019

@arendst

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2019

What might work is executing the following commands from a terminal:

pip uninstall platformio
pip install platformio==3.6.7
@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

@arendst Your suggestion does work! :-)
Just did PR #6078 to get gitpod working again with core 2.3.0

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

Opened issue on PlatformIO Github platformio/platformio-core#2780

@nhorvath

This comment has been minimized.

Copy link

commented Jul 12, 2019

What might work is executing the following commands from a terminal:

pip uninstall platformio
pip install platformio==3.6.7

I made the mistake of upgrading pio this morning which resulted in the same error as the OP. This fixed my issue, but do we know why tasmota won't compile with PIO 4 (ie. is it a bug with tasmota or pio)?

@arendst

This comment has been minimized.

Copy link
Owner

commented Jul 12, 2019

it's a bug in pio. Analysis of .map files shows huge usage of Iram. I guess a toolchain issue.

@ivankravets

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

Friends, please don't panic 🙏

I'm also still using 3 after my bad experience with a core 4 beta.

@arendst, next time please report any issues to https://github.com/platformio/platformio-core/issues
Do you still have any problems with PIO Core 4.0?

I love this

PlatformIO Core 4.0 is fully backward compatible with v3.x.

where it's obviously not...

Why it's not? Please check the "Compatibility" section in the migration guide:

PlatformIO Core 4.0 is fully backward compatible with v3.x. The only major change is a new location for project build artifacts and library dependencies. The previous .pioenvs (build_dir) and .piolibdeps (libdeps_dir) folders were moved to a new workspace_dir.


Let me explain now. Espressif 8266 dev/platform uses own patched LS Scripts because existing were developed strictly for Arduino IDE build system and depend on it "tmp build object path". Later, together with Espressif Team, we adapted them to be compatible between Arduino IDE/PlatformIO. So, the latest versions of dev/platform (starting from v1.6.0) use original LD scripts from Arduino Core.

See details https://github.com/platformio/platform-espressif8266/blob/v1.5.0/ldscripts/esp8266.flash.common.ld#L3

Please note that we added a special "warning" block to this release and explained how to configure it properly for PlatformIO Core 4.0.

@ivankravets

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

I forgot to add. The current platformio.ini file looks so complicated for editing. It's actually our fault. However, in PlatforIO Core 4.0 we introduced Extra Configuration Files. Using them, we could significantly simplify this config and split whole logic into Arduino Cores. For example,

[platformio]
src_dir = sonoff

; *** Uncomment one of the lines below to build/upload only one environment
default_envs = sonoff 

extra_configs = 
   pio_core_2_3_0.ini

[env]
framework = arduino
board = xxx ; edit me


[env:sonoff]
build_flags =
  ${env.build_flags}
   -DSOME_CUSTOM_FLAGS
...

Where pio_core_2_3_0.ini can exten Global env Scope data:

[env]
platform = espressif8266@~1.5.0
framework = arduino

See also different test use cases https://github.com/platformio/platformio-core/blob/develop/tests/test_projectconf.py

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

@ivankravets Thx for the info
The warning is not easy to find. Should be added to the actual release...

@Jason2866

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

Solved with PR #6087

@arendst

This comment has been minimized.

Copy link
Owner

commented Jul 15, 2019

@ivankravets thx for your insights and sorry for my blunt workaround ;-)

As of today I am magically using core 4.0.0 (It seems it installed itself as I was still using 3.5.6 yesterday...) and it works as it should.

@ivankravets

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

thx for your insights and sorry for my blunt workaround ;-)
@arendst, everything is OK! Next time just ping me here or file a separate issue. PlatformIO Core 4.0 is very stable now and a lot of companies use it in production.

In any case, thank you so much for using PlatformIO for your project. It helps us to get better adoption in the market. Thanks again! 😊

@smilexth

This comment has been minimized.

Copy link

commented Aug 14, 2019

How to install specific version of platformio in vscode for windows ?

@ivankravets

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

@smilexth why do you need it? The latest should work for old projects too.

@ascillato

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

Latest platform.io works really good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.