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

Feature Request: Arduino bugfix v.2.5.1 is released #147

Closed
Jason2866 opened this issue May 11, 2019 · 23 comments
Closed

Feature Request: Arduino bugfix v.2.5.1 is released #147

Jason2866 opened this issue May 11, 2019 · 23 comments
Assignees

Comments

@Jason2866
Copy link
Contributor

Since v.2.5.1 is released could you please update to this version?
Thx!

@ivankravets
Copy link
Member

@valeros could you investigate why does not work the latest source code v2.5.1 of Arduino core? it builds OK but does not work after flashing.

@d-a-v, @earlephilhower do we have critical changes in 2.5.1 build process? Do we need to upgrade to the latest ESP8266 toolchain and switch off from esptool-ck to esptool-py? Thanks!

@earlephilhower
Copy link
Contributor

@ivankravets There was a linking change (.text into .text and .text1 segment to allow moving some specific functions to IRAM as needed for IRQ callbacks) but I think we already got you in the loop on it.

esp8266/Arduino#5922

@Jason2866
Copy link
Contributor Author

Jason2866 commented May 13, 2019

@ivankravets @valeros
I get a working build with old and new xtensa build chain. No problem with arduino core.
You can take a look here:
platform = https://github.com/Jason2866/platform-espressif8266.git#Stage-Tasmota
for new extensa build chain platformio.py has to be adapted (linked files has to be reordered)
https://github.com/Jason2866/TDM/blob/master/platformio.py
and old Xtensa build chain
platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota

Core 2.5.1 is used in Project Tasmota with Platformio. You can try online:
Tasmota via gitpod

@mcspr
Copy link
Contributor

mcspr commented May 13, 2019

Just to make clear what "linked files has to be reordered" means, see
Core 2.5.0 / platform 2.0.0 issue: #128 (comment) (and further comments)
workaround for that: mcspr/platformio-core@708eff2

@ivankravets
Copy link
Member

@mcspr why do you need this hook mcspr/platformio-core@708eff2 ?

@Jason2866
Copy link
Contributor Author

Jason2866 commented May 13, 2019

Without this hook, code doesnt boot when builded with new xtensa build chain.
@mcspr thx for you fix, searched the orig. issue and didnt found

@mcspr
Copy link
Contributor

mcspr commented May 13, 2019

Yes, like @Jason2866 said - updated toolchain seemingly treats -Wl,-T and just -T differently.
esp8266/Arduino never encountered that, because platform.txt / arduino-builder only uses -T{user_selected_ldscript}

@ivankravets
Copy link
Member

@Jason2866 @mcspr this is a bug with ESP8266 toolchain. Please file an issue here https://github.com/earlephilhower/esp-quick-toolchain and I'm sure @earlephilhower will take a look.

See GCC docs https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

-Wl,option
Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas. You can use this syntax to pass an argument to the option. For example, -Wl,-Map,output.map passes -Map output.map to the linker. When using the GNU linker, you can also get the same effect with -Wl,-Map=output.map.

PlatformIO Core is used for over 30 dev/platform which depend on the different toolchains. It would be great if we can keep PlatformIO Core compatible with GCC CLI.

@earlephilhower
Copy link
Contributor

earlephilhower commented May 13, 2019

Guys, the toolchain got bumped in 2.5.0 and was not touched significantly for 2.5.1 AFAIR. Was 2.5.0 working?

If so, then I really think it's something else because we're building the unadulterated GNU sources for the vast majority of things (minor patches, unrelated to the linker).

Just checked, the last time the toolchain was released was Dec 14 2018. Ardui9no 8266 2.5.0 came out in Feb 2019.

@Jason2866
Copy link
Contributor Author

@earlephilhower the toolchain from 2.5.0 is working fine for 2.5.1 with this change from @mcspr

@ivankravets
Copy link
Member

@earlephilhower the bug was introduced in this release https://github.com/earlephilhower/esp-quick-toolchain/releases/tag/2.5.0-3

We use a toolchain that was before "2.5.0-3". The latest "2.5.0-3" breaks ESP8266 SDKs which we support in PlatformIO.

@earlephilhower
Copy link
Contributor

@ivankravets what is the exact version you have been using? Again, we are building the plain GCC code here so there's not much I expect to be able to track down. Patches are kept in a separate dir in the repo, and none relate to the g++/ld options parsing...

@Jason2866
Copy link
Contributor Author

@ivankravets anyway, with the old build chain (which is standard for Arduino ESP8266) the code compiles fine and does work.
platform = https://github.com/Jason2866/platform-espressif8266.git#Tasmota

@earlephilhower
Copy link
Contributor

Also, does PIO use its own bootloader on-chip? Like I said, there is another segment in the generated binary now (iram.text1) which needs to be supported. The Arduino bootloader handles it seemlessly (w/o any changes), but if you've got a custom one it needs to be aware of this and support it.

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue May 13, 2019
PIO uses GCC in a way that causes the compiler to optimize away the IRQ
vectors (since they're not used in our code itself) in the final build
stage.

We can avoid this by forcing all of libmain to be included in the final
object.  This is a small file, and almost completely related to IRQs, so
space impact is minimal.

Fixes esp8266#6087 and
platformio/platform-espressif8266#147
@octavio2895
Copy link

Just to add my few cents. I'm having some issues with OTA updates using the stable release. It appears that espota thinks its done sending the sketch before the fact and I get an Error[4]: End Failed on the serial output. The sketch gets to about 89% done uploading before it fails. I tried using the 2.5.0 release of the core in the arduino IDE and it works great, so I don't think the core is the problem. After changing the platform using #147 (comment) the uploads completes most of the times. However, when I switched to an AP with a stronger signal, the fail rate drops with stable and with #147 (comment) .

Does OTA update work differently in platformio from arduino ide?

I wasn't sure if I should open a new issue, so apologies if I should have.

@ivankravets
Copy link
Member

@octavio2895 I've just switch espota to official script from Arduino core. Please re-test with upstream version http://docs.platformio.org/en/latest/platforms/espressif8266.html#upstream

@ivankravets
Copy link
Member

@earlephilhower @Jason2866 @mcspr

I've just switch ElfToBin builder and upload process to esptool.py:

It works for me now. Please re-test with upstream version of dev/platform http://docs.platformio.org/en/latest/platforms/espressif8266.html#upstream

if it works for you too, we will make a final release.

Thanks!

@earlephilhower
Copy link
Contributor

That commit uses the new elf2bin.py script which knows about the add'l .text1 section. If that really works, then the -Wl was a red herring and we can ignore it in the core.

@octavio2895
Copy link

@ivankravets that fixed the issue! where can I find the version of espota.py that was being used before? I would like to take a look at it.

Also, should I make an issue for this? since its not fixed on the stable release to help people with similar problems?

@mcspr
Copy link
Contributor

mcspr commented May 14, 2019

Can confirm that elf2bin change is working with platform from develop branch.

platform.json:["packages"]["toolchain-xtensa"]["version"] is still pointing to the ~1.40802.0, so toolchain problem obviously is not there.
Original issue is still reproducible with the ~2.40802.0 (toolchain package version comes from platfromio's package repo. it is the same as from esp-quick-toolchain 2.5.0-3 release, same build-id shas and everything)

@Jason2866
Copy link
Contributor Author

Can confirm develop is working. Feature request with this issue is done. Thx.

Issue with toolchain ~2.4 is still there (when used) as @mcspr mentioned.

The develop version uses ~1.4 build chain:

PlatformManager: Installing platform-espressif8266
git version 2.19.1.windows.1
Cloning into 'C:\Users\Hans\.platformio\platforms\_tmp_installing-jnoeh3-package'...
remote: Enumerating objects: 95, done.
remote: Counting objects: 100% (95/95), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 95 (delta 50), reused 34 (delta 10), pack-reused 0
Unpacking objects: 100% (95/95), done.
espressif8266 @ e7d8b22 has been successfully installed!
The platform 'https://github.com/platformio/platform-espressif8266.git#develop' has been successfully installed!
The rest of packages will be installed automatically depending on your build environment.
PackageManager: Installing toolchain-xtensa @ ~1.40802.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
PackageManager: Installing tool-esptool @ <2
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
PackageManager: Installing tool-esptoolpy @ ~1.20600.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
PackageManager: Installing framework-arduinoespressif8266 @ ~2.20501.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100% 

@ivankravets
Copy link
Member

Please update to the stable version of dev/platform https://github.com/platformio/platform-espressif8266/releases/tag/v2.1.0

@Jason2866
Copy link
Contributor Author

Release does install and compile results in a working firmware of tried project Tasmota

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

No branches or pull requests

6 participants