Skip to content

Need to add .text1 segment to generated binary #143

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
earlephilhower opened this issue Apr 11, 2019 · 2 comments · Fixed by #144
Closed

Need to add .text1 segment to generated binary #143

earlephilhower opened this issue Apr 11, 2019 · 2 comments · Fixed by #144

Comments

@earlephilhower
Copy link
Contributor

The linker in the 8266 Arduino code needed to split the .TEXT segment into two separate segments to support moving some std::function methods into IRAM (as they are used in IRQ callbacks for certain interfaces). See esp8266/Arduino#5922

There are now ".text" and ".text1" segments which comprise the program flash area. Our ELF2BIN.PY script has been updated to support this transparently, but it looks like PIO uses its own method of generating BIN files. Without the .text1 segment in the BIN image, the app obviously won't run and you'll get a boot loop. See esp8266/Arduino#5974

My quick scan makes me think the following two spots need to have .text1 added after .text to generate a proper image.

"-bs", ".text",

"-bs", ".text",

Thx
-EFP3

@Jason2866
Copy link
Contributor

Jason2866 commented Apr 11, 2019

With this changes, Tasmota builds are working again.
See esp8266/Arduino#5974 (comment)
Thx EFP3!

@earlephilhower
Copy link
Contributor Author

Also need to add .text1 to the size computation, or it won't capture the full program usage in output:

SIZEPROGREGEXP=r"^(?:\.irom0\.text|\.text|\.data|\.rodata|)\s+([0-9]+).*",

earlephilhower added a commit to earlephilhower/platform-espressif8266 that referenced this issue Apr 12, 2019
The Arduino 8266 code recently split .text into .text and .text1 to
enable placing certain functions in IRAM automatically (required for
callbacks in IRQs).

Update the binary creation and size calculation to account for this.

Without this change, infinite boot loops will occur because the main
code will never be uploaded to the chip.

Fixes platformio#143
earlephilhower added a commit to earlephilhower/platform-espressif8266 that referenced this issue Apr 12, 2019
The Arduino 8266 code recently split .text into .text and .text1 to
enable placing certain functions in IRAM automatically (required for
callbacks in IRQs).

Update the binary creation and size calculation to account for this.

Without this change, infinite boot loops will occur because the main
code will never be uploaded to the chip.

Fixes platformio#143
ivankravets pushed a commit that referenced this issue Apr 14, 2019
The Arduino 8266 code recently split .text into .text and .text1 to
enable placing certain functions in IRAM automatically (required for
callbacks in IRQs).

Update the binary creation and size calculation to account for this.

Without this change, infinite boot loops will occur because the main
code will never be uploaded to the chip.

Fixes #143
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 a pull request may close this issue.

2 participants