# Compiling the usermod results an error "section \`.text1' will not fit in region \`iram1\_0\_seg'"

**URL:** https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639
**Category:** Usermods
**Created:** [October 27, 2023, 3:28pm UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639 "2023-10-27T15:28:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dma\_k](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/dma_k/32/4159_2.png) [@dma\_k](https://wled.discourse.group/u/dma_k)
#### Post date: [October 27, 2023, 3:28pm UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/1 "2023-10-27T15:28:36Z")

</div>

Dear community,

I have enabled BME280 usermod on WLED v0.14.0 this way:

```auto
[env:usermod_bme280_d1_mini]
extends = env:d1_mini
build_flags =
  ${common.build_flags_esp8266}
  -D USERMOD_BME280
lib_deps =
  ${esp8266.lib_deps}
  finitespace/BME280@^3.0.0
  Wire

```

and that results the error during linking:

```auto
Linking .pio\build\usermod_bme280_d1_mini\firmware.elf
c:/users/test/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\usermod_bme280_d1_mini\firmware.elf section `.text1' will not fit in region `iram1_0_seg'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\usermod_bme280_d1_mini\firmware.elf] Error 1
=== [FAILED] Took 36.77 seconds ===

```

It seems like the firmware does not fit the available memory 😪  
I am a bit puzzled, it used to compile fine with WLED v0.13.3.

---

<div class="post-metadata">

### Author: ![divsys](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@divsys](https://wled.discourse.group/u/divsys)
#### Post date: [October 27, 2023, 4:05pm UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/2 "2023-10-27T16:05:07Z")

</div>

ESP8266 support has become more and more difficult now that WLED has grown.

I did find an attempt someone used to shoehorn the code into a smaller than normal 8266, but it may help free space by dropping features if you add:

-D WLED\_DISABLE\_ALEXA  
-D WLED\_DISABLE\_BLYNK  
-D WLED\_DISABLE\_HUESYNC  
-D WLED\_DISABLE\_INFRARED  
-D WLED\_DISABLE\_2D

And in the worst case, even :

-D WLED\_DISABLE\_OTA

Although that last one will mean you have to do your updates manually, no more Over The Air WiFi updates. Someone else may pop in with suggestions to “drop something else” to allow a BME280 build.

Unfortunately, the writing is on the wall for the 8266 and it will end up being unsupported eventually (not yet).

---

<div class="post-metadata">

### Author: ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)
#### Post date: [October 27, 2023, 8:05pm UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/3 "2023-10-27T20:05:10Z")

</div>

Use `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48`

---

<div class="post-metadata">

### Author: ![dma\_k](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/dma_k/32/4159_2.png) [@dma\_k](https://wled.discourse.group/u/dma_k)
#### Post date: [October 27, 2023, 11:58pm UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/4 "2023-10-27T23:58:22Z")

</div>

Thanks, `-D WLED_DISABLE_INFRARED` worked just fine.

---

<div class="post-metadata">

### Author: ![dma\_k](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/dma_k/32/4159_2.png) [@dma\_k](https://wled.discourse.group/u/dma_k)
#### Post date: [October 28, 2023, 12:02am UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/5 "2023-10-28T00:02:53Z")

</div>

Great! `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48` worked as well! Actually that was present in `platformio.ini`, but I failed to Google that solution.

---

<div class="post-metadata">

### Author: ![divsys](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@divsys](https://wled.discourse.group/u/divsys)
#### Post date: [October 28, 2023, 5:42am UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/6 "2023-10-28T05:42:38Z")

</div>

@blazoncek has far more knowledge than me (or many, many others) on these topics. You would do well to heed his suggestions 😉

---

<div class="post-metadata">

### Author: ![dma\_k](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/dma_k/32/4159_2.png) [@dma\_k](https://wled.discourse.group/u/dma_k)
#### Post date: [November 4, 2023, 2:20am UTC](https://wled.discourse.group/t/compiling-the-usermod-results-an-error-section-text1-will-not-fit-in-region-iram1-0-seg/9639/7 "2023-11-04T02:20:53Z")

</div>

Something interesting was happening. I have tried to upload the compiled firmware to WLED

```auto
curl -v -F update=@firmware.bin http://wled.home/update

```

but it replied `Update failed! Please check your file and retry!`  
When I tried to upload the [official firmware](https://github.com/Aircoookie/WLED/releases/tag/v0.14.0)

```auto
curl -v -F update=@WLED_0.14.0_ESP8266.bin http://wled.home/update

```

it replied `Update successful! Rebooting...`  
Now two issues:

- Not clear why my custom firmware was not accepted.
- After flashing the official firmware, WLED lighted only one LED and didn’t connect to WiFi and neither created a WiFi AP, sort of left in unpredictable state. Are the settings erased during the flashing? Any idea how to recover?
