ESP8266:我该如何克服".text"部分不适合"iram1_0_seg"区域的问题? [英] ESP8266: What can I do to overcome "section `.text' will not fit in region `iram1_0_seg'"?

查看:811
本文介绍了ESP8266:我该如何克服".text"部分不适合"iram1_0_seg"区域的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用基于xtensa GCC的工具链链接到ESP8266时,针对.text区域不适合"iram1_0_seg"的常规措施是什么?

What are general measures against the .text region not fitting into "iram1_0_seg" when linking for the ESP8266 using the xtensa GCC based toolchain?

我猜ESP8266s的RAM不足以容纳某些功能.但是,我该怎么做才能将尽可能多的功能移入Flash?

I guess that the ESP8266s RAM is not big enough to hold certain functions. However, what can I do to move as many functions into flash as possible?

以下是链接器返回内容的示例:

Here is an example of what the linker returns:

/home/user/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc  -I/home/user/git/esp-open-sdk/sdk/include -I/home/user/git/esp-open-sdk/sdk/include/json -I/home/user/git/mart3/src/RTMain/ESP8266TargetGroup -Os -D__ESP8266__ -std=c99 -pedantic -Wall -Wpointer-arith -pipe -Wno-unused-parameter -Wno-unused-variable -Os -g -O2 -Wpointer-arith -Wundef -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals  -D__ets__ -DICACHE_FLASH -ffunction-sections -fdata-sections  -L/home/user/.arduino15/packages/esp8266/hardware/esp8266/2.0.0/tools/sdk/lib -L/home/user/.arduino15/packages/esp8266/hardware/esp8266/2.0.0/tools/sdk/ld -Teagle.flash.512k0.ld -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections src/code/CMakeFiles/FX6CodeObj.dir/FX6Generated/src-gen/fxfu___program1.c.obj src/code/CMakeFiles/FX6CodeObj.dir/FX6Generated/src/emptyHello/fxfu___helloart.c.obj src/code/CMakeFiles/FX6CodeObj.dir/FXStd/FXRTMain.c.obj src/code/CMakeFiles/FX6CodeObj.dir/FXStd/NamedList.c.obj  -o src/ARTApp/ARTApp.out  -Wl,--start-group src/ART/libART.a -lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -laxtls -Wl,--end-group
/home/user/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: src/ARTApp/ARTApp.out section `.text' will not fit in region `iram1_0_seg'
collect2: error: ld returned 1 exit status

推荐答案

我不了解Arduino,但如果要使用在此处找到的Espressif库进行编程,请

I don't know about Arduino but if you were to program using the Espressif libraries found here https://github.com/esp8266/esp8266-wiki/raw/master/sdk/ then they have a lot of Macros for things such as that.

例如,使用以下行将ES​​P的主"放入闪存.

As an example the "main" of the ESP is put into flash using the following line.

void ICACHE_FLASH_ATTR user_init(){

如果跟踪ICACHE ...命令,则会找到此定义

If you trace the ICACHE... command you will find this define

#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))

如果您接下来查看espressif如何设置内存部分,请 https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map .irom0.text被标记为闪存.基本上,所有带有ICACHE ...命令的东西都会被加载到闪存中,而没有则没有.

If you then look through how espressif sets up the memory sections https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map .irom0.text is labelled as the flash memory. Basically anything with the ICACHE... command is loaded into flash memory anything without is not.

再次不确定如何将其转换为Arduino代码,但是如果闪存空间不足,可能是时候离开Arduino库了.您没有指定正在使用的ESP突破,我可能在想我,但我相信ESP12-e使用的是更新的芯片,该芯片具有更多的闪存,然后说ESP01,这只是另一种选择.

Again not sure how to translate this to Arduino code but it might be time to move away from the Arduino libraries if you are running out of flash space. You didn't specify which ESP breakout you are using and my mind may be playing tricks on me but I believe the ESP12-e uses a newer chip which has more flash memory then say the ESP01, just another option.

这篇关于ESP8266:我该如何克服".text"部分不适合"iram1_0_seg"区域的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆