8000 Board UM_TINYPICO compile iram overflow error by stephanelsmith · Pull Request #8525 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Board UM_TINYPICO compile iram overflow error #8525

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 1 commit into from

Conversation

stephanelsmith
Copy link
Contributor

@UnexpectedMaker, working with tinypico firmwares, master micropython with esp-idf v4.4 is failing build for board UM_TINYPICO with error:

//.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: micropython.elf section `.iram0.text' will not fit in region `iram0_0_seg'
//.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: IRAM0 segment data does not fit.
//.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: region `iram0_0_seg' overflowed by 552 bytes

I believe it's related to this issue:
#8260

Adding the following line in boards/UM_TINYPICO/sdkconfig.board resolves issue
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
Which I believe translates to compiler option '-Os' to reduce size.

8000

@dpgeorge
Copy link
Member

This will probably reduce performance on this board. An alternative is to disable some of the IRAM wrappers like MICROPY_WRAP_MP_BINARY_OP. But that will also reduce performance.

Might need to make a comparison of how those changes affect performance and go with the faster one.

My feeling is that using -Os (what is done in this PR) is the better option, because it reduces code size overall, and still leaves those hot functions in IRAM (which is where most of the perf gain comes from).

Might also be worth understanding why this board overflows on IDF 4.4 and GENERIC does not.

@dpgeorge
Copy link
Member

Might also be worth understanding why this board overflows on IDF 4.4 and GENERIC does not.

It's because UM_TINYPICO enables SPIRAM. The GENERIC_SPIRAM board also overflows IRAM using IDF 4.4. (SPIRAM builds are larger because of a hardware bug that is avoided by the compiler inserting extra instructions.)

So... I think the change in this PR is the right way to go, and should also be applied to GENERIC_SPIRAM.

TINYPICO firmware build failing with error: Micropython.elf
section .iram0.text will not fit in region iram0_0_seg.
Changing compiler option to -Os
(CONFIG_COMPILER_OPTIMIZATION_SIZE=y) succesfully builds.
@dpgeorge
Copy link
Member

Merged in ae3d528, thank you!

@dpgeorge dpgeorge closed this Apr 14, 2022
@stephanelsmith stephanelsmith deleted the umtinypico2 branch May 3, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4A83
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0