I know that the iram1_0_seg overflow problem is an old one, and the solution offered is generally to ensure that all of your functions are declared with the ICACHE_FLASH_ATTR. I have done that, but it is of no consequence because all of that segment, and more, is occupied by libraries.
I should point out that I am using CMake rather than the provided build system because my project is cross-platform, and requires an appropriate source code arrangement. I am using esp-open-sdk, but linking with ESP8266_RTOS_SDK. I have used the FreeRTOS version in an attempt to have some common code with the ESP32 version of my project.
I have a webserver accepting POSTs of JSON to program a robotics-based byte-code interpreter. As well as the network code, it cannot do without the UART, GPIO, PWM or SPI Flash. Some maths is also necessary. So the following libraries are linked (with -nostdlib option):
gcc m main driver hal ssc freertos json pwm net80211 wpa lwip pp phy crypto c
When I got the iram1_0_seg overflow error I used a map file to see what was gobbling up the Flash cache RAM. It turns out that while iram1_0_seg is declared thus...
Name Origin Length
...
iram1_0_seg 0x0000000040100000 0x0000000000008000
...
...it's all library code until 0x000000004010ae93, at which point my code starts. That's 0xae93-0x8000 = 0x2e93 (=11923) bytes of overflow before I even get a look in. I tried the gcc -Os option, but obviously that was futile.
So, where does the problem reside? Have I missed some setting that will make this problem go away? Am I expecting too much of the ESP8266? Something is not right.
Cheers,
Murray