Closed Abhay-2412 closed 1 year ago
Total sizes:
Used static DRAM: 38048 bytes ( 86532 remain, 30.5% used)
.data size: 15192 bytes
.bss size: 22856 bytes
Used static IRAM: 119250 bytes ( 11822 remain, 91.0% used)
.text size: 118223 bytes
.vectors size: 1027 bytes
Used Flash size : 864827 bytes
.text : 680243 bytes
.rodata : 184328 bytes
Total image size: 999269 bytes (.bin may be padded larger)
above is what i get if i comment bluetooth functionality and check
i hope below info helps https://gist.github.com/Abhay-2412/4cbb666bdf0733574ec574d0688ca483
What partition table and RAM size were you using in Arduino IDE? Try to use that/choose that from the menuconfig. It would be helpful I you gave your sdkconfig (please use github gist or pastebin and don't paste here directly)
https://gist.github.com/Abhay-2412/42345dc9e5226baf3f363f9624e8605e
Please refer above link for my sdkconfig file
I tried building a hello world project with your sdkconfig and it built fine, http://ix.io/4H31 and the size is http://ix.io/4H33.
char* host = "192.168.149.237";
Are you using a lot of heap? I suspect enabling wifi and bluetooth has very little to do with your error.
Few things you can try:
Basically my esp32 is using camera and some ICs like GPIO expander ,Battery charger IC i donno which functionality using heap
the reason why i assumed its because of wifi or bluetooth because i commented bluetooth related function then it got build
Total sizes:
Used static DRAM: 38048 bytes ( 86532 remain, 30.5% used)
.data size: 15192 bytes
.bss size: 22856 bytes
Used static IRAM: 119250 bytes ( 11822 remain, 91.0% used)
.text size: 118223 bytes
.vectors size: 1027 bytes
Used Flash size : 864827 bytes
.text : 680243 bytes
.rodata : 184328 bytes
Total image size: 999269 bytes (.bin may be padded larger)
Few things you can try:
- Try building with optimization for size (In menuconfig Compiler options -> Optimization Level -> Optimize for size)
- Have a look at https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/performance/size.html
- Have a look at https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/performance/ram-usage.html#optimize-iram-usage
i set optimization level to size still same error
Total sizes:
Used static DRAM: 42928 bytes ( 81652 remain, 34.5% used)
.data size: 21272 bytes
.bss size: 21656 bytes
Used static IRAM: 138090 bytes ( -7018 remain, 105.4% used) Overflow detected! You can run idf.py size-files for more information.
.text size: 137063 bytes
.vectors size: 1027 bytes
Used Flash size : 1146460 bytes
.text : 932147 bytes
.rodata : 214057 bytes
Total image size: 1305822 bytes (.bin may be padded larger)
but size has reduced pretty much
@Abhay-2412
Used static IRAM: 138090 bytes ( -7018 remain, 105.4% used) Overflow detected! You can run idf.py size-files for more information.
This doesn't mean your overall binary size is too large. It just means that your binary uses too much IRAM. By default, most of your binary (i.e., functions) will be stored in flash memory. However, certain functions are placed in IRAM for performance or behavioral reasons.
You can use idf.py size-components
and idf.py size-files
to get a summary of IRAM usage on a per-component and per-file level respectively. This should help you track down which feature is using the most IRAM.
To reduce IRAM usage, please see the optimizing IRAM usage doc. This should list the various menuconfig options to move particular component functions from IRAM back into flash memory, thus saving some IRAM.
Hello, I successfully reduced the storage utilization of IRAM through optimization techniques. However, even after these optimizations, the IRAM is still occupying approximately 99.8 percent of its capacity. I would greatly appreciate further guidance or suggestions on how to address this situation. Thank you.
Total sizes:
Used static DRAM: 42936 bytes ( 81644 remain, 34.5% used)
.data size: 21272 bytes
.bss size: 21664 bytes
Used static IRAM: 130862 bytes ( 210 remain, 99.8% used)
.text size: 129835 bytes
.vectors size: 1027 bytes
Used Flash size : 1158408 bytes
.text : 943531 bytes
.rodata : 214621 bytes
Total image size: 1310542 bytes (.bin may be padded larger)
You can use idf.py size-components and idf.py size-files to get a summary of IRAM usage on a per-component and per-file level respectively. This should help you track down which feature is using the most IRAM.
If your IRAM usage is still high after doing what @Dazza0 said, it's probably best to revisit/recheck your code and/or the component's and libraries you're using.
below are logs for
size-files https://gist.github.com/Abhay-2412/cbab6770882a996d487bc8a897af60c5
size-components https://gist.github.com/Abhay-2412/00040a11233dafafd5844c4f78c8bcc8
libarduino.a
Are you using arduino as a component? If it's because of some libraries try finding alternatives for native native ESP-IDF?
Yes i'm using Arduino as component ,I have successfully compiled and tested the Arduino code, and now I want to import it into ESP-IDF without spending additional time rewriting the code in ESP-IDF.
In that case, you're most probably out of luck, maybe someone more experienced than me might be able to help but adding Arduino as a component is going to add size overhead.
IMO if you really need Arduino and don't want to move away from it either you can stick with using Arduino IDE or move a chip that has bit of more RAM.
@Abhay-2412 I'm closing this issue as there aren't any clear action items. Please try some of the suggestions posted above in this thread.
Use idf.py size-components
or idf.py size-files
to find out what components/files are consuming the most IRAM.
Hello just a small doubt Why no IRAM overflow issues in Arduino IDE build, but overflow occurs using Arduino as a component?
You probably don't have exactly the same configuration (sdkconfig) in these two cases. You can update your sdkconfig used in arduino-as-component build to match the sdkconfig used in Arduino.
Answers checklist.
IDF version.
v4.4.5
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32 Wrover Module
Power Supply used.
External 3.3V
What is the expected behavior?
In my project, I successfully utilized several ICs that communicate via I2C, as well as a camera. Additionally, the project incorporated both Wi-Fi and Bluetooth functionality. However, when building the project into the ESP-IDF, an IRAM error is encountered.
What is the actual behavior?
IRAM0 segment data does not fit
Steps to reproduce.
i just turn on BLE functionality and i wrote some functions and tried to test ended up with this error
Debug Logs.
More Information.
when ever i commented bluetooth part and tried to build its getting build