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

String functions in IRAM causing `.text' will not fit in region `iram1_0_seg #2794

Closed
hreintke opened this Issue Dec 25, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@hreintke
Contributor

hreintke commented Dec 25, 2016

Basic Infos

Hardware

Hardware: Wemos d1 mini
Core Version: git master

Description

I added the code below to my application and that causes a ".text' will not fit in regioniram1_0_seg'" error.
Increased the size in the ld to force an elf file to be created.
Analysing this with objdump -x output shows that f.e.

_ZNKSs13find_first_ofEPKcjj and
_ZNKSs17find_first_not_ofERKSsj

are added to IRAM1
Seems standard functions from std:string is that correct ?

Is there a way to force these functions to flash ?

Also see that some std:map functions are in IRAM, same question for that.

Settings in IDE

Module: Wmos
Flash Size: 4MB/1MB
Upload Using: SERIAL

Sketch

std::vector<std::string> split(const std::string& text, const std::string& delims)
{
    std::vector<std::string> tokens;
    std::size_t start = text.find_first_not_of(delims), end = 0;

    while((end = text.find_first_of(delims, start)) != std::string::npos)
    {
        tokens.push_back(text.substr(start, end - start));
        start = text.find_first_not_of(delims, end);
    }
    if(start != std::string::npos)
        tokens.push_back(text.substr(start));

    return tokens;
}
@igrr

This comment has been minimized.

Show comment
Hide comment
@igrr

igrr Dec 25, 2016

Member

Yes, you can force all non-inlined STL functions into IROM if you add something like

    *libstdc++.a:(.literal .text .literal.* .text.*)

to the .irom0.text section in the linker script (tools/sdk/ld/eagle.app.v6.common.ld).

Member

igrr commented Dec 25, 2016

Yes, you can force all non-inlined STL functions into IROM if you add something like

    *libstdc++.a:(.literal .text .literal.* .text.*)

to the .irom0.text section in the linker script (tools/sdk/ld/eagle.app.v6.common.ld).

@hreintke

This comment has been minimized.

Show comment
Hide comment
@hreintke

hreintke Dec 25, 2016

Contributor

@igrr
Thanks, first tests show that it works as expected.

Do you want me to make a PR for that to include in Arduino library if it also works after more testing ?

Contributor

hreintke commented Dec 25, 2016

@igrr
Thanks, first tests show that it works as expected.

Do you want me to make a PR for that to include in Arduino library if it also works after more testing ?

@hreintke

This comment has been minimized.

Show comment
Hide comment
@hreintke

hreintke Dec 28, 2016

Contributor

Submitted #2804

Contributor

hreintke commented Dec 28, 2016

Submitted #2804

@hreintke hreintke closed this Dec 28, 2016

@bhaap

This comment has been minimized.

Show comment
Hide comment
@bhaap

bhaap Dec 31, 2016

Thank you for this, this made me able to build this:
https://github.com/ge0rg/WiFI-RGBWW-module
when i added libpwm.a to the ld file :D

bhaap commented Dec 31, 2016

Thank you for this, this made me able to build this:
https://github.com/ge0rg/WiFI-RGBWW-module
when i added libpwm.a to the ld file :D

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