Skip to content

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

Closed
@hreintke

Description

@hreintke

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 region iram1_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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions