`.text1' will not fit in region `iram1_0_seg' - what's the difference?

I built a custom esp8266 lwip library variant based on the v2 Lower Memory (no features) version so I could implement the LWIP_HOOK_IP4_INPUT function.

However, when I build my sketch with the new library, I get a .text1' will not fit in region iram1_0_seg' error.

Between the builds using the two lwip variants, the map file shows two different core.a libraries being used for some reason.

The bad build uses /tmp/arduino/cores/b694a3edb968e8b3b6f5c53838d22f44/core.a and the good build uses /tmp/arduino/sketches/96E307F36729D6C219729E15DDE2A6C3/core/core.a

The bad build puts all of the text in iram. The good build does not.

Where might I look to figure out why two different core.a files are being used?

I think that the two different core file locations is a red-herring.

The issue is clear from the map files being generated. In the lwip variant where LWIP_HOOK_IP4_INPUT function is implemented, many more functions from the lwip library are being put into .text1


 .text.glue2esp_err
                0x0000000040105144       0x1e /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                0x0000000040105148                glue2esp_err
 *fill*         0x0000000040105162        0x2
 .text.esp2glue_err
                0x0000000040105164       0x1e /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                0x0000000040105168                esp2glue_err
 *fill*         0x0000000040105182        0x2
 .text.glue2esp_linkoutput
                0x0000000040105184      0x111 /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                                        0x115 (size before relaxing)
                0x0000000040105194                glue2esp_linkoutput
 *fill*         0x0000000040105295        0x3
 .text.lwip_init
                0x0000000040105298        0xa /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                0x000000004010529c                lwip_init
 *fill*         0x00000000401052a2        0x2
 .text.dhcps_start
                0x00000000401052a4       0x2a /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                                         0x32 (size before relaxing)
                0x00000000401052a8                dhcps_start
 *fill*         0x00000000401052ce        0x2
 .text.dhcp_cleanup
                0x00000000401052d0       0x11 /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                0x00000000401052d8                dhcp_cleanup
 *fill*         0x00000000401052e1        0x3
 .text.dhcp_release
                0x00000000401052e4       0x1b /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                                         0x1f (size before relaxing)
                0x00000000401052e8                dhcp_release
 *fill*         0x00000000401052ff        0x1
 .text.dhcp_start
                0x0000000040105300       0x28 /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                                         0x2c (size before relaxing)
                0x0000000040105304                dhcp_start
 .text.dhcp_stop
                0x0000000040105328        0xd /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                0x000000004010532c                dhcp_stop
 *fill*         0x0000000040105335        0x3
 .text.glue2esp_ifupdown
                0x0000000040105338       0x4f /home/jjoshua/Arduino/hardware/esp8266com/esp8266/tools/sdk/lib/liblwip2-536-hook.a(lwip-esp.o)
                                         0x53 (size before relaxing)

Sounds like an ISR that is too large to fit into the very limited space available in iRAM.

The only thing that I did was add an empty hook function like this...

It is otherwise identical to the no features low memory v4 variant. Why would adding this hook require so much more stuff to be moved into text from flash?

Can anyone help with this? I haven't been able to make additional progress.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.