Skip to content

Fix PIO toolchain by ensuring IRQ vectors in link #6088

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

Closed
wants to merge 2 commits into from

Conversation

earlephilhower
Copy link
Collaborator

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 #6087 and
platformio/platform-espressif8266#147

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
@mcspr
Copy link
Collaborator

mcspr commented May 13, 2019

Sorry, was AFK. Thank you for testing that.

Note that platformio does not use platform.txt to build, but using SCons that runs platformio-build.py script.

Some quick research at https://stackoverflow.com/questions/22122498/how-do-i-add-whole-archive-linker-option-in-scons advices on modifying LINKFLAGS variable and excluding it from LIBS

"hal", "phy", "pp", "net80211", "wpa", "crypto", "main",

Since PIO doesn't use platform.txt, shoehorn the same change as in
platform.txt to the PIO build script.
@earlephilhower
Copy link
Collaborator Author

Actually, since I can't test this I'm going to close it. If someone using PIO can give it a go, please open a new PR w/the needed changes.

@earlephilhower
Copy link
Collaborator Author

Also just discovered that the PIO linking way loses other bits of IRAM so this wasn't a complete fix.

@earlephilhower earlephilhower deleted the fix-pio-no-irqs branch November 18, 2020 00:16
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

Successfully merging this pull request may close these issues.

IRQ vectors not being set in PIO toolchain, causing bootloop w/2.5.x releases
2 participants